String clearing

3 posts in this topic


Is there a command to clear the content of a string in rslogix 500?

I'm scanning a barcode string to ST9:0. After that I need to remove the content of that string for the next scan. So far I have copied an empty string into ST9:0 to make it work.

Shouldn't I be able to use the CLR command? When using the CLR command with destination ST9:0 I'm getting an error address must be specified to world level!


Thanks for any help

Edited by Neuling

Share this post

Link to post
Share on other sites

A string is a defined type composed of a length then an array of SINTs. I believe the CLR only works on atomic types (sint, int, dint etc). Copying an empty tag is my go-to method for more complex types. You may get some effect by just setting the length to zero but when I tried that I would occasionally see problems with new characters followed by the previous characters. I feel it's best to just clear the whole thing by copying an empty string as you are doing.

Edit - actually I think CLR can be used successfully with timers and counters so my blanket statement is probably false. It would be good to have a CLR with respect to strings.

Edited by b_carlton

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