• NodeRED中配置周期性执行、指定时间阶段执行、指定时间执行事件


    场景

    Node-RED简介与Windows上安装、启动和运行示例:

    https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/121884766

    在inject节点可以设置重复触发的周期性事件。

    比如每两秒输出一次时间。

    注:

    博客:
    https://blog.csdn.net/badao_liumang_qizhi
    关注公众号
    霸道的程序猿
    获取编程相关电子书、教程推送与免费下载。

    实现

    1、周期性执行

    json示例数据

    [{"id":"71107f63.c2686","type":"inject","z":"f8f370d9.7ccc3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":280,"wires":[["6866ece6.3b1964"]]},{"id":"6866ece6.3b1964","type":"debug","z":"f8f370d9.7ccc3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":420,"y":300,"wires":[]}]

    2、指定时间阶段周期性执行

    json数据

    [{"id":"2ee46c27fe222be5","type":"inject","z":"4bc32962b964d23d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/1 0 * * 1,3,5","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":190,"y":360,"wires":[["26092280afbca76a"]]},{"id":"26092280afbca76a","type":"debug","z":"4bc32962b964d23d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":400,"y":380,"wires":[]}]

    3、指定时间执行

    json数据

    [{"id":"9e4a370a93991fdc","type":"inject","z":"4bc32962b964d23d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * 1","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":190,"y":500,"wires":[["4af3067548fcc9f6"]]},{"id":"4af3067548fcc9f6","type":"debug","z":"4bc32962b964d23d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":380,"y":540,"wires":[]}]
  • 相关阅读:
    DataGridView编辑后立即更新到数据库的两种方法
    DataTable 转换成 Json的3种方法
    C# 应用程序配置文件App.Config和web.config
    C#中使用JsonConvert解析JSON
    C#JsonConvert.DeserializeObject反序列化json字符
    WIN10远程桌面、常用命令
    control[控制面板]的参数
    win10企业版变成win10专业版的设置教程
    DLL加密
    微信小程序顶部tab
  • 原文地址:https://www.cnblogs.com/badaoliumangqizhi/p/16136509.html
Copyright © 2020-2023  润新知