Can connect to Modbus RTU slave with Modbus-serial but not the Modbus Package

Hi Everyone

I am using node red to connect to a Pump that uses Modbus RTU with Node-Red hosted on a RPI 3, using this dongle 1PCS USB to RS485 Converter Adapter Support Win7 XP Vista Linux Mac OS WinCE5.0 RS 485 RS 485|Integrated Circuits| - AliExpress

Now i am having a weird issue. Previously I was using Modbus TCP and built everything with the node-red-contrib-modbus package and that was working perfect, but because some other components doesnt support TCP, I wanted to switch to RTU

Now the weird thing is, that I cant get the mobus-read to work with serial, but I tried the package node-red-contrib-serial-modbus and with the modbusserial-in node, I can connect and read the data from my pump RTU slave

The settings between the two different readers are exactly the same and I made sure i only have 1 of them enabled at the time, so they shouldnt be conflicting.
I dont understand where the issue lies. I was hoping to be able to use the nodes from node-red-contrib-modbus as they are quite a lot easier to work with

Does anyone have any suggestions to what might be the issue ? ive attached the configuration of the two different modbus read nodes


[{"id":"428a274d.88c1c8","type":"modbus-read","z":"dff53b0e.d3f2c8","d":true,"name":"tset","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"17","dataType":"HoldingRegister","adr":"201","quantity":"1","rate":"2","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"8d98f278.e2031","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":850,"y":260,"wires":[["52a5fa72.b2bd14"],[]]},{"id":"3a692e41.abbab2","type":"modbusSerial in","z":"dff53b0e.d3f2c8","d":true,"port":"dc91bdb8.4b38e","slaves":"17","start":"201","count":"1","dtype":"holding","period":"2","topic":"","name":"","x":1340,"y":280,"wires":[["f0c8c03e.514e3","f4d6a2c3.a26e8"]]},{"id":"8d98f278.e2031","type":"modbus-client","z":"","name":"test","clienttype":"serial","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"19200","serialDatabits":"8","serialStopbits":"1","serialParity":"even","serialConnectionDelay":"500","unit_id":"17","commandDelay":"1","clientTimeout":"5000","reconnectOnTimeout":true,"reconnectTimeout":"1000","parallelUnitIdsAllowed":true},{"id":"dc91bdb8.4b38e","type":"modbusSerialConfig","z":"","port":"/dev/ttyUSB0","baud":"19200","data":"8","parity":"even","stop":"1","name":"test magna"}]

have you tried deleting the serial node (AND the serial config node) then deploy, then re-starting node-red to be sure nothing is holding onto the connection?

Thank you so much for the tip ! i just tried deleting all serial profiles, restart node red and then it worked ! no idea that could be an issue but easy fix !

Hmm now i am seeing something weird though. when i use FC3 to read 1 - 12 addresses everything works fine, but when I go above that, i stop receiving the answer back from the modbus slave

i can see that the msg is recieved fine on the slave device, i just dont get any data back

I tried reading the 62 addresses in one go with the modbusread-serial node, and that one works fine

would it be better to use the flex read and then read the needed 62 addresses piece by piece ?

That is always the worst way (as you end up with inconsistent data)

I would raise an issue on the repository (might be a bug / or the author might be able to explain it)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.