active Posted May 30, 2011 Report Share Posted May 30, 2011 Hi Has anybody used the broadcast function for modbus ip with success, have tried using the setup as per the help files cant seem to get to work? Thanks Quote Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted May 31, 2011 MVP 2014 Report Share Posted May 31, 2011 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. Quote Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted May 31, 2011 MVP 2014 Report Share Posted May 31, 2011 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 Quote Link to comment Share on other sites More sharing options...
active Posted June 3, 2011 Author Report Share Posted June 3, 2011 Thanks Simon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.