MODBUS Communication is widely used network in almost all of the PLC. MODBUS is a 2 wire communication scheme with a feature of up to 32 slave devices in one network. As in our earlier post we have told PLC Programming for MODBUS communication with Drive, Programming for MODBUS communication with HMI and how to set up MODBUS in Omron PLC. But still may of us have the doubt as how to actually write a suitable PLC Program according to our application.
Subscribe to Automation-Talk by Email.
Basics of PLC Program For MODBUS Communication - Modbus Fundamentals : ---->>>
First of all let us understand one thing that in MODBUS all the communication takes place with QUERY and RESPONSE i.e the MASTER sends QUERY to a specific slave device and in turns the SLAVE responses to the MASTER accordingly.
So while Writing the PLC program first of all we have to design the QUERY format for specific function . There are major two operations either You WRITE or READ the registers of SLAVE devices in MODBUS network. For every slave device which has the MODBUS Communication Function have a specific set of REGISTERS and COILS for MODBUS Communication. All the REGISTERS and COIL address will be mentioned in Manual/Data-Sheet of the Device. So first of all make a note of that and select which Register/coil you want to read/write in your application.
After doing this , let us now understand that PLC (MASTER Device) will be able to send the query to 1 slave device at a time and that too a single query , so we will write the PLC Program accordingly . This is achieved with the Help of TIMERS.
How to do PLC Programming for MODBUS :-
First of all make the query as told above and write the query data in the PLC Data Registers, and when we want to send the query to slave then we will transfer those data in the PLC data Registers of MODBUS Communication. Do the above thing for each query of every slave you want to communicate. Also PLC has a MODBUS communication Bit , like it is A641.0 for Omron PLC CP1E , it depends upon PLC to PLC .
So we have to ON this bit to send the query.Every time we want to send the query to a slave device we have to ON this BIT and the query will be sent accordingly.
Now we are taking a example of OMRON PLC MODBUS Communication with VFD :-
Here we are considering that there is one PLC as Master and three VFD , the configuration of VFD in MODBUS has been told earlier , see here . So we have done the settings accordingly in VFD and also set up the Omron CIF11 port for Modbus Communication and settings in CX Programmer for configuration of CIF11.
So Prepare the PLC Program accordingly and still you face any doubts then we welcome you to write yours doubts in the comment section and we will get back to you .
Dont Worry !! we will post the complete PLC Program for OMRON PLC MODBUS Communication with JX DRIVE and HMI and also ENERGY METERS. Mean time you can try to write the PLC Program Yourself.
Dont Forget to Subscribe to get all MODBUS and PLC Programming related updates in Your's INBOX.
Subscribe to Automation-Talk by Email.
Advertisements :-
HI,
ReplyDeleteI AM TRYING TO COMMUNICATE MY CP1E PLC(CP1W-CIF11) WITH AUTONICS VOLTMETER. I HAVE SWITCHED ON ALL DIP SWITCHES EXCEPT NO.4. ALSO MY ADDRESS CODE IS 01, COMMAND IS 04 , START ADDRESS IS 0001 , NO OF DATA IS 0001 AND MY CRC IS 0A60 (LOW-HIGH). I SET ON SYSTEM BIT A641.0 AND MOVED THESE DATA TO D1300 AND RESPECTIVELY. STILL I DIDN'T GET RESPONSE FROM MY SLAVE. CAN ANYONE HELP ME SLOVE ??
THANKS IN ADVANCE!