|
-
May 22nd, 2006, 01:09 PM
#1
Thread Starter
Fanatic Member
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!
-
May 22nd, 2006, 01:31 PM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 22nd, 2006, 01:36 PM
#3
Hyperactive Member
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?
-
May 22nd, 2006, 01:46 PM
#4
Thread Starter
Fanatic Member
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
-
May 22nd, 2006, 01:49 PM
#5
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 ???
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 22nd, 2006, 02:03 PM
#6
Thread Starter
Fanatic Member
Re: Capture Barcode scan from serial port & load into array
As mentioned several times above... This is a 2D DataMatrix
-
May 22nd, 2006, 02:06 PM
#7
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 23rd, 2006, 01:44 AM
#8
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|