0
有沒有辦法獲得Modbus讀取節點狀態更改?該節點有一個「活動標籤」thet顯示狀態(閱讀,輪詢,錯誤,超時等..)有沒有辦法讓它作爲msg.payload?節點紅獲取Modbus TCP讀取狀態更改
有沒有辦法獲得Modbus讀取節點狀態更改?該節點有一個「活動標籤」thet顯示狀態(閱讀,輪詢,錯誤,超時等..)有沒有辦法讓它作爲msg.payload?節點紅獲取Modbus TCP讀取狀態更改
感謝Hardillb不知道該節點!我剛剛做了一個簡單而有用的Modbus狀態管理流程,只需要一個觸發器,只要錯誤時間>讀取時間就發送一個輸出。這是流程:
[{"id":"f2ad55d5.52afe8","type":"status","z":"e34a61f.64e60a","name":"modbus status","scope":["b294ab2d.91ac88"],"x":323,"y":545,"wires":[["14f7bc93.c66a23"]]},{"id":"14f7bc93.c66a23","type":"function","z":"e34a61f.64e60a","name":"Parse error","func":"var status = msg.status.text;\n\nvar error = false;\n\nmsg = {};\n\nstatus = status.split(\" \");\n\nswitch(status[0]){\n case \"timeout\":\n case \"EMPTY\":\n case \"error\":\n case \"waiting\":\n error = true;\n}\n\nif(!error)\nmsg.reset = 1; //reset the trigger, no errors\n\nelse \nmsg.payload = true; //start trigger\n\n\nreturn msg;","outputs":1,"noerr":0,"x":566,"y":547,"wires":[["a740b015.432ca"]]},{"id":"a740b015.432ca","type":"trigger","z":"e34a61f.64e60a","op1":"","op2":"{ \"status\": 400 }","op1type":"nul","op2type":"json","duration":"2000","extend":false,"units":"ms","reset":"","name":"Trigger error","x":786.5,"y":547,"wires":[["e82e77fe.eb8948"]]},{"id":"e82e77fe.eb8948","type":"debug","z":"e34a61f.64e60a","name":"","active":true,"console":"false","complete":"true","x":1007,"y":549,"wires":[]}]