[SOLVED] handling data acquired by barcode reader

Author: mail@gandg.it (TheAleph)

I  all,  I'm using U 9.4 In a form I create a field that displays data from a barcode-reader, can't find a way to handle it without CR or sending, that I have to run the trigger when the field is enhanced and then clean it up and stay waiting for a new reading. Thanks


  1. Hi, I've used this before (with a standard edit box) - I presume your barcode is of a certain lenght - let's say C20; If that's the case, add the following to your syntax definition of your input field: JMP Once your scanner is finished dropping the barcode content into the keyboard buffer and it has been transferred to Uniface, the JMP (JUMP) to next field is performed. At that moment in time, the validate field / leave field triggers are fired and you can do what you need to do. HTH & regards, Knut

    Author: Knut (knut.dybendahl@gmail.com)
  2. Roberto, AFAIK it depends also from: a - the barcode you are reading b - the configuration of your barcode scanner There are barcodes managing a single line of data and barcodes managing multiple lines of data... Barcode readers could be configured being transparent or to add at the end of each reading (if you need it!) a specific character; as example: - CarriageReturn - Tab The solution proposed from Knut is really valid when your data coming from barcodes has always the same length. In other contexts when data has variable length is simpler to configure your barcode reader to add a "Tab" as additional character, so your application is "automagically" leaving the ID field because the Tab is recognized as NextField. Hope this helps... :-) Gianni

    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  3. Hello, we use a barcode scanner (reader) in several forms, mainly to read product codes (or packages or serial numbers). Bar codes length vary a lot (so can't use the trick with C20 and JMP syntax). Most of the scanners can be configured to use some kind of prefix and suffix. We advice customers to configure the scanner to no prefix and only the tab key as suffix. Some scanners must be configured to use 0x09 char instead of tab key. In Uniface, we use editbox and have the appropriate proc code in the LeaveField trigger. The Autoselect property is set to on! This ensures that every scan is processed. And if the code is unreadable for scanner, user can enter the code manually (just by typing in the editbox and hitting the Tab key). In the case of error, the LeaveField trigger returns $status < 0 and the autoselect property ensures the data in editbox are selected and therefore overwritten by the next scan. Kind regards, Zdeněk

    Author: sochaz (zdenek.socha@fullsys.cz)
  4. We used the ^USER_KEY function, so we have a prefix and suffix sent by the bar-code which triggers the user key using the following setting in the keyboard table.  ^^ Barcode ^130^54 ^USER_KEY^070^009   So the prefix is ^130^54 and then the bar-code, and then the suffix is ^009 (Tab).  As such, the field triggers are not fired directly, the User Key trigger is fired instead, and the processing done in there ($char = 70, $result = bar-code). Our bar-codes identify the type of code read (user, machine, process, stock etc) within the bar-code itself, and therefore one central loop can populate the relevant data. It has the advantage that the user does not have to be focussed on a particular field when the bar-code is scanned.  We then move the code in VLDF and VALC to field local procs, so it can be fired independently.  The user key also prevents the bar-code scanner being used to 'type' random data into other fields, because without the code in the User Key trigger, nothing happens.... 

    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5. Thanks to everybody for answers and suggestions. Are all good solutions, I think to configurate scanner with cr or tab is the rigth good one in this case. Bye 

    Author: TheAleph (mail@gandg.it)