DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use spaces as delimiters in serial data strings?

I'm acquiring ASCII data strings from an RS232 device, which has multiple channel values separated by spaces - how can I get Dasylab to recognise the spaces as channel separators?
Example <STX>_AKON 6 12345678 12345678 12345678 12345678 00000000 00000000<ETX>
Channel 1 to 4 data values are all 12345678 and are of variable length, the two 00000000 values can be discarded.
Many thanks.
Message 1 of 3
(7,350 Views)
Chan 0: "\x02_AKON" a \x20
will lock on the start of line, and find the first value that ends at the space
<STX> is Hex 02, represented in the parsing string as \x02

Chan 1: a\x20
space is the delimiter, represented by hex 20, or \x20
Chan 2: a\x20
...
Chan 6: a\x03
The last value terminates with <ETX> which is Hex 03

Discard 5 and 6 by not using them, or not creating them. Channel 0 ensures that you consistently start at the first character of the line, <STX>.

Hope this helps.


Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(7,349 Views)

CJ,

Worked like a charm and the "search for character string" is a much better anchor than the skip function I was using - many thanks for your help.

Peter

0 Kudos
Message 3 of 3
(7,330 Views)