Capture Barcode scan from serial port & load into array
Hello,
I have 2D barcode that is read by a scanner. The barcode string is comma delimited. I need to load this string into an array...but I am having trouble with the scan. It appears that the data is not instantly scanned into a textbox. It is load in packets I guess. When I try to load the string even into a label..it only captures part of it. What do I need to do to capture the whole scanned string and load it into a array. Someone also mentioned something about load it into a "stack" and using "push" and "pop". I am unfamiliar with these terms. Help!
Thanks!
Re: Capture Barcode scan from serial port & load into array
Thats because the comma is an invalid character in most barcode standards. Try either fixed length barcodes or use a "-" dash as the separater.
Re: Capture Barcode scan from serial port & load into array
Some scanners also prefix 49 to every scan, and as rob said you usually only scan one size of barcode.
Are you using the mscomm to capture the scan?
Re: Capture Barcode scan from serial port & load into array
Hello, I am bound by the string. I cannot change it. The customer has defined the 2D barcode with commas serparting the values. I see no reason why the scanner would not detect the commas ok. It just appears that the when the barcode is scanned...it instantly is put into the text box...but is NOT instantly loaded into anything else. Here is the simply code to read the scan into a text box.
VB Code:
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub
Private Sub MSComm1_OnComm()
Text1.Text = Text1.Text + MSComm1.Input
End Sub
Re: Capture Barcode scan from serial port & load into array
Using commas in the barcode is bad and if you can not get them to change it then not sure what else you can do. What barcode standard are you using? 3 of 9 or code 128 or ???
Re: Capture Barcode scan from serial port & load into array
As mentioned several times above... This is a 2D DataMatrix
Re: Capture Barcode scan from serial port & load into array
Not familiar with that one as you only mentioned "2D".
Do you have any supporting documentation on 2D?
Re: Capture Barcode scan from serial port & load into array
What parts are missing? Beginning, middle or end. Post some code how you opened the port.
Are you sure that the handshaking is working correct. Most of the time when data is missing and the data size is large the problem is handshaking.
Push, pop and stack are not used in VB, so do not fear.