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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.