I understand but you were still reading 2 separate values from the same unit. My recommendation is to group together reads into 1 batch.
E.g. if you read address 0 and address 1 then read 2 from address 0. if you read address 0 and address 4 then read 5 from address 0.
Once you have updated nodejs and node-red and installed buffer-parser, I'll show you how to pick out and convert & name your values from the modbus response.
When working on complex Modbus networks and where a high dynamic factor is required, it is of fundamental importance not to saturate the transmit - receive buffer. The advice is to use a sequencer to manage the polling of commands on the network. The size of the packet is not important but the fact that too many commands overlap on the network channel.
R.
steve the manufacturer of our mod bus device is still resolving about updating his firmware, so i thought better of the continuity while they resolve about installing the node buffer parse, i have a little problem with my sql i already made the connection with Mysql and created only one table for initial test as the image below node red sends the record to my sql but it only writes with the null value and the value would be 7450028 on average I need help with that
[{"id":"c050e5b.f41e518","type":"tab","label":"VazĂŁo Agua","disabled":false,"info":""},{"id":"4b763428.e33bcc","type":"modbus-read","z":"c050e5b.f41e518","name":"Consumo Agua Caldeira","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"9","dataType":"HoldingRegister","adr":"13","quantity":"4","rate":"2","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"21682328.d1cb8c","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":150,"y":80,"wires":[["569b493c.26d258"],[]]},{"id":"d7eb2b72.02cce8","type":"debug","z":"c050e5b.f41e518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":80,"wires":[]},{"id":"569b493c.26d258","type":"buffer-parser","z":"c050e5b.f41e518","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bigint64le","name":"value1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap64","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"output","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":350,"y":80,"wires":[["cc297a0c.1c5118","3443f720.9cd008"]]},{"id":"cc297a0c.1c5118","type":"function","z":"c050e5b.f41e518","name":"","func":"var value1= parseFloat(msg.payload);\n\n// replace myTable with your db table name \nmsg.topic = \"INSERT INTO datavalue (value1) VALUES (value1)\";\nmsg.payload = [value1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":80,"wires":[["9348364b.95b8b8"]]},{"id":"3443f720.9cd008","type":"debug","z":"c050e5b.f41e518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":140,"wires":[]},{"id":"9348364b.95b8b8","type":"Stackhero-MySQL","z":"c050e5b.f41e518","server":"9c09cdc7.7560c","name":"","x":800,"y":80,"wires":[["d7eb2b72.02cce8"]]},{"id":"21682328.d1cb8c","type":"modbus-client","name":"ETH-485 Caldeira/E.T.A.","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.254.164.126","tcpPort":"3001","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"","commandDelay":"1","clientTimeout":"2000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"9c09cdc7.7560c","type":"Stackhero-MySQL-Server","name":"","host":"10.254.164.16","port":"3306","tls":false,"database":"nodered"}]
good morning Steve, the manufacturer of my modbus device replied that it will not be possible to install the node buffer parser due to the device's npm version and that it will take a few months for them to update, so I'm trying to convert a 64-bit variable where I need to read 4 address but I'm not getting it below my flow and images please help me
Hello,
50 devices in RS485? It's a limit, if you are in RS485 it implies serial modbus and so you have to turn at best 1s at worst 10 for a cycle and more.
I start from a device with an R/W time of 20 to 200ms.
On the other hand in modbusTCP it does so even if it also requires to organize the communications.
If you want to increase the number of devices, the ideal would be to have a PLC that takes care of the multiple connections and redo tables. It would act as a gateway, as node-red only makes a modbus link with the PLC to retrieve the table fed to it by multiple devices.
Good morning Steve, I am very satisfied with node red and thank you very much for the help you gave me. now I need to develop reports for each ID for 1 year or 1 day using my sql and all data is already being recorded in their tables in mysql. and login screen with several users, help me with these questions please
As this is a completely different topic you would be better off starting a new topic.
But just for info the default dashboard is not designed to be multi user so does not really work for multiple logins.
RS485 has a limit of 32 devices, and one of them is the master. This is not a software issue but a loading on the hardware driver. More might work but communication will break on certain intervals. Communication speed must be slow. Length of the cable also influences this. My recommendation is 20 devices at 9600 baud, with a cable length of max 600 meter. This is what I preach to my engineers. Good information is here: 9 rules for correct cabling of the Modbus RS485 communication systems (electrical-engineering-portal.com) but google and find more.
yes, until our rs 485 networks are working well, the doubt was about which modbus node to use because i was using modbus read and it doesn't work very well when you have about 20 then i started using the scrypt function and the modebus node flex gete node so it was very good, do you know how to be able to read from an ID 4 addresses and concatenals? because I have a flow meter where the registers are 13 14 15 and 16 64 bits.
The most flexible option is the node-red-contrib-uibuilder nodes that let you bring whatever ui toolset and libraries you wish to use and allows you much greater control over the whole dashboard.