LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing Strings

In my application a Galil DMC1416 motor controller sends CR/LF terminated strings to my LabVIEW program periodically. The LabVIEW program sits in a large "while loop" and periodically downloads any characters it finds in the DMC1416 buffer. Since the two loops are running independently, LabVIEW may find nothing, part of a string, or multiple strings when it checks. I am having trouble finding the right VIs and/or getting my mind around a data flow approach to putting these strings back together for processing. The strings are coming through (with some problems with TCP/IP handles and the Galil software) but my LabVIEW program keeps passing partial strings through to my parser which, of course, does not parse them properly.

Any suggestions as to how I should structure my LabVIEW code and/or VIs I should be using?
0 Kudos
Message 1 of 2
(2,682 Views)
The attached vi should help you to solve your problem :
It uses an uninitialized shift register to store the concatenated incoming string chunks, then search for a LF char, and return either an empty line, when no LF was found, or the chars before LF. The excess chars belonging to the following string are stored in the shift register...

Hope this helps !

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 2
(2,670 Views)