MODBUS is used for serial communication protocol used for communicating the Modbus supporting devices with PLC. Before configuring Modbus in CP1E let us understand a little about MODBUS. What is MODBUS? Modbus is implemented using the RS485 port and communication between the Master and slaves is through the data format .In Modbus network 32 slaves can be connected with a unique node ID from 1 to 247. There are many varaiation of Modbus like Modbus RTU, Modbus ASCII, MOdbus TCP etc.
But modbus RTU is mostly used to communicate with PLC. To setup Modbus Communication in Omron CP1E, we have to make some settings. First of all CP1W-CIF11 is required i.e RS485 Port and you have to set its DIP switches. Since it will be a 2 wire connection so put all the DIP SWITCHES ON except Dip Switch number 4. See below table to know DIP switch Setting for MODBUS Communication.
Note:- Click on the photo for a clear view.
Also take a look that how CP1W-CIF11 RS485 port looks. At the front side it has 5 terminals for the connection and at the back side it has DIP switches . Front side has 1)RDA- 2)RDB+ 3)SDA- 4) SDB+ 5) FG namely. Connect two wire on 1 and 2 or 3 and 4, and shield to FG. Remember always use shielded cable in MODBUS communication.
Recommended Article: PLC Program for Omron Encoder Interfacing with Omron PLC
Connect as shown in below diagram. Connect the other end of wires to the device which u want to communicate in MODBUS. Always remember connect "+" with "+" and "-" with "-" .
Now all the necessary hardware settings are down, Now we just need to do some settings in PLC. Just Open CX-Programmer and select CP1E model. After go to Project Workspace and right click on settings, select serial-option port tab and in mode select MODBUS RTU Master and baud rate as supported by the slave side. Remember baud rate should be same at both the sides. After making these settings save it and download settings to PLC and re-power PLC. Hurry !! now yours CP1E is ready for Modbus Communication, all you need is that connect the slave modbus devices which u wish to connect in MODBUS network. See below picture for settings.
After all these settings yours CP1E is ready to communicate in MODBUS but now you have to write the Program for communication in a standard data format. In Modbus the standard format is :-
Device address --- function code -- data -----error check
All the Modbus supporting device follow this standard format. In Cp1E fixed DM words are defined for sending these data format to slave devices.
DM1300-DM1399 are used for this purpose, once you write the desired format then just on the system bit A641.0 to send the above query to the desired slave device. We will discuss it in depth in the next posts as how to communicate with drives, HMI, Energy Meter etc. in MODBUS with our PLC and how to read & write data in them .
So Keep reading here and if u have any doubts you can contact us or leave a comment and we will get back to you as early as possible. Don't forget to subscribe to Automation-Talk by Email for more such tutorials.