Read Tag from Rockwell PLC from Codesys?

I found a codesys Library Specifically do to this.

https://github.com/NothinRandom/CoDeSys_EIP

I haven't tried it yet.

the author says that he handles the EIP stack himself and uses Codesys TCP FBs for send and receive data.

You have got me bitten by the bug of curiosity. I do want to give this library a try, but will do so in the weekend. I have tried unsuccessfully using the implicit messaging function and today will give it my last try. This library you have shown me looks promising. Hope to get back to you later this week.
 
Hi Alfredo,
In omron when you do a 4c command the request path length in words is the first byte of the request path. This is for CIP explicit message and so the request path from 0x91 needs to be an even number of bytes, or get padded with 00.
If you are using the generic_service function block with service code 16#4c this maybe needed.
Image attached.
1.png
 
Hi Alfredo,
In omron when you do a 4c command the request path length in words is the first byte of the request path. This is for CIP explicit message and so the request path from 0x91 needs to be an even number of bytes, or get padded with 00.
If you are using the generic_service function block with service code 16#4c this maybe needed.
View attachment 56270

chelton: Thanks very much for your comments. I think you are right with regards to the syntax of service 4C. But, the Codesys standard library for explicit message only supports logic segments (Class,Instance Attribute) as Ken Roach explains in posts #2 and #7. So with the standard library it is not possible to implement this. However, the library mentioned by theColonel26 in post #46 seems to offer the flexibility to use symbolic segments, and I intend to give it a try in a few days.

By the way, I used the ODVA Molex tool and confirmed exactly what you explain. Please see screenshot below:

20201118_Logix_ODVATools.png
 
Alfredo, Produced Tags are, as the CODESYS scanner would see it, Target -> Scanner. In your screenshot you have 0 bytes in there and 40 in Scanner to Target.

AustralIan: Thanks so much for your follow-up and advice. Tried what you say but Logix is unhappy about the connection size, as you can see in screenshot below. By the way, if only "produced" tags can be used with connected, even if we get this working Codesys can get data from Logix, but could not send data to Logix. Is that your understanding too?

20201118Codesys_Logix_.png
 
Last edited:
AustralIan: Thanks so much for your follow-up and advice. Tried what you say but Logix is unhappy about the connection size, as you can see in screenshot below. By the way, if only "produced" tags can be used with connected, even if we get this working Codesys can get data from Logix, but could not send data to Logix. Is that your understanding too?

Really just using a dummy variable for the produce tag. The idea is this establishes a class1 connection which pushes the state machine from "connecting" to "running". Once running, the generic_service can work as my previous code example.

You could guess connection sizes, or wireshark a Rockwell to Rockwell produce consume connection.
 
Really just using a dummy variable for the produce tag. The idea is this establishes a class1 connection which pushes the state machine from "connecting" to "running". Once running, the generic_service can work as my previous code example.

You could guess connection sizes, or wireshark a Rockwell to Rockwell produce consume connection.

OK, I see your point, thanks. Will try different sizes and/or parameters to see if I get the the state machine to "running". But the problem is, as I commented chelton, it is not possible to use the service 4C with the standard Codesys library. I am thinking about using the library that theColonel26 mentions, but before that I was wondering if I could used tags mapped to PCCC tags. But first things first. Will keep trying and will post if I succeed getting the state machine to "running"
 
Last edited:
I cracked it!

Guys, I cracked it!!!!
I worked out communication parameters that allow the class 1 connection to go into "running". I am exhausted. I need a beer.

2020-11-18_Logix&Codesys.jpg
 
Alfredo, I had not seen the Molex tool before, What a valuable tool to have in my box of tricks. Thankyou

I am for-life indebted to the developer who wrote this program and to the manager who decided to donate it to the ODVA. I have used many, many times. And it is free of charge.
 
Alfredo, that's fantastic news! Those green arrows are always a treat. 🍻
I am curious to know what datatype dummy is in the Logix Processor.

Fantastic indeed. 🍻

Sorry about that. I should have added this crucial info. Please see below. Next I want to try PCCC messaging, now that I have the adapter running. If I succeed I will post both the Logix and the Codesys program.

20201119_LogixProgram_tag.png
 
Passing the data through an OPC-UA server might be a good option depending on your needs. What is the application?
 
Hello einnh:
This thread was initiated by theColonel26 and as per the post's title the requirement is Read Tag from Rockwell PLC from Codesys? I have interest in Codesys, Logix and EtherNet/IP so I got involved to try to help and I even suggested what you mention in your post above, which woull require an eternal device which can exchange data from the Codesys OPCUA server and the Logix tags. I do not even know whether theColonel26 is following the thread, so I do not know if he has succeeded by means of other venues. But I am curious and did manage to establish a connection between Codesys and Logix. I am doing this in my spare time. Now that we figured out how to establish a connection, the next step is how to access the tags in Logix from Codesys. The explicit message function in Codesys only support logic segments so it is not possible to use symbolic path with the 3S libraries. It seems there is an open source library that allows this mentioned in an earlier post of this thread. I want to try to use PCCC, which is represented as a CIP class, so it should possible to use the 3S libraries. If I succeed I will post my programs and an explanation.

But for the record, by far the easiest way to connect Logix and Codesys is by means of the Codesys ErtherNet/IP adapter library which requires a license in addition to the soft PLC license and which does not work in evaluation mode. I bought one license and got this working very easily.
 

Similar Topics

Dear colleagues, I am reaching out for assistance with an issue I am having. I have a code that can successfully insert data from FactoryTalk...
Replies
6
Views
1,006
Hello expert; I want to read the tag values from control logix plc over the WiFi connection. I did it by using Rs link OPC and successfully read...
Replies
1
Views
1,153
Good Evening Gentlemen, we have a FT View SE client running in windows 7 system, now I want to update that system with windows 10. I did the...
Replies
2
Views
2,695
Hi, I'm pretty new to FactoryTalk and PLC's in general. In View SE, is it possible to read a string contained in a UDT and use it in another tag...
Replies
1
Views
1,220
How to solve the error BAD:Configuration Error:Not Limited in Wonderware system management Console Diagnostics
Replies
0
Views
1,987
Back
Top Bottom