alnickels 0 Posted December 10, 2020 Does anybody have and example example coding working with a Zebra USB scanner? Share this post Link to post
Virgo 18 Posted December 10, 2020 Barcode scanner? Those are usually just USB keyboards. Or are Zebra ones different? Share this post Link to post
Lars Fosdal 1792 Posted December 10, 2020 Usually there would be a driver that allows the scanner to be accessed as a COM port, or the scanner presents as a virtual keyboard (wedge configuration). The latter is something that we avoid. The COM port abstraction means it doesn't matter if the device is a BT device, a serial device, or an USB device. A possible starting point would be to explore from here: https://www.zebra.com/us/en/support-downloads/knowledge-articles/evm/emulating-a-com-serial-port-over-usb-using-cdc-driver.html Share this post Link to post
Lars Fosdal 1792 Posted December 10, 2020 If you already have a driver, the associated COM ports should be identifiable from the device manager. Open Device Manager Click on View in the menu bar and select Show hidden devices Locate Ports (COM & LPT) in the list Check for the com ports by expanding the same Share this post Link to post
Cristian Peța 103 Posted December 10, 2020 9 hours ago, Lars Fosdal said: or the scanner presents as a virtual keyboard (wedge configuration). The latter is something that we avoid. A little off-topic but this depends. I prefer the scanner to be a keyboard because every client want to user their scanner and setup is very easy. Just plug the scanner into USB and is working. With VCL I use Form.OnKeyDown with Form.KeyPreview=True. Even in browser I use document.addEventListener("keydown", WAKeyDown). This way if the web app tab in the browser has focus I receive the input from the keyboard. No need to have a edit box in focus. And reading a serial port in Javascript is not so straightforward. But there can be a issue if you want to distinguish between a real keyboard and barcode reader. 1 Share this post Link to post
Lars Fosdal 1792 Posted December 11, 2020 My perspective is from the VCL app where any number of frames and forms can have focus. Having to deal with the wedged in virtual keyboard that produces input that is not intended for a checkbox or a button is a PITA, hence the COM port. We accept the scan over the COM port in a background thread and decode the GS1 128 AIs to build a content description, queue it, and post a message to the main window which then propagates the info to the focused form/frame. The frame can then check the queued AIs by identity to see it there is content relevant to it. This also allows us to capture the scans faster than we process them, so that the user doesn't have to wait. 2 Share this post Link to post
Guest Posted December 11, 2020 (edited) maybe this GitHub help if not out-theme of course: Quote ZXing.Delphi is a native Object Pascal library that is based on the well known open source Barcode Library: ZXing (Zebra Crossing) Fernando Rizzato (MVP Embarcadero lead for South America) talk about it in your Blog - in Portuguese-BR https://fernandorizzato.com/2017/04/08/um-leitor-de-codigo-de-barras-portatil-com-fmx-e-app-tethering/ https://fernandorizzato.com/2017/04/08/um-leitor-de-codigo-de-barras-portatil-com-fmx-e-app-tethering/ and Andrea Magni (MVP Embarcadero from Italy) https://blog.andreamagni.eu/2017/06/scannermapp-a-qrbarcode-scanner-app-with-delphi-zxing-and-tframestand/ https://github.com/Spelt/ZXing.Delphi Quote ZXing.Delphi is a native Object Pascal library that is based on the well known open source Barcode Library: ZXing (Zebra Crossing). This port is based on .Net Redth port of ZXing and the Java one. This is I think the first native FireMonkey barcode lib. It is aimed at all of the FireMonkey mobile platforms and, starting from v3.1, it fully supports also Windows VCL applications (no dependencies on FMX.Graphics unit). With this library you can scan with native speed without the use of linking in external libraries and avoid compatibility issues and dependencies. It is fast. Its compatible with in Delphi XE7 - 10 Sydney and tested with IOS 8.x, 9.x, 10.x, 11.x, 12.x, Android, Windows 32/64 and OSX. The goal of ZXing.Delphi is to make scanning barcodes effortless, painless, fast and build within your FireMonkey or native Windows (VCL or Firemonkey) applications. Just include the source files and add it in your existing projects and build the ZXing.Delphi source within your projects. Edited December 11, 2020 by Guest Share this post Link to post
Cristian Peța 103 Posted December 13, 2020 On 12/11/2020 at 8:35 AM, Lars Fosdal said: My perspective is from the VCL app where any number of frames and forms can have focus. For your scenario reading the COM port is a better solution. We have only one form that displays many details related to scanned bar-code. Usually the user will work all the day only with a bar-code scanner. No keyboard, no mouse. And the installation must be as easy as possible. Some want to work on Linux, others on smart TV Box's with Android... so this year we moved this part in browser. Share this post Link to post