Use modebus node -- modbus/tcp --

hello team,

on node red I want to use the tcp modbus to have the data of at least 10 sensors, for this I want to use a Flex Getter modbus and configure it in TCP by giving it the sensor address and the port.

is that the right noed ??!

to use this node I must configure msg.payload in a function " msg.payload = { value: msg.payload, 'fc': 1, 'unitid': 1, 'address': 0 , 'quantity': 1 } return msg "

is that for each sensor I have to make him a special node modbus Flex Getter for him ! since they have different addresses.
also what it means 'unitid' in msg.payload.

The attached figures explains a little bit what I want.

thanks for your answers..

what addresses are you wanting to read?

If all addresses are near each other (e.g. Address 0, 1, 10 and 25) then I would strongly recomend reading 26 items in one go and pick out the values you need.

It is ...

  • far more efficient
    • 1 communication requesting 26 items is MUCH better and much faster than requesting 4 separate times a single item
  • and less troublesome
    • you get consistent data - i.e. all items are read at the same time
    • you have all values in one place (making it easy to do calcs etc)

thanks for your reply.

he addresses are near for example : 192.168.10.1 .... 192.168.10.2 ... 192.168.10.3 .... 4 .... 5 ....

how can i read everyone at once ?

also what it means ' unitid' in msg.payload. it is the ID ?

when i said "If all addresses are near each other (e.g. Address 0, 1, 10 and 25) then I would strongly recomend reading 26 items in one go" I was referring to the "modbus register address" (not the ip address)

For reading values from more than one modbus tcp device, you will need to setup a config for each device & a separate flex-getter to request from each devices.

The unit id comes into play when several devices are connected to one IP address. This is not a common scenario. Normally the unit id is set to 1. Most modbus tcp devices ignore this.

1 Like

thanks a lot

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