07-12-2001 03:43 PM
07-12-2001 03:58 PM
07-12-2001 05:40 PM
07-13-2001 09:31 AM
04-18-2006 04:49 PM
04-19-2006 07:50 AM
Hi Valen,
I have worked with the Welch Allyn IT3800 scanner. Very nice product.
When you say: "sometimes it will take 2-3 attempts for the scanned barcode to be recognized." Do yiou mean the actual scanning of the barcode itself? Or do you mean the vi getting the barcode information?
The reason I am asking is because of this statement: "When it is not recognized, the barcode disappeared immediately once it is scanned. " The barcode meaning the information, right? The barcode itself doesn't dissappear... right 😉
I saw this problem in my early days with the scanner(s). From what I can recall, it turned out that the carriage return was overwriting the string before it was processed. THis was a wedge-type scanner which ended with a "\n\r". The cause was that I placed the barcode scan reading in a while loop, waiting for a string to appear. The string appeared, followed by a carriage return. Unfortunately, the while loop intercepted the string and processed another iteration of the loop before stopping. By that time, the string contained a carriage return which had a non-zero length. And the string that was passed to processing appeared to an empty string constant (until I noticed the \n\r..... )
If you are reading the barcode information within a loop, try Highliting the Execution (lightbulb) and look at what happens to the string. You can also place a Probe Data to look at the value of the barcode info.. and see if it does capture the information from the barcode.
The above description may not be your issue, but who knows.. 😉
JLV
04-19-2006 10:48 AM
Hello Joe,
Ooops....Sorry about the confusion
I use the while loop and key focus to read the data until the string length meets or exceeeds the spec, 18 bytes, assuming possible termination characters. The barcode information read into string control disappears immediately, and the probe shows the string is empty and the length is 0 when this happens. When the string is in '\' Codes Display, I don't seem to see any \n\r.
If the VI is continuously run, the data is hardly captured; if it is single runs, sometimes it passes with only one run and sometimes it takes 2-3 attempts. Since I am using LV5.1.1 for this to be compatible with the legacy systems and event structure is not available. I have changed the loop time delay from 10mS to 1000mS, and it seems to be working 100% now. I am a beginner with scanners and I am not sure how additional time delay helps....your comments?
Thanks,
Valen
04-19-2006 01:02 PM - edited 04-19-2006 01:02 PM
Hi Valen,
It does look like you're having a similar problem to what I was having.... I was using LV6.0 at the time.
Basically, when the while loop is executing, you are trigerring on the fact that there is an appropriately long string available to be processed, but by the time it is ready to be processed, the info is gone. My work around (if I recall..) was to place a shift register and append whatever string was captured and feed it to the shift register. The output of the shift register was then passed to the next step for processing. Otherwise, the string was always "dissappearing". I think it was because it was processing the value in the next iteration, whuich means that the barcode data got captured, the while loop does an iteration, then sees the data, but since it was in another iteration, the scanner was read again and filled the string with its new value which was an empty string (it had not read something new). Then this new value was passed from the while loop.
I know, the above doesn't make sense.... how do I describe that better.... Hummm.... the best way is to probe the data while highliting the execution, you'll see what happens.
Remember, you are reading the device at all times. like the keyboard, for instance... if you don;t type anything, nothing appears on the screen. But it doesn't mean that the keyboard buffer is not being read.. So in the while loop, you are reading (looking at the value) of the string for every iteration, whether there is data or not. So, once you actually trigger on the fact that there is data, the data is now flowing and the string "buffer" is filled with whatever the scanner now scanned, which is typically nothing. So that becomes the new data... or at least in the scenario that I had when first playing with scanners.
Appaending all new data permitted the loop to conserve past data which included what was recently scanned. I then parsed the data before processing it.
For what I was experiencing, the idea was that either I kept the last barcode capture or processed the data within the same iteration of the while loop. It's been a while since I worked with barcode scanners, but the last time I programmed a vi for it, I basically place a delay greater (slightly) than the time for the scanner to process the scan and append whatever is captured onto a single string which is parsed before processing. Worked great with the wedge types..
Sorry the explanation is strange... I probably have need for more cafeine!! 😉
Hope it does help you. But from what you describe, it sounds very familiar.. 😮
😄
JLV
Message Edited by JoeLabView on 04-19-2006 02:03 PM
04-25-2006 11:30 AM
Hello Joe,
I see what you are trying to explain and it is clear enough for me. Thank you so much for all the details and your help.
Have a blessed day,
Valen
04-25-2006 11:58 AM
Hi Valen,
You are welcomed. Let me know if it works ok and/or if you need further help.
JLV