10 posts in this topic

I need to read and write to the omron CJ2 series PLC through CIP. I am able to send the List service and register session packet and also getting the expected response. BUt after that I am not been able to send the read and write request correctly. Let suppose I have to read the 15th location of DM area so can anyone help me out especially about the packet structure of read and write request.  And the important point is that I must have to use CIP not FINS.

Thanking you in advance.

Share this post


Link to post
Share on other sites

Go look at Omron manual W465 (CJ/CS Ethernet/IP Operation Units Manual). It is the manual for both EIP Units like CJ1W-EIP21 and the CJ2M-CPU3[] or CJ2H-CPU6[] series regarding the Ethernet/IP function.

Have a look at Section 9, Subsection 9-2 (Receiving Explicit Message). Omron CIP packet structure is all the same as any other CIP. You just need to adjust your Class ID, Service Code, etc based on the data that you'll find on that section.

Share this post


Link to post
Share on other sites

Yes, exactly, probably it would be usefull if there is some manual like this:

W421_E1_02_CS1W_CJ1W_ETN21_Construction_of_Applications.pdf

for CIP, in this manual one can find sample program in C for creating a FINS message. Is there something similar for CIP?

Share this post


Link to post
Share on other sites
5 hours ago, tashinz said:

Yes, exactly, probably it would be usefull if there is some manual like this:

W421_E1_02_CS1W_CJ1W_ETN21_Construction_of_Applications.pdf

for CIP, in this manual one can find sample program in C for creating a FINS message. Is there something similar for CIP?

Omron doesn't create one. FINS is Omron protocol so it's understandable that they create the manual in detail for the FINS message.

CIP on the other hand is open protocol managed by ODVA, so you need to search on their website (or just put their name in google). I have read one (forgot where the document is), but there are only packet structures written there. There are no example programs in C or whatever language.

Regarding @saurav kumar issue, you mentioned that you managed to register a session. Just a hint, for CIP protocol when you register a session you will get a Session ID send from the connected EIP device to your CIP Client. You need to save that Session ID in your Client program, then for any next transmission you send (such as read variable or anything) the Session ID must be put in the Ethernet/IP header of the packet.

Also, there is a tool by Molex Corporation called EIPTools which you can use together with Wireshark to trace the CIP packet if you need to. Both are free.

Edited by innoaloe

Share this post


Link to post
Share on other sites
9 hours ago, innoaloe said:

Omron doesn't create one. FINS is Omron protocol so it's understandable that they create the manual in detail for the FINS message.

CIP on the other hand is open protocol managed by ODVA, so you need to search on their website (or just put their name in google). I have read one (forgot where the document is), but there are only packet structures written there. There are no example programs in C or whatever language.

Regarding @saurav kumar issue, you mentioned that you managed to register a session. Just a hint, for CIP protocol when you register a session you will get a Session ID send from the connected EIP device to your CIP Client. You need to save that Session ID in your Client program, then for any next transmission you send (such as read variable or anything) the Session ID must be put in the Ethernet/IP header of the packet.

Also, there is a tool by Molex Corporation called EIPTools which you can use together with Wireshark to trace the CIP packet if you need to. Both are free.

Yes, I am getting the session ID and also I am sending it in read request but I think there is some problem in read request creation because I am getting the address path error continuously. 

Share this post


Link to post
Share on other sites
On 10/12/2017 at 9:51 AM, saurav kumar said:

Yes, I am getting the session ID and also I am sending it in read request but I think there is some problem in read request creation because I am getting the address path error continuously. 

In that case you are already sending a correct Service Code and Class ID. You just need to double-check the way you send your target address

Share this post


Link to post
Share on other sites
On 10/12/2017 at 8:21 AM, saurav kumar said:

Yes, I am getting the session ID and also I am sending it in read request but I think there is some problem in read request creation because I am getting the address path error continuously. 

On 10/13/2017 at 7:32 PM, innoaloe said:

In that case you are already sending a correct Service Code and Class ID. You just need to double-check the way you send your target address

Thank You, everyone, for your precious suggestions. I have implemented the read and write request correctly and it is working fine. If anyone of you are interested to know about the packet structure now I can give you the exact sendRRdata read and write packet structure.

Again thank you so much!

Regards,

Share this post


Link to post
Share on other sites
5 minutes ago, saurav kumar said:

Thank You, everyone, for your precious suggestions. I have implemented the read and write request correctly and it is working fine. If anyone of you are interested to know about the packet structure now I can give you the exact sendRRdata read and write packet structure.

Again thank you so much!

Regards,

I'd say keep it to yourself and sell that the knowledge should anyone ask you to do it. Hard work should be payed :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now