Extracting parts of a string AB L23E-QB1

DaytonPLC

Member
Join Date
Nov 2013
Location
Beavercreek, OH
Posts
18
I have a stand alone test stand that spits out a ASCII string with the test results. Each results in the string is separated with a comma and there are 6 tests being sent.

I can't use the MID block because the length of the string may change from each cycle of the machine depending on the test results.

My question is this, How do I extract the results using the comma's?

Thanks for any help...
 
Use the FIND instruction to locate the position of the commas. Feed that position to the MID instruction.
 
Use the FIND instruction to locate the position of the commas. Feed that position to the MID instruction.

Thanks John,

The problem is my string looks like this:
'SD,0.0000566,0.00376,0.000150,0.0000572,0.00692,0.00659,0.151,$r$l'

Depending on the results of the test, it might be 4 digits or more as you can see, up to 9. I never know...
 
You'll need to run a little algorithm on the values returned by the FIND. First comma at position 2, second comma at 12. 2+1=3 (to skip the starting comma) so MID start parameter is 3, quantity = 12-3 = 9. And so on.
 

Similar Topics

I am attempting to access HMI tag properties (Description, Minimum, Maximum values) to populate a numeric input. Is there a clean way to do this...
Replies
0
Views
373
Hi all, I have a customer with an FTView SE system running some datalog files. They can see the trends on the client, but they now want to...
Replies
7
Views
2,707
Hi, I'm using the 2080-MOT-HSC High Speed Counter plug-in module with a Micro850 (2080-LC50-24QWB) using the HSCE instruction. The encoder is a...
Replies
2
Views
1,664
Hi, I am having trouble getting the .dmk file extracted so that ControFlash will see the new firmware revision. I hit extract all files and it...
Replies
6
Views
4,784
Hello, I currently have a factory talk project (Project 1) that uses visual basic to calculate an integer. I am in the process of developing a new...
Replies
1
Views
1,325
Back
Top Bottom