# Allen-Bradley Logix Device Driver and String Tags

**URL:** <https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [September 3, 2021, 8:06pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614 "2021-09-03T20:06:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 3, 2021, 8:06pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/1 "2021-09-03T20:06:55Z")

</div>

I’ve googled and searched the forums for some way to directly populate OPC tags with string (ASCII) data from a Rockwell CompactLogix controller, and have come up empty.  
We are connecting to the PLC using the Ignition OPC UA Allen-Bradley Logix Device driver.  
PLC version is v32.  
The PLC is controlling Cognex cameras doing OCR to read data off of parts.  
Currently I am having to read the ASCII registers (`DATA[X]`) as part of a tag value change in a UDT.  
If it’s possible to read the string directly as an OPC item tag, I think this would shave a small amount of time from the scanning process, and could eliminate code on the Ignition side.

Anyone have any idea if this is doable?  
Thanks.

Edit to add:  
BTW, I have tried the “[PLC]StringTag.DATA\*\*,SC10\*\*” (trying to read a 10 character string), but I get a configuration error.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 3, 2021, 8:25pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/2 "2021-09-03T20:25:07Z")

</div>

Have you tried just `[PLC]StringTag` ?

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 3, 2021, 8:33pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/3 "2021-09-03T20:33:00Z")

</div>

Yes. Not sure what else I’d use. The controls engineer built the PLC UDTs and that is the location of the string data. I’m sure it’s coming from the camera as input registers somewhere, but I don’t have his program or have any insights as to how or where those are being populated.

I could ask him to provide more info on where the data actually enters the process and even get him to do a few tests if need be.  
Do you any suggestions on next steps with regards to that?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 3, 2021, 8:45pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/4 "2021-09-03T20:45:42Z")

</div>

Well, did the programmer create his own string data type? If so, it must be just like a logix native one, but with a different length. That is, a `.DATA` array of SINT content, and a `.LEN` DINT of actual used bytes.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 3, 2021, 8:51pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/5 "2021-09-03T20:51:55Z")

</div>

FWIW, my Ethernet/IP module has some string handling options that would suit cases that don’t have a `.LEN` element, but it isn’t a client driver. /:

May have to address that.

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 3, 2021, 8:55pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/6 "2021-09-03T20:55:18Z")

</div>

He says he used the “string tool” to setup the tags. It’s been so long since I worked with PLCs I can’t speak to what that might be. The DATA elements are SINT and the LEN is a DINT.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 3, 2021, 9:31pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/7 "2021-09-03T21:31:43Z")

</div>

We had this issue the other month where our string tags were being seen as types with a DATA and LEN object. They should be seen as a simple tag without these objects in them in order to be able to read them into ignition as a string. I.e. If the address in your plc [PLC]StringTag, then that’s the address you need to be reading as Phil said.  
From memory, I think we solved it by adding the string tag into its own udt. It was a weird one… After that, we no longer saw the DATA and LEN objects, we just saw StringTag with no children

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 3, 2021, 9:47pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/8 "2021-09-03T21:47:04Z")

</div>

So one of these tags is:  
ns=1;s=[AB\_PLC]D905\_EN70841\_QC09\_AlignerID\_String  
I’ve tried it as it is above, using the “,SC10” appended (that I had see elsewhere in the forums), and a number of other configurations. Using it as shown above does not result in a config error, but also does not result in any data being populated in the tag.

 ![tag_screen_cap](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/3/83e47f8d7af20eaea9275db339a8f38cb598ead4.png)  
The attached image shows a “test” string tag. This tag is pointed to the string tag shown above. There is ASCII data in the DATA tags for the QC09 camera, but the resulting OPC String tag (aastringTest) has no data. So this does not seem to be working in this particular application.

Something that I’d think should be simple seems to be a tough nut to crack!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 3, 2021, 9:58pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/9 "2021-09-03T21:58:57Z")

</div>

When you browse to that tag in the OPC Browser what do you see? Does it have a LEN and DATA member underneath it? What is the OPC Item Path of those `dataN` tags?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 3, 2021, 11:16pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/10 "2021-09-03T23:16:06Z")

</div>

Is `.LEN` non-zero?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 4, 2021, 1:59am UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/11 "2021-09-04T01:59:20Z")

</div>

When I saw the DATA and LEN members it was bad news. When I was able to read the string, those members weren’t there. Any idea why they appear sometimes and not others?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 4, 2021, 2:04am UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/12 "2021-09-04T02:04:27Z")

</div>

Not sure about the legacy driver, but with the v21 driver the LEN and DATA members are always browsable underneath the String tag itself.

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 7, 2021, 2:33pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/13 "2021-09-07T14:33:47Z")

</div>

Yes, the DATA and LEN elements are there.  
Unfortunately it looks like the LEN value is 0 even when there is ASCII data in the DATA elements.  
I’ll have to talk to the Controls Engineer and see if he can get that element populated.

---

<div class="post-metadata">

**Author:** ![toddhowden](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@toddhowden](https://forum.inductiveautomation.com/u/toddhowden)\
**Post date:** [September 9, 2021, 11:21am UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/14 "2021-09-09T11:21:13Z")

</div>

Being the curious type I created a string tag in a Rockwell PLC and was able to directly read it. I also created a tag to read the data string and was able to read the ASCII value of the tag. I can read both from a ControlLogix controller. Of course when reading the string tag I read it as a string and when reading the ASCII value I read it as an integer. Not sure what I am missing in the above conversation.Processing: StringSample.docx…

 ![string](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63d83c63284b393d2024358b60db029a9d6d988c.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 9, 2021, 11:43am UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/15 "2021-09-09T11:43:16Z")

</div>

You aren’t missing anything. The root cause of Mike’s trouble was a zero in `.LEN`.

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [September 9, 2021, 12:46pm UTC](https://forum.inductiveautomation.com/t/allen-bradley-logix-device-driver-and-string-tags/50614/16 "2021-09-09T12:46:06Z")

</div>

Phil hit the nail on the head. The controls engineer was moving the ASCII data into the DATA elements but was not writing the length value to the LEN element. Once he started populating that the string came through as expected.

Thanks all for your input and dedication to help others! 👍
