Results 1 to 8 of 8

Thread: Capture Barcode scan from serial port & load into array

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    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!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    Chesterfield, Mi
    Posts
    259

    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?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    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:
    1. Private Sub Form_Load()
    2.     MSComm1.PortOpen = True
    3. End Sub
    4.  
    5. Private Sub Form_Unload(Cancel As Integer)
    6.     MSComm1.PortOpen = False
    7. End Sub
    8.  
    9. Private Sub MSComm1_OnComm()
    10.     Text1.Text = Text1.Text + MSComm1.Input
    11. End Sub

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Capture Barcode scan from serial port & load into array

    As mentioned several times above... This is a 2D DataMatrix

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  8. #8
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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
  •  



Click Here to Expand Forum to Full Width