Hope everyone is well and staying healthy.
I posted this same question by mistake on a different section of the CODESYS forum, so my apologies for the duplicate information.
I'm kind of new to CODESYS and also to this forum.
I am trying to make a CODESYS device talk to a CompactLogix PLC over Ethernet IP by setting the CODESYS as a scanner and the AB controller as the adapter. The first test I did was exporting out the EDS file from RSLinx and importing this into CODESYS via the Device Repository under Tools. Then adding this adapter under the tree of the Ethernet IP Scanner device seemed to have worked well. The downside to this is that on the Studio5000 side you have to setup your tag as a Producer tag and so far I have only being able to read from the CompactLogix not write to it as Studio5000 doesn't allow me to setup a Consumer tag.
I was wondering if there is anyway you can setup a Generic_Ethernet_IP_device and communicate to a Logix5000 controller successfully and read and write from it? This way it will only look into the tags in the controller level at the AB controller through explicit CIP messaging and wouldn't have to depend on the EDS file setup, controller type etc?
I have been trying to somehow use some of the functions available in the Ethernet IP library to manipulate the Class ID and Instance ID etc but have no been very successful in doing so. Probably because I also lack full understanding on how to access the class and instance of the tags I am looking for in the AB device.
Thank you so much in advance for any advice or pointers!
Thanks so much for the tips! I greatly appreciate it.
Still trying to see if I can figure out how to use the GenericService() and if I could use it to read and write data successfully. So far I have tried to get the attribute of the data in he Logix5000 controller (L33ER) but the instance of the tag I am trying to get seems to change dynamically. Maybe I am not understanding well how to access this data through Ethernet IP but it seems strange to me that a tag was available under the Class 10x6B Instance 11 (example) one moment ago and if I request the same instance a moment later it is a completely different piece of data.
Still much that I need to learn it seem.
Thank you so much again for your time in sharing the above with me. If I come to a clear solution(or conclusion) in the near future I will repost again.
Maybe this helps you?
But I guess you have found that allready....
I have poked around further.
Easiest to set up, but requires you to "touch" the AB Programming software.
You have seen already in SP15 CODESYS as consumer, AB Logix5000 as Producer.
In SP16 (coming soon), you should have the ability to configure CODESYS as Producer, AB Logix5000 as Consumer. Actually to realize this, you will add an Ethernet/IP Scanner AND a Ethernet/IP Adapter, and configure symbolic tags for the adapter. Still as you say, you have to "touch" the AB Programming software to do this.
Simply follow Chapter 2 of the document 1756-pm020 Rockwell provides for how to read and write tags using Generic Service Class Instance Attribute
Seems steps are:
1. Add the Ethernet IP Services Lib, and use the GenericService() to send messages to the Logix5000 PLC.
2. Read a table of every tag in the controller with its associated instance/attribute number
2. in your code, itterate through that table until you find the tag you want
3. use the instance/attribute of your found tag to send a message to the Logix 5000 PLC.
4. Somehow track when the original list of tags you read becomes invalid (eg. Logix online change, Logix project download.) Honestly I didn't read that sub chapter, but it is important.
This is not yet possible and not planned.
But in theory, if GenericService() were able to use symbolic addressing (or even custom path!) then you could just use the method described in that same rockwell document, under "Write Tag Service > Example Using Symbolic Segment Addressing"
Log in to post a comment.