LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan from string error

Hi - I have written a VI that takes in data coming in over the serial port, parses it, and displays it. It all works great as long as the serial data does not get corrupted. Unfortunately, I'm dealing with a wireless link that occasionally throws out a character or two. When that happens the VI grinds to a halt and gives me an error.
 
I would like it to be able to get past this error without yelling at me. The string comes in once/second and once the whole message has arrived (it has a termination character - so it's easy to know when the end has come) - it goes into a case structure where the scan from string is called. After the scan from string is called, the data is interpreted in many different ways.
 
Ideally - I would like it to just exit the case structure when there is an error, and not do anything with the data that was read in. Otherwise, if it could just use the last set of data that was read in - that would be OK too.
 
Can anybody suggest how to go about doing this? Eventually I plan on also adding a checksum, which will make things easier. But for now I need to find a way to take care of this error.
 
Thanks!
 
-Mike Noone
Download All
0 Kudos
Message 1 of 3
(2,518 Views)
"Scan from string" has an error output. Simply place everything afterwards inside a case structure and wire the error the the case terminal. Place all relevant code into the "no error" case. Leave the error case empty.
 
All indicators in the case structure will retain their old value when an error occurs.
0 Kudos
Message 2 of 3
(2,511 Views)
Hi - that appears to have worked perfectly! I had been wondering how one could use that error output. LabVIEW never ceases to impress me.
 
Thanks!
 
-Mike
0 Kudos
Message 3 of 3
(2,504 Views)