Group delete of ascii characters in compaxtlogix

96kingo

Member
Join Date
Jan 2012
Location
Rochester
Posts
16
Hi All

Im having a small issue with manipulating ascii characters once in my Compactlogix PLC.

I have an external source writing a load of data to the serial port on my controller. I take the data from the buffer, placing it in a custom string tag. This is then cut down to leave me with an 11 character string. This string is in the format 'a b c d e d' with a space in between each character, (this is how i receive the data).

Is there a way to remove all the spaces at once rather than using 5 delete functions for each space?

Best Regards

Oliver
 
The only thing I can think of is to do a FIND and search for a space. Then do a string DELETE. You could do a small routine that just takes the every other letter out of the string and CONCAT them into a string.

CONCAT test.DATA[0] TESTE.DATA [2] TEMP CONCAT test.DATA[4] TEMP TEMP CONCAT test.DATA[6] TEMP TEMP CONCAT test.DATA[8] TEMP TEMP CONCAT test.DATA[10] TEMP TEMP
Then TEMP has your data with no spaces
 
Jeff

Ive written a similar routine just using delete's instead of concat's which works, but just a bit messier than I would have liked.

Thanks for your help.

Oliver
 
Sorry I should have started up 5000. You can't specify to the Data location. DATA[0]

I guess DELETE is your best bet.
 
Is there a way to remove all the spaces at once rather than using 5 delete functions for each space?

Nothing wrong with this; the upside is that someone reading the logic later will know exactly what you are doing - verses scratching their head over some trick code that is hard to read.
 

Similar Topics

Hello all. This is a very lonnnnnnng shot but worth a try. I have an OMS Group Impact100 metering machine. At this customer it blows foam into 3d...
Replies
0
Views
185
I am trying to modify screens and many of the objects are grouped. Can you show me where the ungroup button is? Thanks!
Replies
6
Views
690
After a recent revision of code in my system on both the HMI and the HC900 PLC, I now get a popup requesting me to login when I click on the...
Replies
2
Views
513
I am trying to add a TCPIP server group to integrate a Schneider M221 PLC in to Wonderware. When right clicking on the Operations Integration...
Replies
0
Views
423
Good afternoon. I'm working on a project with FTView13 and the PlantPAx 5.10 library. Can someone familiar with the library, tell me how to...
Replies
2
Views
1,072
Back
Top Bottom