02-27-2007 04:31 AM
02-27-2007 04:43 AM - edited 02-27-2007 04:43 AM

Message Edited by daveTW on 02-27-2007 11:44 AM
02-27-2007 07:12 AM
Another option is to put the 'listener' in its own thread of execution (concurrent loop). Here you can continuously wait for the read or timeout in a loop, on timeout you can check for the condition to continue listening, if so, clear the timeout error and itterate the loop again. you can use a queue to pass the bar coded values back to the program or vene better you can make a user event or a value(signal) node to allow main loop to respond to an event of new barcode scanned event.
Paul
03-19-2007 03:23 AM
Hiya
Sorry for the delayed response - busy, then was away for a week
Thank you both for your replies.
I've attached the VIs that I wrote to do this, in LV7 format, for future reference for others that have this requirement. It might not work straight out of the box but gives enough of an idea of what's going on, I hope.
The "AbortBtnRef2" global is a reference to a "Cancel" button on the front panel. Ignore the other globals... they're for the rest of my app.
Before calling this VI, I ensure first that the serial buffer has been cleared. After, I check that the CR+LF is at the end of the string that I've read out.
Once again, thanks
Julian
03-19-2007 07:25 AM
03-19-2007 07:53 AM
D'oh! Anyway, I've just discovered a bug in them anyway - will re-post as soon as I've got them working - don't hold your breath tho'!
Julian