SLC500 String Truncation

OkiePC

Lifetime Supporting Member
Join Date
Mar 2005
Location
ENE of Nowhere Oklahoma
Posts
11,791
What is the best method to remove the first single character from a ST element in a SLC500?

I have a method that works but is ugly, and was wondering if someone out there may have a better idea.

Currently, I copy the string to an integer file, then I use a SWP on those integers to swap the high and low bytes of each one. Then I have eight BSR instructions (in a loop) to shift everything over one character, then another SWP to get the bytes back in order, before copying the integers back into the ST element. Then I have to correct the LEN portion of the element, since it gets blown away in the process.

Yes it is ugly, and I am hopeful there is a better way...

Thanks in advance,
Paul
 
Lets make sure I understand you.

You want to delete the first character from the string, correct?

Use AEX

AEX ST20:0 2 81 ST:20:1

If ST20:0 is more than two characters long, ST20:1 will then have a copy of ST20:0 beginning at the second character. Although a lenght of 81 is programmed, only characters from positon 2 through the end of the string are copied.
 
Last edited:
OkiePC said:
Currently, I copy the string to an integer file, then I use a SWP on those integers to swap the high and low bytes of each one. Then I have eight BSR instructions (in a loop) to shift everything over one character, then another SWP to get the bytes back in order, before copying the integers back into the ST element. Then I have to correct the LEN portion of the element, since it gets blown away in the process.

I gotta say, that is some serious programming legerdemain.:geek:

Yes it is ugly...
QFT

🍺 🍺
 

Similar Topics

HI, My first post on here, Using SLC500 I have a STRING LEN 30 that I need to convert just the first 2 characters (POS 0 , 1) into an INT. any...
Replies
6
Views
2,426
I am using SLC500 how do you move ASCII (A10) into a string (ST9)? I tried cop FLL and no go Thanks
Replies
6
Views
2,210
Hi I have working 1 slc500 5/03 with a RLC Epax display, the plc sends some n7 values to string st17:0 through AIC (integer to string...
Replies
4
Views
2,457
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
257
can the slc500 5/05 send a email and text over Ethernet ?
Replies
3
Views
185
Back
Top Bottom