场景
Node-RED简介与Windows上安装、启动和运行示例:
Node-RED简介与Windows上安装、启动和运行示例_霸道流氓气质的博客-CSDN博客
在inject节点可以设置重复触发的周期性事件。
比如每两秒输出一次时间。
注:
博客:
霸道流氓气质的博客_CSDN博客-C#,架构之路,SpringBoot领域博主
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。
实现
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":[]}]
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/136008.html