How to communicate JX drive in MODBUS with OMRON PLC or any PLC? We will see in this post that what are the necessary settings and How to Write PLC Program for MODBUS?
First of all as depicted in earlier post you to do the hardware settings both in the RS485 port and PLC . You can review those settings from here.
After that you have to set some parameters in JX Drive for MODBUS Communication. Here we will use MODBUS for JX Drive run , stop and frequency reference. Using MODBUS for Drive Frequency is a very good method rather than using the PLC analog output as it saves the cost and give us a better control over drive.
HOW TO CONNECT JX DRIVE IN MODBUS?
JX Drive has a RJ45 jack for Modbus Communication, plug the Jack and connect its number 5 pin to RDB+ on RS485 port of PLC and number 6 pin to RDB-.
NOTE:- Click on the picture for a large and clear view.
For using yours JX Drive In MODBUS network you have to do some hardware settings.
1. First of all set the required parameters (listed below).
2. Shut down the power.
3. Open the connector.
4. Connect the RJ 45 connector i.e communication line for MODBUS.
5. Set the s7 DIP switch to 485.
6. Turn on the Power.
See the Below picture.
See Below is the list of Parameters of JX Drive for MODBUS Communication.
NOTE:- Click on the picture for a large and clear view.
If you want to have only frequency reference through MODBUS and Run command through terminal then set A002 to 1 i.e terminal mode.
Now we have done all the necessary settings in Drive and as discussed in earlier posts you can do the the settings in the PLC accordingly.
Now the BIG question is HOW to Write PLC program for MODBUS Communication?
The data format which the JX drive accepts is in following format.
1. Header(silent) 2. Slave Address 3. Function Code 4. Data 5. CRC 6.Trailer(silent)
Slave address can abe any from 1 to 247 set it accordingly.
Function Code can be different for different functions.
1 - for coil reading
3 - for holding register content reading
5 - writing in to coil
6 - writing in to register
8 - loopback test
9 - writing multiple coil
10 - writing multiple register
Now we will see that what exactly data format we have to write in PLC Program. Just make sure that what data words of your PLC are used in MODBUS, for OMRON PLC We have already seen which data words are used. If u want to review, you can reveiw it from here.
We will take here the example of OMRON CP1E PLC.
Query / Data format for JX Drive in MODBUS.
To set the forward command write :
D1300 D1301 D1302 D1303 D1304
01 05 04 01 00
Where: 1 is station id i.e node number and 5 is function code and 4 is number of data bytes and 1 is coil address and 00 is for forward.
Remember:- To send a command to write in JX drive we always subtract 1 from the address. So, here in the above example actual coil address is 2 but we subtracted 1.
To set the reverse command write:
D1300 D1301 D1302 D1303 D1304
01 05 04 01 ff00
To set the frequency write :
D1300 D1301 D1302 D1303 D1304
01 06 04 01 (frequecy)
Remember the MODBUS communication takes place in hexadecimal so if u will write 64 then drive will have frequency 10.(hexa 64= decimal 100). The derive automatically divides the received frequency command by 10, so write the frequency accordingly.
To set the RUN Command write :
D1300 D1301 D1302 D1303 D1304
01 05 04 00 FF00
To set the STOP Command write :
D1300 D1301 D1302 D1303 D1304
01 05 04 00 0000
NOTE : After writing all these you have to ON the System BIt a641.0 to send the above query to the specified drive.
System bits are different for different PLC and you can find them in their manual.
So this way you can play with your drive and by writing the PLC program accordingly you can do yours application easily. If you have any doubts you can contact us or leave a comment. In the next section we will discuss how to exactly write the PLC program for JX Drive MODBUS Communication. Don't forget to subscribe to get all latest posts via E-mail. Subscribe to Automation-Talk by Email.
Advertisements :-
Nice blog...
ReplyDeleteGreat Post. Keep Sharing .
ReplyDeleteHow to Monitor the Current of Drive on HMI ?
ReplyDeleteFor this just make a query for reading the current from drive and then move that to a D in PLC and show that D word in HMI
ReplyDeletecan you please give me a program sample, cause i tried to run hitachi inverter (L200) with cp1h using modbus, but no luck.
ReplyDeletethank you
Please refer below links
ReplyDeletehttp://www.automation-talk.info/2010/11/how-to-configure-modbus-in-omron-plc.html
http://www.automation-talk.info/2010/11/modbus-settings-for-omron-plc-cp1h.html
Also see Modbus Section you will get lot help from there.
it works with hitachi x200 thank you :) but the program is to long, i need to make it simple, try to do it with the function block, but it confusing me :) is there any program sample or tutorial using FB.
ReplyDeletethank you
Keep Visiting ... Soon we will publish a tutorial on Making Program in FB....
ReplyDeleteLearn-------Share--------------Innovate
looking forward to it :)
ReplyDeletethank you
can u post a link of program modbus communication of omron cp1e plc. iwant to communicate with energy meter
ReplyDeletethank you
ReplyDelete