博客
关于我
Node-RED中配置周期性执行、指定时间阶段执行、指定时间执行事件
阅读量:793 次
发布时间:2023-02-16

本文共 1641 字,大约阅读时间需要 5 分钟。

场景

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

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

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

注:

博客:

关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。

实现

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":[]}]

转载地址:http://fsjfk.baihongyu.com/

你可能感兴趣的文章
nginx反向代理解决跨域问题,使本地调试更方便
查看>>
Nginx反向代理配置
查看>>
Nginx启动SSL功能,并进行功能优化,你看这个就足够了
查看>>
nginx启动脚本
查看>>
Nginx在Windows上和Linux上(Docker启动)分别配置基本身份认证示例
查看>>
Nginx在Windows下载安装启动与配置前后端请求代理
查看>>
Nginx多域名,多证书,多服务配置,实用版
查看>>
nginx如何实现图片防盗链
查看>>
Nginx学习总结(13)——Nginx 重要知识点回顾
查看>>
Nginx学习总结(14)——Nginx配置参数详细说明与整理
查看>>
nginx学习笔记002---Nginx代理配置_案例1_实现了对前端代码的方向代理_并且配置了后端api接口的访问地址
查看>>
Nginx安装与常见命令
查看>>
Nginx安装及配置详解
查看>>
nginx安装配置
查看>>
Nginx实战经验分享:从小白到专家的成长历程!
查看>>
Nginx实现反向代理负载均衡
查看>>
nginx实现负载均衡
查看>>
nginx常用命令及简单配置
查看>>
nginx开机启动脚本
查看>>
nginx异常:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf
查看>>