LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

separate exe for Barcode Scanner

We have an MS-Q Quadrus Barcode scanner for reading in UID bar codes.  The reader connects to the video monior USB port but is configured as an RS232 interface.  We also have a secondary popup (data entry dialog) that appears in place of the Test Stand Enter UUT Serial number dialog.  Anyway, what I would like to do is have the user scan the UUT when this (new) dialog is present, and populate the UID field.  I would then parse the string and populate the appropriate (other) fields with serial number, part number, etc.
 
My first thought was to have a separate exe running that somehow 'polls' the barcode scanner.  When it reads something, it would send a Notification of some kind.  The UUT Data Entry dialog would have registered for this event (not sure where I would do that).  It captures the event, extracts the string, etc.
 
Am I making this too complex/simple?  The other thing I'd like to do is close this 'thread' if the user closes out the main HMI.  Thoughts?
0 Kudos
Message 1 of 8
(3,992 Views)
To me, it sounds overly complex. Since you have a replacement for the TestStand serial number entry, why don't you just place the code for the serial read inside there? You would have a VISA Bytes at Serial Port or the Wait on Event with a Serial Character event.
 
p.s. USB barcode scanners that emulate a keyboard are even easier to use. All you need is a value change event to know that something has been scanned.
0 Kudos
Message 2 of 8
(3,987 Views)
While looking for solutions based on your suggestions, I found the attached VI (renamed and modified to have error in/out and the text coming out).  I thought for starters, I'd see if I could get this thing working if the value changed in the UID field (which I think gets triggered if the user tabs from one of the other fields to this one).  I placed the VI in there and used the barcode scanner to read a UID.  The UID doesn't show up in the UID field, and then most (but not all) of the time, the error (attached) pops up.  I can hit continue, and things are fine (not locked up).  I'd, of course, like to know what's wrong with my current code.  However, what I ultimately need is to be anywhere in the UUT Data Entry dialog and be able to capture the bar code event.  In the Event handler shown in the code, I basically have about nine cases where I handle the "Value Changed" event for a number of buttons and edit boxes.
0 Kudos
Message 3 of 8
(3,961 Views)

I just looked at your attached image... not the actual code..

Your event may not work because what would trigger it (if the property node was set to signalling) is actually what needs to run...  How can I put it??  Chicken or the egg??   To get into the the event case that handles "getting a scan", it is set to detect a value change for UID, but the UID value change needs a scan for it to change....   This will never happen..

0 Kudos
Message 4 of 8
(3,957 Views)
OK.  I admit this seems flawed.  And it probably is.  I thought, though, that a tab constituted a "value change" but apparantly not.  I guess what I'm trying to avoid is "forcing" the user to scan the UID (and basically locking up the station until they do).  They should have the option of manually entering in the serial number/part number OR scanning the UID - from which the serial and part numbers would then be parsed.  Obviously my event handling needs some work, so ANY suggestions would be appreciated.
0 Kudos
Message 5 of 8
(3,949 Views)
You could have a state machine which takes care of any pre-test conditions, such as bar-code scanning. 
0 Kudos
Message 6 of 8
(3,943 Views)
In this particular dialog, the user can enter values in a number of fields, select from a few drop downs, etc.  Then, when complete, they'll either press "Start' or 'Cancel'.  I currently initialize most of the fields, then go into the event loop until they select Start/Cancel.  If I convert this to a state machine, possibly with a queue to feed it, what events would I capture (and what type would the queue be) such that the user can tab around, enter info, etc, until Start/Cancel clicked.  I want to run the barcode reader code if the 'Focus' is on the UID or Serial Number fields.  THoughts?
0 Kudos
Message 7 of 8
(3,917 Views)
With a serial barcode reader, I'm not sure I would use an event structure like the much simpler USB scanners. With a state machine, you could have an idle state and a key focus property node. When this is true, go to a serial read state. Validate the scanned string and base the next state on the results of the validation. I'm not sure off hand how to handle the option of giving the operator to do a manual entry. I don't think I would have the serial read subVI have it's own while loop. I think I would have the while loop in the calling VI and terminate the while loop if data from the subVI or from the string control is valid.
Message 8 of 8
(3,905 Views)