2024年4月6日 星期六

Node-Red & ModBus

 Node-Red & ModBus  FC=3,FC=1







    FC=3  Hoiding Register 40001-





FC=3  Hoiding Register 40001-  Quality=2



FC=1 Coil output 00001-




[{"id":"7d6e0cccb6c33e9f","type":"inject","z":"24588df96774b640","name":"Read 16bit Integer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":200,"wires":[["75c599dcc7994bdf","bc8a243518388a17"]]},{"id":"bc8a243518388a17","type":"function","z":"24588df96774b640","name":"fc=3","func":"var fc=3;\nvar sa=10;\nvar addresses=1;\n//var slave_ip=msg.payload.slave_ip;\n//msg.slave_ip=\"192.168.1.31\";\nmsg.payload={value: msg.payload, 'fc': fc, 'unitid': 1, 'address': sa , 'quantity': addresses };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":280,"wires":[["527ab33a90ef19a0"]]},{"id":"527ab33a90ef19a0","type":"modbus-flex-getter","z":"24588df96774b640","name":"local getter Flex","showStatusActivities":true,"showErrors":true,"showWarnings":true,"logIOActivities":false,"server":"f47b2c4e39c520d2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":460,"y":280,"wires":[[],["365e41f200a263ee","c62aa01a739d61e4"]]},{"id":"75c599dcc7994bdf","type":"modbus-getter","z":"24588df96774b640","name":"Holding register FC=3","showStatusActivities":false,"showErrors":false,"showWarnings":true,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"4","quantity":"1","server":"f47b2c4e39c520d2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":360,"y":200,"wires":[[],["237d7fed407d661f","0b899d5134c0ee37"]]},{"id":"365e41f200a263ee","type":"function","z":"24588df96774b640","name":"","func":"const buf= Buffer.from(msg.payload.buffer)\n//const buf = Buffer.from(msg.payload.buffer);\nconst value = buf.readUInt16BE();\nmsg.value = value;\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":320,"wires":[["038205f9b5b51c0f"]]},{"id":"237d7fed407d661f","type":"modbus-response","z":"24588df96774b640","name":"","registerShowMax":20,"x":590,"y":200,"wires":[]},{"id":"c62aa01a739d61e4","type":"modbus-response","z":"24588df96774b640","name":"","registerShowMax":20,"x":690,"y":260,"wires":[]},{"id":"038205f9b5b51c0f","type":"debug","z":"24588df96774b640","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"value","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":320,"wires":[]},{"id":"3988827b7bc596a1","type":"modbus-getter","z":"24588df96774b640","name":"Coils FC=1","showStatusActivities":false,"showErrors":false,"showWarnings":true,"logIOActivities":false,"unitid":"1","dataType":"Coil","adr":"0","quantity":"8","server":"f47b2c4e39c520d2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":250,"y":540,"wires":[[],["a31403ee1ac237e3","cf7ef3f5e7e6704d"]]},{"id":"a31403ee1ac237e3","type":"modbus-response","z":"24588df96774b640","name":"","registerShowMax":20,"x":450,"y":520,"wires":[]},{"id":"c18b75e056ef56ab","type":"inject","z":"24588df96774b640","name":"Read coils","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":540,"wires":[["3988827b7bc596a1"]]},{"id":"cf7ef3f5e7e6704d","type":"function","z":"24588df96774b640","name":"Process data","func":"const buf= Buffer.from(msg.payload.buffer)\n//const buf = Buffer.from(msg.payload.buffer);\nconst value = buf;\nmsg.value = value;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":600,"wires":[["b30ee882c4c5ed09"]]},{"id":"9d380033d218f803","type":"inject","z":"24588df96774b640","name":"Read multiple","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":360,"wires":[["a09ddaefa209d81d"]]},{"id":"a09ddaefa209d81d","type":"modbus-getter","z":"24588df96774b640","name":"Read multiple FC=3","showStatusActivities":false,"showErrors":false,"showWarnings":true,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"11","quantity":"2","server":"f47b2c4e39c520d2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":300,"y":360,"wires":[[],["6822c2cc20151e33","28f3e05463f2da28"]]},{"id":"6822c2cc20151e33","type":"modbus-response","z":"24588df96774b640","name":"","registerShowMax":20,"x":550,"y":380,"wires":[]},{"id":"4c142b9ab7ad1cbf","type":"modbus-read","z":"24588df96774b640","name":"Holding register FC=3","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"showWarnings":true,"unitid":"","dataType":"HoldingRegister","adr":"0","quantity":"2","rate":"10","rateUnit":"m","delayOnStart":false,"startDelayTime":"","server":"f47b2c4e39c520d2","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":140,"y":80,"wires":[[],["0c21a497aab2e5d4"]]},{"id":"0c21a497aab2e5d4","type":"debug","z":"24588df96774b640","name":"Modbus Read","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":380,"y":80,"wires":[]},{"id":"b30ee882c4c5ed09","type":"debug","z":"24588df96774b640","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":600,"wires":[]},{"id":"28f3e05463f2da28","type":"debug","z":"24588df96774b640","name":"debug ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":440,"wires":[]},{"id":"66c1544f4b622fd5","type":"comment","z":"24588df96774b640","name":"Hoiding Register 40001-","info":"","x":130,"y":160,"wires":[]},{"id":"64e8539144073dd0","type":"comment","z":"24588df96774b640","name":"Hoiding Register 40001-","info":"","x":130,"y":40,"wires":[]},{"id":"27bcda518e5a851b","type":"comment","z":"24588df96774b640","name":"Hoiding Register 40001-","info":"","x":130,"y":320,"wires":[]},{"id":"f232136577c20abd","type":"comment","z":"24588df96774b640","name":"Coil output 00001-","info":"","x":110,"y":500,"wires":[]},{"id":"0b899d5134c0ee37","type":"debug","z":"24588df96774b640","name":"debug 294","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":160,"wires":[]},{"id":"57d4fd97157e2302","type":"comment","z":"24588df96774b640","name":"Address=11 , Quality=2","info":"","x":300,"y":420,"wires":[]},{"id":"f47b2c4e39c520d2","type":"modbus-client","name":"MODBUS Eth. TCP/IP","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true,"showWarnings":true,"showLogs":true}]

https://www.icdt.com.tw/main/index.php/2013-07-09-05-16-50/modbus-free-software

MODBUS 免費工具軟體

 

ICDT MODBUS 免費工具軟體是一系列包含 MODBUS TCP 與 RTU 設備端的模擬程式與客戶端程式,是 元米科技 累積二十餘年現場實務與研發經驗所開發的最佳工具。

程式內還提供了數值格式計算工具讓新手無痛的理解16進制、浮點數等變化。

當然,如果您沒有足夠的時間或經驗完成所需的軟體、硬體與韌體開發工作,可以交由 元米科技 為您服務。

設備端的模擬程式包含 MODBUS RTU Slave 與 MODBUS TCP Server 模擬程式,是開發 MODBUS 客戶端通訊的開發、MODBUS Gateway 的模擬、SCADA 圖控的模擬、人機界面模擬等應用的極佳輔助工具。

客戶端程式包含 MODBUS RTU Master 與 MODBUS TCP Client,彈性易懂的介面,是您 MODSCAN 等工具軟體的最佳替代方案。

另外 MODBUS RTU Recorder 通訊紀錄程式,則是 RTU 協議最佳的監聽分析工具,是您您現場異常狀態排除的利器。

Network Scanner 程式則包含網路 IP 搜尋與 TCP Port 搜尋兩項功能。幫助使用者瞭解網路上設備資訊,並提供快速搜索與連接 TCP Server 介面,以快速連接目標設備。您也可以自行定義連接的 TCP Client 程式,成為最佳的通訊入口界面。

ICDT MODBUS 免費工具軟體歡迎您使用並提供寶貴意見,相關建議請聯繫 Eric 電子信箱 eric.icdt@msa.hinet.net 

smile 關於『各式 MODBUS 工具程式比較分析』請參考  

cool 如果您無法判斷改使用哪個軟體,可以利用這個表單協助您取得資訊 : https://forms.gle/SHjfcwEH7jorAWSZ7

 

 

 

MODBUS TCP Client 測試程式
MODBUS TCP Server 模擬程式
MODBUS RTU Master 測試程式
MODBUS RTU Slave 模擬程式
MQTT MODBUS Gateway

沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...