From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet/IP Complex tag communication

Hoping someone has an idea as to how can resolve this. Any help is greatly appreciated.

 

I am attempting to read/write complex tags (a tag composed of other tags) between a PC and CompactLogix 1769 PLC. I have managed to get the read from PLC to work and am having trouble getting the write to PLC to work. I am currently getting the error -251723760, CIP Status: 0x13 (Not enough data), but have also gotten the error: -251723760, CIP Extended Status: 0x2105 (Address and count out of range). I am not sure what I've done to get two different error codes. My suspicion is that the information that is to preceed my data is incorrect.

 

I have attached my test code. I have verified the tag should contain 64 bytes of data. The EthernetIP Tag Read is there to get the prepend information for the data. This seems to be working for the read case, but not the write.

 

If I do an EthernetIP Tag Read from the tag, I get four bytes for the zero element read and 204 bytes for a one element read. Writing 204 bytes produces the same error codes.

 

I have downloaded the CIP specification. Unfortunately, that has not been helpful in identifying what needs to be sent.

 

I have the Ethernet/IP toolkit v14.0 installed.

 

0 Kudos
Message 1 of 7
(9,087 Views)

Hi tstahl,

 

From this post, it looks like complex tag is not supported.

 

0 Kudos
Message 2 of 7
(9,056 Views)
I'm reading the tag as a Raw (rather than specifying the data type). One of the examples indicates this requires some additional knowledge of the protocol. One of my coworkers has worked on the PLC side with a LabVIEW program that communicates this way, so I know this is possible.
0 Kudos
Message 3 of 7
(9,046 Views)

Talking with my coworker again, there was tag-based communication going on, however we're starting to think the issues the supplier was having may have been related to writing to the individual tags within the complex tag rather than the complex tag itself. The system was changed to communicating through assmblies (implicit communication) after performance problems were detected in real-world conditions.

0 Kudos
Message 4 of 7
(9,032 Views)

Hi tstahl,

 

" writing to the individual tags within the complex tag rather than the complex tag itself" - this one looks definitely not feasible. Writing complex tag as a single/whole tag could work.

 

I'm confused that in your attached VI, you write it as a whole. but that is not what the original problem was (writing individual tags inside a complex tag was.)?

 

Also, by specifying NumberOfElements zero in TagReadRaw, you can read the header for the complex tag? Have you verified that this is how complex tag data structure is organized in the PLC? I mean they could have addtional marker about all the element tags inside. I suggest to find such info in Rockwell manuals.

0 Kudos
Message 5 of 7
(8,989 Views)
LewisL - I did some bench debug with the PLC programmer many months ago (September 2014?) and was able to write a tag within a tag, and was able to write a complex tag. I picked writing to the complex tag as writing to each individual tag was taking about 6 msec for each tag and I could have many change at once. There was something that had to be done with the name for the individual tag (complex dot individual? not sure) to make it work. Fast forward to floor debug with the full PLC program and writing to the complex tag now produces errors despite being the same code. I can check with Rockwell. I am suspicious they implemented the CIP specification and will tell me so. I did download that specification; I'm pretty sure I would have better luck finding my answer in a timely manner if the CIP specification was written in ancient Sumarian (the document seems to indicate there should be prepended information describing the data, but does not indicate what that should be).
0 Kudos
Message 6 of 7
(8,967 Views)

Was running into this error and found this that helped solve my problem in case some one else searches by the error code of "not enough data". The issue is the length (number of UDT elements you are writing to) must be encoded just after the firs 4 bytes of header information. Solution was found here.

 

http://forums.ni.com/t5/NI-Labs/Welcome-to-EtherNet-IP-Driver-for-Communication-to-Allen-Bradley/m-p...

 

So it sometimes thinks that you didn't send enough data because it thinks the first bytes of your data as the length it should be expecting.

 

0 Kudos
Message 7 of 7
(6,780 Views)