node-red与基恩士SR-710(配件N-R2)

通讯方式:串口连接好设备后

基恩士调试在R-232里面修改配置文件

切记报头和终端看清在修改,根据自己需求

基恩士与node-red串口通讯避坑_bc

基恩士与node-red串口通讯避坑_bc_02

串口测试工具是通的但是node-red就是不出现数据,这是因为在发送命令的时候“LON”为触发命令

他后面有个空格符号所以在node-red里面不触发命令的原因。

基恩士与node-red串口通讯避坑_ico_03



基恩士,里面设置列表里把“终端”里的默认0D删掉试试看这里OD就是回车

也可能是你串口调试助手自带的回车

[{"id":"bbee4ee807b002da","type":"ui_button","z":"fcb7bd6297ebcf4e","name":"","group":"d7831b49353f3e4a","order":40,"width":0,"height":0,"passthru":false,"label":"请扫描","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"click","payloadType":"str","topic":"","topicType":"str","x":110,"y":6080,"wires":[["3db3abed6a353d5f"]]},{"id":"3db3abed6a353d5f","type":"function","z":"fcb7bd6297ebcf4e","name":"","func":"msg.payload = \"LON\\r\";\nreturn msg;\n\n\n\n// function stringToHex(str) {\n//   var buf = Buffer.from(str, 'utf8');\n//   var hex = buf.toString('hex');\n//   return hex;\n// }","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":6080,"wires":[["fe4896e574b099ef"]]},{"id":"fe4896e574b099ef","type":"serial request","z":"fcb7bd6297ebcf4e","name":"","serial":"serial_config_id","x":440,"y":6080,"wires":[["007554ecc98f6735"]]},{"id":"007554ecc98f6735","type":"debug","z":"fcb7bd6297ebcf4e","name":"debug 450","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":6080,"wires":[]},{"id":"d7831b49353f3e4a","type":"ui_group","name":"堆垛机控制","tab":"3a76b7609c0d7a3f","order":2,"disp":true,"width":17,"collapse":true,"className":""},{"id":"serial_config_id","type":"serial-port","serialport":"COM10","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"0","bin":"false","out":"interbyte","addchar":"","responsetimeout":""},{"id":"3a76b7609c0d7a3f","type":"ui_tab","name":"设备状态","icon":"fa-cogs","order":4,"disabled":false,"hidden":false}]

基恩士与node-red串口通讯避坑_bc_04