Sign in to follow this  
Followers 0
gazroo

How to know that CLX structure attributes are identifying a string

1 post in this topic

Hi,

As part of developing an EtherNet/IP driver for the CLX family, I have the task of recognising tags that would ordinarily be represented as strings.

With SLC/ML, that wasn't too difficult since strings were a pre-defined type found in files with a file type of 0x8d.

With CLX, I understand that the situation is quite different, since a string now becomes just another structured tag like so many others. So, for instance, in my controller, and with the help of information gleaned from the LogixTagRead program, I can see that a request sent for one particular tag (which I happen to know is a string) returns me the following information:

  • Tag type: A0 02, followed by,
  • Structure handle: CE 0F, followed by,
  • Length (DINT): 1A 00 00 00, followed by,
  • Data (Series of SINT): 41 42 43 and so on through to 58 59 5A

Now in one sense I am fairly clear how to interpret most of the above data -- but in another sense, I don't believe (unless I'm missing something) that it can ever tell me that this tag should be INTERPRETED as a string.

What do I mean by that ?

Well, the tag type of A0 02 simply says that this tag is a structure (because the top bit is set). Even if we were to unset the top bit, the value becomes 20 02 and I'm not sure if that has significance in itself.

I'm not sure if the structure handle (aka template id) of CE 0F tells me anything other than the fact that this is a symbol type of CE 8F. I know that this field can be looked up and will tell me that this structure comprises a C4 (DINT) followed by data comprising a series of C2 (SINTs) where the number of SINTs is given by the value of the DINT preceding. And, of course, this makes sense in that the DINT value of 1A 00 00 00 is decimal 26, followed by 41 42 43 ... 58 59 5A which is a 26-character string ABCDEFGHIJKLMNOPQRSTUVWXYZ. This is all correct.

So whilst this LOOKS like a string, how can my code be sure that it is actually to be INTERPRETED as a string ? At the end of the day, it is only a DINT followed by a series of SINT; this doesn't of itself mean it is a string.

Is there anything in the tag type or structure handle which actually identifies this as a string-type tag ?

Thanks.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0