PxPlus User Forum

Twitter Twitter Twitter

Author Topic: how to scan GS1 barcodes  (Read 1449 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
how to scan GS1 barcodes
« on: April 09, 2020, 04:55:15 AM »
Does someone know how to scan a GS1 barcode with multiple fields?
The scanner seems to insert some control bytes as field separators which are stripped by a multiline control.

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: how to scan GS1 barcodes
« Reply #1 on: April 09, 2020, 09:19:40 AM »
We don't use multi-field codes. You may have already done this, but I would check to confirm that the codes are not being stripped by the scanner first. Then try using INPUT to test it. You may need to set the Auto Signal on All Change attribute to process each character coming in.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: how to scan GS1 barcodes
« Reply #2 on: April 09, 2020, 10:10:21 AM »
We tried an INPUT A$ with a GS1 barcode consisting of three fields. The scanner always sent three inputs, no matter what we tried. In console mode the first one was assigned to A$ and the next two caused syntax errors of course. An INUT A$,B$,C$ didn't help, because the inputs did not correspond to the fields. A multilined mulit_line doesn't help either.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: how to scan GS1 barcodes
« Reply #3 on: April 09, 2020, 10:23:28 AM »
Thomas, I would try a raw read from the input to see what is being returned by the device.  Something like this:

while 1
 obtain (0,siz=1),'bi',x$,'ei'
 if x$="" x$=eom
 if x$=esc break
 print hta(x$)," ",
wend

Loops until ESCAPE is received

This should tell you exactly what is being sent. (You may need to change the ESC to something else should the reader send that character).

Once we know exactly what is being received between the fields we may be able to advise.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: how to scan GS1 barcodes
« Reply #4 on: April 14, 2020, 03:32:35 AM »
Thank you Mike.
The separator byte is $1D$. So the next question is how to integrate this into a GUI? Is there a way to set a multiline to raw mode?

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: how to scan GS1 barcodes
« Reply #5 on: April 14, 2020, 02:06:09 PM »
There is no easy way to allow a graphical control to handle a $1d$ character (CTRL+]).  I would suggest you see if there is a way to change the separator on the reader or reader capture software (many have this option). 

If you cannot change the character, you could in your code switch focus to window itself (SET_FOCUS 0) and capture the characters much the same way as the test program did.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com