Copying strings in rslogix500

Join Date
Jan 2003
Location
Michigan
Posts
490
Cant use a move command, so how does one move as string is rslogix 500. I cant seem to find and string related commands for copying.. I can compare em, annotate them, but not copy them?? Thanks in advance.

Matt
 
Last edited:
Use the Copy (COP) command giving the address for the source and destination. Make sure to put the pound sign (#) before each. The length is one (1) for each string to copy.
 
Just a thought, but could you use the String Extract (AEX) command? It doesn't look like it changes the source, has a destination, but is limited to 82 characters.
 
bernie_carlton said:
The length is one (1) for each string to copy.

What is the limit?
I know that the length for the COP instruction is usually measured in 16 bit words. How does this work with the ST data type?

If the destination file type is 1 word per element, you can specify a maximum length of 128 words. If the destination is a timer file (3 words per timer), you can specify a maximum length of 42 elements (3 x 42 = 126). In this case 2 words would remain unused.
 
The setup of a ST (String) type file accepts up to 256 strings. Since the Copy command suggest a limit of 128 words and each string takes up 42 words I guess 3 strings is the limit. I've only moved one at a time so I really don't have any first hand information.
 
Last edited:
Int's and Str's

There are several ways to manipulate ST strings and I integers (or A ASCII) registers.

1) Use the COP command. If you want to build a string that's stored in N11:1 through N11:4 (eight characters, from an ASCII read instruction from a device connected to channel 0), then first MOV 8 into N11:0. Then when you do the instruction COP #N11:0 #ST12:0 1, the first element of the ST data block, the length, will be what you want (that is, 8 characters), and you will get what you want and nothing else. COP's without the pre-defined length get very strange, since the first ASCII character pair wind up in the .LEN.

2) You can manipulate each ASCII pair individually as if it were an integer. Just as the address ST12:0.LEN references the length. ST12:0.DATA[0] references the first TWO characters in the string. .DATA[1] are the third and fourth characters, etc. A MOV N11:1 ST12:0.DATA[0] would replace the first two characters in ST12:0 with the data in N11:0.
 

Similar Topics

Hiya, For a machine im using a recipe that has 20 lines. Each line contains a free enter field for the customer to enter whatever into (String)...
Replies
3
Views
6,613
I have a Function Block, FB10, with IN_OUT variables of type string called MyString1 and MyString2. I want to copy MyString1 to MyString2 and...
Replies
11
Views
10,747
I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
327
Hi All, I am looking to copy and paste a routine. I know this has to be done offline. My question is, when I go back online, these tags are...
Replies
6
Views
596
Hello everyone, friends. I need help with something related to SCL. In a FB, I need to copy the value in the DB to the DB at another address. I...
Replies
3
Views
1,402
Back
Top Bottom