场景
Node-RED简介与Windows上安装、启动和运行示例:
https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/121884766
Node-RED怎样导出导入流程为json文件:
https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/124130985
Node-RED中函式节点可以建立JavaScript函数来处理msg物件。
例如使用change节点指定x和y属性的值,然后使用function节点将x和y的值相加
并输出和。
注:
博客:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。
实现
1、编辑change节点,新增两个设定操作
msg.payload = msg.x + msg.y; return msg;
3、json数据
[{"id":"997333a8.03e08","type":"inject","z":"b7057587.2e51d8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":160,"wires":[["339cfc81.711174"]]},{"id":"9bcbb391.04dd2","type":"function","z":"b7057587.2e51d8","name":"msg.payload = msg.x + msg.y","func":"msg.payload = msg.x + msg.y;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":160,"wires":[["f961b950.8c5de8"]]},{"id":"f961b950.8c5de8","type":"debug","z":"b7057587.2e51d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":240,"wires":[]},{"id":"339cfc81.711174","type":"change","z":"b7057587.2e51d8","name":"","rules":[{"t":"set","p":"x","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"y","pt":"msg","to":"2","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":160,"wires":[["9bcbb391.04dd2"]]}]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。