Andy_P

CompactLogix strings.

9 posts in this topic

How do I add a constant string to a CompactLogix PLC and RSLogix5000?

How do I copy one string to another? I have found links to using the COP instruction, which is fair enough, but the source parameter needs a tag and not a literal. How do I get a value into the tag? Can I really only do it when online?

I'm new to Allen Bradley, and finding string usage to be very confusing so far.

 

Share this post


Link to post
Share on other sites

You cannot do string constants in ladder logic. Your only option there is to create a tag that you populate with the string that you want, and use that as your constant.

Another option is to use structured text (ST) programming, if you have it available. You have to have one of the higher levels of the software. This method takes a little getting used to, but it will allow string constants.

Share this post


Link to post
Share on other sites
Just now, JRoss said:

You cannot do string constants in ladder logic. Your only option there is to create a tag that you populate with the string that you want, and use that as your constant.

OK, so how do I do that? I don't see a way to do that offline.

Share this post


Link to post
Share on other sites

Go to tags and create a string tag. Then switch from the edit view to the monitor view (tabs at bottom of tag database). Click on the value and type in the string you want as your constant.

Share this post


Link to post
Share on other sites

Thanks for that.

I never expected I would need to go to the 'Monitor' tab while offline.

Share this post


Link to post
Share on other sites

That makes perfect sense...create a new STRING tag, which you have not tied to any I/O so you will have to populate that new string tag with string data, switch to Monitor view, enter some data into the new string tag.  Voila!

Share this post


Link to post
Share on other sites

The idea of a tag not tied to any I/O or other updates from the program makes perfect sense, agreed.

I am just used to 'monitoring' data when online to a PLC. Seems odd to me to monitor something when not connected.

Share this post


Link to post
Share on other sites

In AB, the offline file always includes device data as part of the processor image. So you are "monitoring" the offline data. This data then gets downloaded to the processor with the program and parameters. There's no way to separate the pieces in AB, it's all or nothing.

Share this post


Link to post
Share on other sites

Thanks. I'm beginning to get my head around how things are in AB now.

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