We've ran into an interesting problem this morning and are looking urgently for a solution.
We are reading a STRING tag from a CLX (ControlLogix) PLC, into a string datapoint element with a string conversion set in the _address config and that seems to work perfectly fine, but if we try and reverse this and write into the PLC, we get an error that the tag types don't match. The STRING struct in the PLC has two parts, a DINT which holds the length and a SINT[] array which holds the ASCII characters of the string:
string.LEN (DINT type) - holds length
string.DATA (SINT[] array) - holds characters
When reading the data we can simply address the tagname (so "string" in this example) and it reads the entire lot perfectly, but if we try and write into the very same element, it fails. Similar thing happens when we read a single character from the string, for example string.DATA[0] we can read without issues if we set the conversion to char (8-bit value), but if try to write a single character into it, it fails telling us yet again that the types don't match.
Any ideas what we are doing wrong? the only way so far which allows us to write into the STRING struct in the PLC is to create a "char" datapoint element and configure it to write into the string.DATA[] elements, but surely there's an easier way than writing a string character by character?
Regards,
Tom
writing into STRING tag on a CLX / Allen Bradley PLC
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
writing into STRING tag on a CLX / Allen Bradley PLC
- pwbarrett
- Posts:9
- Joined: Mon Jan 31, 2011 10:18 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Hi Tom,
Writing to a ControlLogix STRING tag from an OA string DP using the String transform should work. I just re-tested it here on 3.16 to be sure.
What version of OA are you using?
Is this by any chance some brand-new model of ControlLogix CPU?
One thing you could try - if your version has this setting in the driver panel, try checking the Read-by-Id box then restarting the driver.
That should ensure the driver knows the correct data-type when writing, although it shouldn't be necessary for a built-in type like a string.
-- Paul
Writing to a ControlLogix STRING tag from an OA string DP using the String transform should work. I just re-tested it here on 3.16 to be sure.
What version of OA are you using?
Is this by any chance some brand-new model of ControlLogix CPU?
One thing you could try - if your version has this setting in the driver panel, try checking the Read-by-Id box then restarting the driver.
That should ensure the driver knows the correct data-type when writing, although it shouldn't be necessary for a built-in type like a string.
-- Paul
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Hi Paul,
thanks for taking the time to reply.
Using 3.15 Patch 4 here with CLX-L63s (so nothing fancy) and the string transformation doesn't work, returning this:
With transformation set to string:
WCCOAeip (4), 2018.10.17 08:14:13.883, SYS, WARNING, 54, Unexpected state, EipMaster, processLogixResponse, CIP Error 0x001e: Invalid tag or data type
With no transformation:
WCCOAeip (4), 2018.10.17 08:16:17.112, PARAM,SEVERE, 54, Unexpected state, DP: (Type: 284 Sys: 1 Dp: 1667 El: 30 : _original.._value), MAN: (SYS: 1 Driver -num 4 CONN: 1), Missing transformPtr for CLX4.WE_EQUIP[0].Remark.DATA
I've got a ticket logged with Siemens / ETM and just sent them loads of logs, so hopefully something comes out of this. It does look like a bug as I can read the point without issues and if I change the direction from Input to Output the driver
Also, there doesn't seem to be a "Read-by-Id" box anywhere on the driver config.
See attachment for _address config details for reading. In order to write to the address, all I'm changing is the Direction, going from Input to Output.
Regards,
Tom
thanks for taking the time to reply.
Using 3.15 Patch 4 here with CLX-L63s (so nothing fancy) and the string transformation doesn't work, returning this:
With transformation set to string:
WCCOAeip (4), 2018.10.17 08:14:13.883, SYS, WARNING, 54, Unexpected state, EipMaster, processLogixResponse, CIP Error 0x001e: Invalid tag or data type
With no transformation:
WCCOAeip (4), 2018.10.17 08:16:17.112, PARAM,SEVERE, 54, Unexpected state, DP: (Type: 284 Sys: 1 Dp: 1667 El: 30 : _original.._value), MAN: (SYS: 1 Driver -num 4 CONN: 1), Missing transformPtr for CLX4.WE_EQUIP[0].Remark.DATA
I've got a ticket logged with Siemens / ETM and just sent them loads of logs, so hopefully something comes out of this. It does look like a bug as I can read the point without issues and if I change the direction from Input to Output the driver
Also, there doesn't seem to be a "Read-by-Id" box anywhere on the driver config.
See attachment for _address config details for reading. In order to write to the address, all I'm changing is the Direction, going from Input to Output.
Regards,
Tom
- pwbarrett
- Posts:9
- Joined: Mon Jan 31, 2011 10:18 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Tom,
Just so we're clear, this is a STRING tag in the PLC, not a user-defined-type, right?
In any case, 3.15 Patch 8 introduced a lot of fixes and features for the EIP driver (including that read-by-id checkbox).
I would strongly suggest applying the latest patch for 3.15 and see if that solves your issue.
-- Paul
Just so we're clear, this is a STRING tag in the PLC, not a user-defined-type, right?
In any case, 3.15 Patch 8 introduced a lot of fixes and features for the EIP driver (including that read-by-id checkbox).
I would strongly suggest applying the latest patch for 3.15 and see if that solves your issue.
-- Paul
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Hi Paul,
I've just checked and it's a non-standard STRING-like UDT (as in they all have the same construction with a LEN and SINT[] array, just a different name and array size) :/ there's a few made by whoever coded this mess 10 years ago with different character limits, for example STRING_70 for 70 character limited strings etc. There's two issues with this:
a) WinCC OA doesn't want to play ball with these when writing to them, not sure if it checks the name of the tag type (in this case it would be STRING_66 instead of the standard STRING) but it returns a type incompatible error. I've tried it with a normal STRING and it works perfectly
b) There's a few UDT string types which are larger than 84 bytes that WinCC OA happily handles
The only positive here is that I can write single characters directly into the string, that's the only thing that works, so the solution might be to create an array and pass the whole string that way, but I first need to figure out how to do that...
One easy way out would be to add a bit of mapping code to the PLC to pass the custom string tags into standard STRING tags, but all of them are in-out tags, so writing / reading would get a bit messy.
Rgds,
Tom
I've just checked and it's a non-standard STRING-like UDT (as in they all have the same construction with a LEN and SINT[] array, just a different name and array size) :/ there's a few made by whoever coded this mess 10 years ago with different character limits, for example STRING_70 for 70 character limited strings etc. There's two issues with this:
a) WinCC OA doesn't want to play ball with these when writing to them, not sure if it checks the name of the tag type (in this case it would be STRING_66 instead of the standard STRING) but it returns a type incompatible error. I've tried it with a normal STRING and it works perfectly
b) There's a few UDT string types which are larger than 84 bytes that WinCC OA happily handles
The only positive here is that I can write single characters directly into the string, that's the only thing that works, so the solution might be to create an array and pass the whole string that way, but I first need to figure out how to do that...
One easy way out would be to add a bit of mapping code to the PLC to pass the custom string tags into standard STRING tags, but all of them are in-out tags, so writing / reading would get a bit messy.
Rgds,
Tom
- pwbarrett
- Posts:9
- Joined: Mon Jan 31, 2011 10:18 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Tom,
Ah, that explains it.
The driver only allows writing a whole UDT from a blob DP, sorry.
You could stuff the length and text into a blob then write that using the blob transform.
-- Paul
Ah, that explains it.
The driver only allows writing a whole UDT from a blob DP, sorry.
You could stuff the length and text into a blob then write that using the blob transform.
-- Paul
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: writing into STRING tag on a CLX / Allen Bradley PLC
Hi Paul,
any ideas how to stuff it in a blob? I've changed the DP element type to blob and I can indeed pull in the entire string of hex values from the PLC structure (LEN followed by DATA array elements), but writing this back out doesn't work. To recap:
- PLC tag (UDT structure) looks like this:
example--------
] example.LEN - type DINT
] example.DATA - SINT[] array (array elements are 1 byte each)
- I've got a DP element which is a blob
- this element has an _address config added with the address pointing at the "example" tag (not the .LEN or .DATA specifically but the entire tag instead)
- if the address is set as an input I get the entire PLC structure as a line of HEX values (not sure why HEX), left most is 4 HEX bytes for LEN and then the entire SINT[] array
- if I change the address to In/Out and try to modify any of the HEX values I get an error saying wrong format (or smth along the lines)
- transform is set to blob
I'm starting to wonder if this is even doable with WinCC OA and CLX PLCs.
Rgds,
Tom
any ideas how to stuff it in a blob? I've changed the DP element type to blob and I can indeed pull in the entire string of hex values from the PLC structure (LEN followed by DATA array elements), but writing this back out doesn't work. To recap:
- PLC tag (UDT structure) looks like this:
example--------
] example.LEN - type DINT
] example.DATA - SINT[] array (array elements are 1 byte each)
- I've got a DP element which is a blob
- this element has an _address config added with the address pointing at the "example" tag (not the .LEN or .DATA specifically but the entire tag instead)
- if the address is set as an input I get the entire PLC structure as a line of HEX values (not sure why HEX), left most is 4 HEX bytes for LEN and then the entire SINT[] array
- if I change the address to In/Out and try to modify any of the HEX values I get an error saying wrong format (or smth along the lines)
- transform is set to blob
I'm starting to wonder if this is even doable with WinCC OA and CLX PLCs.
Rgds,
Tom