Probably some of you already know the PLC Link feature of our DVP series PLCs, it allows us to easily exchange data between the master PLC and several slaves saving a lot of programming time.
Slaves can be PLC, drives, temperature controller and, in general, any equipment that includes and RS485 Modbus port.
For those who don’t know this feature here you can find other posts in this blog with detailed information:
Exchange between Master PLC and Slave drive (VFD):
Exchange between Master PLC and Slave PLC:
Exchange between Master PLC and Slave temperature controller:
In general, the PLC Link feature is limited to:
- 16 slaves.
- Read up to 50 words (16 bits variable) from each slave.
- Write up to 50 words (16 bits variable) to each slave.
Today I would like to show you how our PLC DVP12SE (Link) is able to overcome this limitations and increase the number of slaves and the number of data to be exchanged.
Using the DVP12SE PLC (fw versions 1.6 and above) you will be able to:
- Communicate with up to 32 slaves.
- Read up to 100 words (16 bits variable) from each slave.
- Write up to 100 words (16 bits variable) to each slave.
Let’s take as an example an application where we want to communicate with first slave (ID1) and a second one over the 16 standard slaves, the 20th (ID20) for instance, at the end of this post you’ll find the example programs to be downloaded on the Master and in the two slaves.
First of all, we have to be sure that the communication parameters are the same on all the nodes connected to the Modbus (ASCII/RTU, baudrate, data bits, parity,stop bits) and also that all have a different node number.
Two internal bits are very important in order to start the PLC Link functionality, M1350 and M1351:
Also we have to indicate to our PLC that we want to access to more than 16 slaves and that we want to read/write more than 50 words on each slave:
Next step is to assign to each slave (ID1 to ID32) his configured node number into the Modbus (in this case we have configured ID1 with node 1 and ID20 with node 20):
In order to configure the PLC Link there’s no need to program complex polling structures nor keeping into account communication timeouts or errors in order to resend Modbus messages, you only need to fill a few special registers with the right values in order to indicate to the PLC which nodes you want to communicate and which registers of these slaves nodes you want to read/write.
In this example we will:
- Master PLC reads D0~D49 (50 words) on PLC ID1 and stores the data on D100~D149 of his internal memory.
- Master PLC reads D0~D49 (50 words) on PLC ID20 and stores the data on D150~D199 of his internal memory.
- Master PLC writes the values of his D200~D249 (50 words) on registers D100~D149 of the PLC ID1.
- Master PLC writes the values of his D200~D249 (50 words) on registers D100~D149 of the PLC ID20.
- Increments D200 and D249 (these values will be wrote on ID1 and ID20).
On the slave’s side, we only have to configure the communication (ASCII/RTU, baudrate, data bits, parity, stop bits) and a different node number to each slave.
- NODE 1:
- NODE 20:
Here you have the programs of the Master PLC and both Slaves and also a pdf where you can find which registers you have to configure in order to read/write each one of the 32 Slaves.
Now you have seen all the required steps to configure a powerful data exchange between a Master PLC and up to 32 Modbus slaves with just a few program code lines, enjoy it!