Sign in to follow this  
Followers 0
pandersen

Static strings in ControlLogix structured text

4 posts in this topic

So far it seems that this isn't possible, which really blows my mind. I just want to assign a static string to a string tag, the same way you would assign a number to a numeric tag: String := "Teststring"; Apparently this isn't valid syntax, so I can't do it. An incredibly horrible workaround would be to assign the ASCII values to each element of the DATA array and then manually set the string length, but that is really a last resort. Does anyone know any possible way to use a string literal in ControlLogix without jumping through major hoops? Edited by pandersen

Share this post


Link to post
Share on other sites
I had to go to the tag database and directly enter a string into the value for the tag. This was using ladder though.

Share this post


Link to post
Share on other sites
I may be a bit slow, but I'm not sure of your question. When you say "assign a static string" do you mean there is no need to be able to change the string from within the program? If that is the case, it is a simple matter to create the string tag and then enter your string into the tag using the 'Monitor Tags' tab of the Controller Tags window.

Share this post


Link to post
Share on other sites
Strings cannot be literal or immediate values in ControlLogix. Tags are valid as the operands of instructions like Assign (:=) or Insert or Concatenate, but as you have seen, Strings are assemblies of [Data] and [Length] elements, rather than actual values. I have always just entered strings into the tag database in Monitor mode and trusted that they won't be messed with inside the tag database. I can see where you might want to assign them as literals in Structured Text (I do so with DINTs and INTs all day long) but you are correct that the ControlLogix operating system does not consider a String to have a value.

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