Read Tags using CIP

JEaglestone

Member
Join Date
Nov 2020
Location
Ontario
Posts
7
Hello Everyone,

I've been trying to write a python code to read input and output tags from a PLC using CIP. I found the service Get_Instance_Attribute_List(0x55). But I don't know how to use this service code to read the tags. Can anyone please help me with a code example of how I can read the PLC inputs and outputs using the CIP?

Thank you
 
Hello Everyone,

I've been trying to write a python code to read input and output tags from a PLC using CIP. I found the service Get_Instance_Attribute_List(0x55). But I don't know how to use this service code to read the tags. Can anyone please help me with a code example of how I can read the PLC inputs and outputs using the CIP?

Thank you

Well in pylogix, you GetTagList() will retrieve a list of the tags, but it does not read the values. Read("MyTag") will read the values of the tag name that you supply. It has limitations, it doesn't handle parsing UDT's for example.

As I stated in your other thread (not good to have multiple threads on the same subject), describe in detail what you are trying to accomplish. In your other thread, you say that you cannot use python...
 
Hello,

I do not have any Python code to post.
The method format is described in the Logix5000 Data Access manual.

Attached is a spreadsheet breakdown of the request message. I “believe” is it correct.

 
Hello. Here's what I'm trying to accomplish:
I want to use the class code and the service code to directly read or write the tags from the PLC. I'm using a micro850. But I don't know how to do that in python code. I have to use python. But can't use pylogix library. I need to know how to use the service codes and class codes to retrieve the values. Now, I found the service Get_Instance_Attribute_List(0x55). But I coudn't find a proper attribute for this service that can read or write from the PLC. I need to know which service I can use with which class and attribute to read and write to the PLC. And after that how can I use these service code, class code and attribute in Python to read and write to the PLC.
 
Hello,

>But I coudn't find a proper attribute for this service that can read or write from the PLC.

IIRC, the Micro8xx only supports the "Read Tag Fragmented Service".
 
Thank you. I came across 0x4C and 0x4D (read/write). But I don't know what object and attribute I should use them with to get the result. And how do we use these hex codes in python to get the result?
 
Not that I understand what is going on, but the OP said they cannot use pylogix, not python.

I wonder if the task is to write some kind of lower-level driver.

I misunderstood what he was saying in another thread, it was cleared it up in post 4.
 
Is that the closest thing that exists to a protocol document?

That document describes the CIP "services" to utilize for data access to Logix devices. FYI, the different years of the document do not include all the same data.

As "dmroeder" stated, ODVA controls the Ethernet/IP protocol specification.

There are a few other RA documents with information on data access.
 
Last edited:
Hello,

>But I coudn't find a proper attribute for this service that can read or write from the PLC.

IIRC, the Micro8xx only supports the "Read Tag Fragmented Service".

That's service code 0x52. Do you remember what attribute and class goes with it?
 
That's service code 0x52. Do you remember what attribute and class goes with it?
Hello JEaglestone:
Service 0x52 is not issued to a class ID, instance ID, Attribute ID (logical segment) type of path. Rather, it is issued to a symbolic segment path, as explained in manual that I provice a link to below, as well as the screenshot of that manual relevant to your inquiry. I hope you find this useful.
https://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm020_-en-p.pdf

20201127_ReadTagFragmentedService.png
 

Similar Topics

Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
140
How to read/write tags using class3 connection with omron Nx/Nj Plc? when i am seeing wireshark packets for my existing connection its shows as...
Replies
0
Views
704
Hello Guyz, I am trying to read Tag information from an AB Compactlogix 5562 using a Visual Basic Program. I have already created the tags but...
Replies
1
Views
2,912
I have a Netbiter device that has EtherNet/IP that I want to use to grab data from an Allen-Bradley Compactlogix. Unfortunately it asks for the...
Replies
20
Views
13,859
Dear Friends; I am trying to read the Tag Values in excel by using VBA. I write a code but was stuck on the following error: Dim OPC Server1 As...
Replies
21
Views
6,372
Back
Top Bottom