LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Data Matching

Hi there, Good day! I trying to read serial data that sending continually from the UUT (some sort like real time reading), when data received using the serial read vi, it need to search for the header "5A10D38D" and read the following data e.g "0083" and display out, thereafter skip to next line with the same header. May I know how to do the search string and able to skip to next line? I think match pattern cannot use in this application. I have attached the vi and excel file for your reference. Thank you in advance for the help! Using: LabVIEW 7.1
Download All
0 Kudos
Message 1 of 2
(2,611 Views)
Actually, it looks like you are pointed in the right direction. Attached is a snapshot of code that will do the parsing for you. I designed it so that you can put it in the loop where you are reading the serial port. The subVI takes the output from the serial read and parses datapoints from it until it runs out of headers. The subVI outputs a 1D array of the data values it found in the last block of data and any remaining string that was left over after the last data value was found. The intent is that this leftover string would be prepended to the new block of data coming from the serial read.

This saving of the leftoover string is necessary because it is possible that the data read ended in the middle of a data header. Saving this remnant and adding it to the beginning of the next read allows that split data set to be reconstructed.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Download All
Message 2 of 2
(2,606 Views)