Modbus: reading hundreds of non-contiguous registers

616 views
Skip to first unread message

MealTicket

unread,
Mar 6, 2018, 2:47:18 PM3/6/18
to Node-RED
Hi, what is the preferred method of reading hundreds of non-contiguous registers from one PLC on a single ip address. Range is something like 800-6000.

I guess I'm not 100% clear on the warning in modbus read node: "If you have more than 10 nodes on one communication configuration, use the Modbus-Flex-Getter or think about multiple connections to your Modbus device, please! You can do polling with the Modbus-Getter and Modbus-Flex-Getter, too by using an injecting node with an interval."

Does "one communication configuration" mean one IP address? So like having more than 10 modbus read nodes hammering the same IP address is bad and to use the flex getter? Am I reading that right? 

How do you have multiple connections to the same device?

What is more efficient: one read of 5000 registers, or 10 reads of 500 registers? 

Pardon my ignorance, as I'm new to PLC's, modbus and Node-RED. 

Mark Thomson

unread,
Mar 7, 2018, 4:58:32 PM3/7/18
to Node-RED
Hi MealTicket,

It sounds like you may not be familiar with Modbus protocol. Head on over to modbus.org and have a look in the Technical Resources section of the website. You will be able to find the specifications for the Modbus protocol.

Are you communicating with the Modbus device over an Ethernet or a serial connection?

In general, you are limited to 125 registers (16 bit values) in a single read (function codes 3, 4) and 2000 coils (function code 1).  If you need to read 5000 registers, you will need to break up the reads into 40 poll messages that read 125 registers. It is more efficient to read as many contiguous registers in a single read message.

Without knowing what your end device is, it may or may not accept 10 simultaneous connections. This limit is highly dependent on the end device.

You will also need to be mindful of the amount of time it takes to retrieve 5000 registers, even at maximum Ethernet network speed. The end device most likely has higher priority responsibilities than providing data on a continuous basis to a Node-red application. You should not poll data more frequently than it is likely to change. For example, if you have a temperature value it most likely will not change for minutes at a time.
--
Regards,

Mark
Reply all
Reply to author
Forward
0 new messages