Jump to content

Recommended Posts

  • MVP 2014

When you say the Help file, I presume you mean:

Note that a MODBUS master can broadcast to the MODBUS network by writing to Slave ID # 0. To do this, indirectly address the Slave ID to a register, and write 0 to that register.

You also need to have the correct network configuration to support the broadcast. If you are using 4 slaves or less, you can use TCP connections, and you must establish a separate socket connection to each of the slaves before initiating the broadcast.

If you have more than 4 slaves you must use UDP, in which case you don't need to perform any socket connect functions, as UDP is a connectionless protocol.

I am setting up a test and will post my results.

Link to comment
Share on other sites

  • MVP 2014

OK, so after a few false starts, it is working. It looks like the above quoted comment from the help file was cut and pasted from the ModbusRTU help section.

As discussed above, UDP is the simplest setup.

Also

  • In the master modbus config, set up a slave definition with IP address of 255.255.255.255. Provided there is only a single modbus slave device at each IP address, then leave the Slave ID at 255. Use this slave when sending the data to be broadcast.
  • Set both master and slave sockets to use UDP

See attached programs, they are very basic, just enough to show that this works. Visilogic version was 9.2.0. One master (V570) and 3 slaves (V130, V230, V530)

Modbus UDP Broadcast V570.vlp

ModbusUDPSlaveV130.vlp

ModbusUDPSlaveV230.vlp

ModbusUDPSlaveV530.vlp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...