Zebra Scanner SDK For Windows Developer's Guide

Transcription

ZEBRA SCANNER SDK FORWINDOWSDEVELOPER’S GUIDE

ZEBRA SCANNER SDK FOR WINDOWSDEVELOPER’S GUIDE72E-149784-07ENRevision ADecember 2020

iiZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDENo part of this publication may be reproduced or used in any form, or by any electrical or mechanical means,without permission in writing from Zebra. This includes electronic or mechanical means, such as photocopying,recording, or information storage and retrieval systems. The material in this manual is subject to changewithout notice.The software is provided strictly on an “as is” basis. All software, including firmware, furnished to the user is ona licensed basis. Zebra grants to the user a non-transferable and non-exclusive license to use each softwareor firmware program delivered hereunder (licensed program). Except as noted below, such license may not beassigned, sublicensed, or otherwise transferred by the user without prior written consent of Zebra. No right tocopy a licensed program in whole or in part is granted, except as permitted under copyright law. The user shallnot modify, merge, or incorporate any form or portion of a licensed program with other program material, createa derivative work from a licensed program, or use a licensed program in a network without written permissionfrom Zebra. The user agrees to maintain Zebra’s copyright notice on the licensed programs deliveredhereunder, and to include the same on any authorized copies it makes, in whole or in part. The user agrees notto decompile, disassemble, decode, or reverse engineer any licensed program delivered to the user or anyportion thereof.Zebra reserves the right to make changes to any software or product to improve reliability, function, or design.Zebra does not assume any product liability arising out of, or in connection with, the application or use of anyproduct, circuit, or application described herein.No license is granted, either expressly or by implication, estoppel, or otherwise under any Zebra TechnologiesCorporation, intellectual property rights. An implied license only exists for equipment, circuits, and subsystemscontained in Zebra products.

iiiRevision HistoryChanges to the original guide are listed below:ChangeDateDescription-01 Rev A6/2011Initial release.-02 Rev A3/2012Updates for 64-bit:- updated Table 2-2; converted code to text from graphics- removed unsupported methods- updated Table 2-2 (add cradle info for DS6878 & LS4278)- added USB CDC support- updated pgs. 4-13 & 4-14: DEVICE BEEP CONTROL & DEVICE LED ONchanged to SET ACTION; arg-int values changed to 2 & 43, respectively- updated note and Step 6 on page 4-14; added 3 rows for TWAIN to the bottomof Table 2-3 on page 2-11.-03 Rev A11/2013Adds:- Scale information.- Intelligent Document Capture (IDC) information.- USB IBM Table-top; SSIUpdates:- Installation package name changes- New Configuration section (pg. 2-13).-04 Rev A4/2015Zebra software branding.-05 Rev A3/2016Zebra software rebranding.-06 Rev A3/2017--07EN Rev A12/2020Software updates.Removed/replaced references to the Attribute Data DictionaryUpdated supported operating systems tableUpdated List of Methods tableAdded Action Attributes tableRemoved CONFIGURE DADF and RESET DADF commands

ivZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDE

TABLE OF CONTENTSRevision History . iiiAbout This GuideIntroduction .Chapter Descriptions .Notational Conventions.Service Information .ixixxxChapter 1: INTRODUCTION TO THE SCANNER SDKOverview .Quick Startup .FAQs .Scanner SDK Architecture .Multiple Scanner Device Identification Methodology For Applications .How Multiple Applications Access Multiple Scanners From Scanner SDK .Three Applications Connected To One Scanner .Implementation Details .Three Applications Connected To Two Scanners .Implementation Details .Many-to-Many Application Device Usage .Implementation Details .One Application Connected to Two Scanners .Implementation Details .1-11-31-41-51-71-71-71-71-81-81-81-81-91-9Chapter 2: INSTALLATION & CONFIGURATIONOverview .SDK Components .System Requirements .Supported Operating Systems .Scanner Models Versus Communication Modes .Installing the SDK .2-12-22-22-22-32-3

viZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDEStep-by-Step Installation Instructions .Installed Components .Configuration .Serial Mode Settings .Sample SERIAL MODE SETTINGS Definition in Config.xml .Simulated HID Keyboard Output .Sample HID KB PUMP SETTINGS definition in config.xml: .Notes .Simple Data Formatting (SDF) .Sample SDF definition in config.xml: .Basic Installation Verification .Silent Unattended Installation of the Scanner SDK pter 3: SCANNER SDK APIOverview .Scanner ID .API Commands .Open .GetScanners .ExecCommand .ExecCommandAsync .Close .API Events .ImageEvent .VideoEvent .BarcodeEvent .PNPEvent .ScanRMDEvent .CommandResponseEvent .IOEvent .ScannerNotificationEvent .BinaryDataEvent .Methods Invoked Through ExecCommand Or ExecCommandAsync .Examples: Using the Methods .GET VERSION .REGISTER FOR EVENTS .UNREGISTER FOR EVENTS .CLAIM DEVICE .RELEASE DEVICE .ABORT MACROPDF .ABORT UPDATE FIRMWARE .AIM OFF .AIM ON .FLUSH MACROPDF .DEVICE PULL TRIGGER .DEVICE RELEASE TRIGGER .SCAN DISABLE .SCAN ENABLE .SET PARAMETER DEFAULTS .DEVICE SET PARAMETERS 23-223-233-233-233-243-243-243-25

Table of ContentsSET PARAMETER PERSISTANCE .REBOOT SCANNER .DEVICE CAPTURE IMAGE .DEVICE CAPTURE BARCODE .DEVICE CAPTURE VIDEO .ATTR GETALL .ATTR GET .ATTR GETNEXT .ATTR SET .ATTR STORE .GET DEVICE TOPOLOGY .START NEW FIRMWARE .UPDATE FIRMWARE .UPDATE FIRMWARE FROM PLUGIN .UPDATE DECODE TONE .ERASE DECODE TONE .SET ACTION .DEVICE SET SERIAL PORT SETTINGS .DEVICE SWITCH HOST MODE .KEYBOARD EMULATOR ENABLE .KEYBOARD EMULATOR SET LOCALE .KEYBOARD EMULATOR GET CONFIG .SCALE READ WEIGHT .SCALE ZERO SCALE .SCALE SYSTEM RESET .Error/Status Codes 13-42Chapter 4: TEST UTILITIES & SOURCE CODEOverview .Test Utilities Provided in the SDK .Scanner SDK C Sample Application .Scanner SDK C#.Net Sample Application .How to Verify Scanner SDK Functionality .Scanner Discovery/Asset Tracking Information/Validating Successful SDK Installation .Barcode Scanning .Example .Language/Locale Details .Capture Image and Video .Beep the Beeper .Flash the LED .Querying Attributes and Parameters .Parameter Setting (Device Configuration) .Examples .Host Variant Switching .Firmware Upgrade .Firmware Upgrade Scenarios .Firmware Upgrade Procedure 14-224-254-274-274-27vii

viiiZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDEChapter 5: SAMPLE SOURCE CODEOverview .Sample Utilities Provided in the SDK .Creation of COM Object And Registration for Events .Register for COM Events .Calling Open Command .Calling Close Command .Calling GetScanners Command .Calling ExecCommand Command and ExecCommandAsync Command .5-15-15-15-25-25-25-35-3Appendix A: WRITE SIMPLE APPLICATIONS USING THE SCANNER SDK APIOverview .Import CoreScanner Reference, Class Declaration and Instantiation .Call Open API .Call GetScanners API .Calling ExecCommand API to Demonstrate Beep the Beeper .Retrieve Asset Tracking Information from ExecCommand with the RSM GET Method .Enable the UPC-A Attribute by Calling SET ATTRIBUTE via ExecCommand .Capture Barcode Data into an Application .A-1A-2A-5A-6A-8A-10A-12A-13Appendix B: SCANNER SDK VISUAL STUDIO PROJECT TEMPLATEOverview .Environment .Installing the Project Template .Using the Project Template .B-1B-1B-1B-3Appendix C: DESCRIPTION OF INTELLIGENT DOCUMENT CAPTURE FORMATOverview . C-1Example . C-2Appendix D: CORESCANNER DEBUG LOGGINGOverview . D-1Microsoft DebugView . D-2IndexQuick Startup

ABOUT THIS GUIDEIntroductionThis guide provides information about the Zebra Scanner Software Developer Kit (SDK) - an architecturalframework providing a single programming interface across multiple programming languages and across multiplesystem environments for all scanners communication variants (such as IBMHID, SNAPI, SSI, HIDKB, NixdorfMode B, etc.).Chapter DescriptionsTopics covered in this guide are as follows: Chapter 1, INTRODUCTION TO THE SCANNER SDK provides an overview of the Zebra Scanner SoftwareDeveloper Kit (SDK). Chapter 2, INSTALLATION & CONFIGURATION describes how to install Zebra Scanner SDK and itscomponents on recommended platforms. Chapter 3, SCANNER SDK API provides the set of APIs to interface with scanner devices. Chapter 4, TEST UTILITIES & SOURCE CODE provides information about testing and evaluation of theZebra Scanner SDK's software components using the test utilities provided in the SDK. Chapter 5, SAMPLE SOURCE CODE provides information about how a developer uses the Zebra ScannerSDK. Appendix A, WRITE SIMPLE APPLICATIONS USING THE SCANNER SDK API provides a step by stepguide to writing simple applications using CoreScanner APIs. Appendix B, SCANNER SDK VISUAL STUDIO PROJECT TEMPLATE provides information about using theSDK project template. Appendix C, DESCRIPTION OF INTELLIGENT DOCUMENT CAPTURE FORMAT provides IntelligentDocument Capture output information. Appendix D, CORESCANNER DEBUG LOGGING provides information about enabling debug logging.

xZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDENotational ConventionsThe following conventions are used in this document: Courier New font is used for code segments. Italics are used to highlight: Chapters and sections in this and related documents Dialog box, window and screen names Drop-down list and list box names Screen field names Check box and radio button names File names Directory names. Bold text is used to highlight: Parameter and option names Icons on a screen Key names on a keypad Button names on a screen. bullets ( ) indicate: Action items Lists of alternatives Lists of required steps that are not necessarily sequential Sequential lists (e.g., those that describe step-by-step procedures) appear as numbered lists. Notes, caution and warning statements appear as follows:NOTEThis symbol indicates something of special interest or importance to the reader. Failure to read the notedoes not result in physical harm to the reader, equipment or data.CAUTIONWARNING!This symbol indicates that if this information is ignored, the possibility of data or material damage mayoccur.This symbol indicates that if this information is ignored the possibility that serious personalinjury may occur.Service InformationIf you have a problem using the equipment, contact your facility's technical or systems support. If there is aproblem with the equipment, they will contact the Zebra Technologies Global Customer Support Center at:www.zebra.com/support.

CHAPTER 1 INTRODUCTION TO THESCANNER SDKOverviewThe Zebra Scanner Software Developer Kit (SDK) defines an architectural framework providing a singleprogramming interface across multiple programming languages (such as MS .NET, C , Java) and acrossmultiple system environments (such as Vista, Linux) for all scanners communication variants (such as IBMHID,SNAPI, HIDKB, Nixdorf Mode B, etc.).The Zebra Scanner SDK includes a suite of components that provides a unified software developmentframework with a wide range of functions for interfacing Zebra scanners to user applications and solutions.With this SDK you can read barcodes, manage scanner configurations, capture images/videos and selectivelychoose a list of scanners on which to work. While one application is in one programming language using ascanner or a set of scanners, another application in a different language can be used differently within thesame system environment.For a list of the most commonly requested topics within this guide, see Quick Startup in the back of the guide.Figure 1-1 Software Developer FrameworkThe SDK can build an application with complete control of its scanner's capabilities. Data, Barcode Simulation HID Keyboard output OPOS/JPOS output SNAPI output

1-2ZEBRA SCANNER SDK FOR WINDOWS DEVELOPER’S GUIDE Command and Control LED and Beeper Control Aim Control Imaging Capture/Transfer of images Capture/Transfer of Video Remote Scanner Management Asset Tracking Device Configuration (Get, Set and Store scanner attributes) Firmware Upgrade Scanner Communication Protocol Switching Service to Automate Configuration/Firmware Upgrade Process.NOTEFor a list of a scanner's supported attribute (parameter) numbers and definitions, refer to the ProductReference Guide for that model scanner, available from the Zebra Support website athttp://www.zebra.com/support. Attributes include configuration parameters, monitored data, and assettracking information.

INTRODUCTION TO THE SCANNER SDKQuick StartupOverview . 1-1Operating systems/System requirements . 2-2Scanner model vs. Communication modes. 1-6, 2-3Block diagram of system . 1-5SDK Components & Installation details . 2-1, 2-3Components and folder paths . 2-2, 2-8Validate SDK installed properly . 2-14, 4-7OPOS/JPOS Drivers .2-1, 2-2, 2-6WMI/Remote Scanner Management.2-2, 2-3, 2-6, 2-8Test and sample utilities . 4-2Table of buttons and input fields. 4-4List of utility functionality . 4-2Bar code Data Display .A-13, A-12, 4-10, 4-10One application connected to two scanners . 1-9Simulated HID Keyboard Output . 1-6, 2-11, 4-4, 4-11Discovery . 4-8Querying asset information . A-10, 4-8, 4-17, 4-19Query and Set Parameters/AttributesQuery values.4-17, 4-19, 4-19Set Value (Device Configuration). 3-17, 4-21Programming an ADF rule. 4-19, 4-23LED

Zebra Scanner SDK's software components using the test utilities provided in the SDK. Chapter 5, SAMPLE SOURCE CODE provides information about how a developer uses the Zebra Scanner SDK. Appendix A, WRITE SIMPLE APPLICATIONS USING THE SCANNER SDK API provides a step by step guide to writing simple applications using CoreScanner APIs.