BiancoRoyal/node-red-contrib-modbus

Modbus RTU connection not working

eljugador003 opened this issue · 1 comments

Which node-red-contrib-modbus version are you using?

"node-red-contrib-modbus": "~5.23.1"

What happened?

after, a while(a whole day) of reading and watching videos, i gave up, for some reason that do not know i can´t read or write anything to and from the temperature controller, i checked that the problem is just in node-red itself with this https://manpages.ubuntu.com/manpages/impish/man1/mbpoll.1.html
and i get that data there, i would like to know what i am missing that i can´t make work in node-red ;(
versions of everything:
Node-RED version: v3.0.2
Node.js version: v16.16.0
raspberry pi running Linux raspberrypi 5.15.32-v7+
modbud.log

Server

None/This is related to a node that doesn't connect to a server

How can this be reproduced?

[ { "id": "17a85d0fb652631b", "type": "tab", "label": "Flow 2", "disabled": false, "info": "", "env": [] }, { "id": "66318382f4f877c8", "type": "modbus-read", "z": "17a85d0fb652631b", "name": "", "topic": "", "showStatusActivities": true, "logIOActivities": false, "showErrors": true, "unitid": "1", "dataType": "InputRegister", "adr": "1001", "quantity": "1", "rate": "5", "rateUnit": "s", "delayOnStart": true, "startDelayTime": "10", "server": "7e3e35b593a562b7", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "x": 370, "y": 180, "wires": [ [ "70d57294709c1b89" ], [ "0afbdb14860afb40" ] ] }, { "id": "70d57294709c1b89", "type": "debug", "z": "17a85d0fb652631b", "name": "debug 9", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 600, "y": 180, "wires": [] }, { "id": "0afbdb14860afb40", "type": "modbus-response", "z": "17a85d0fb652631b", "name": "", "registerShowMax": "1", "x": 590, "y": 240, "wires": [] }, { "id": "7e3e35b593a562b7", "type": "modbus-client", "name": "test1", "clienttype": "serial", "bufferCommands": true, "stateLogEnabled": true, "queueLogEnabled": false, "failureLogEnabled": true, "tcpHost": "127.0.0.1", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB0", "serialType": "RTU-BUFFERD", "serialBaudrate": "19200", "serialDatabits": "8", "serialStopbits": "2", "serialParity": "even", "serialConnectionDelay": "1000", "serialAsciiResponseStartDelimiter": "0x3A", "unit_id": "1", "commandDelay": "1", "clientTimeout": "1000", "reconnectOnTimeout": true, "reconnectTimeout": "2000", "parallelUnitIdsAllowed": false } ]

What did you expect to happen?

geting the PV value of the temperature controller in the debug 9 node or in the modbus response node

Other Information

this is what a i get with de mbpoll cil program
mbpoll 1.4-12 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.

Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 1001, count = 1
Communication.........: /dev/ttyUSB0, 19200-8E2
t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave 1...
[1001]: 22

OK MEN :(
i am actually fuking stupid, this modbus is not PLC address base, it is protocol address base, so if the datasheet of the thing say that if you want register 1001(03E8 in hex) with function code 04, in the msg.payload = { value: msg.payload, 'fc': 4, 'unitid': 1, 'address': 1000, 'quantity': 1 } you have to put that address minus 1 so 1000, because this is protocol base, and the datasheet of the temperature controller is for plcs base modbus adressing, so if anyone out there is stupid like me, hope this helps