LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan from string

Hi,

I am using labview for parsing out a string of data coming out of an ic. It is a string of 1 and 0's and the string is quite long. The chip has two modes. In one mode it outputs a clock 10101010, and in another mode, it outputs actual data, which starts with a header 111010. The data does not always come at the beginning of the string. For example, there are many 0's before the header 111010, whereas the clock will always come at the beginning. Sometimes the chip also just outputs 0's when there is no data. Is there a way for me to scan the entire string and then output a number or something to control a case structure to do the relevant processing for each kind of data. I know there is a match/true false string function, but this examines only the beginning of the string, and the data coming out of the chip does not always appear at the beginning.


0 Kudos
Message 1 of 2
(2,549 Views)
Hello Timothy,

what you should do is:
convert the string into a byte string, then substract the ASCII value of 0 from that array, and than apply an <>0 function on the array. This will give an array of booleans.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 2
(2,537 Views)