Test Utilities and Source Code

Overview

This chapter provides information for evaluating Zebra Scanner SDK software components using the SDK test utilities.

NOTE For supported scanner attributes (parameters), refer to the scanner Product Reference Guide. This guide may also contain an appendix listing non-parameter attributes that most Zebra scanners support.


Install Verifier Application (IVA) Utility

The Zebra Scanner SDK versions 4.0 and later provide the Install Verifier Application (IVA) utility, a self-installable source tarball package that verifies the CoreScanner and SDK utilities are installed and working properly.

After installing the CoreScanner and SDK packages on a Linux distribution, the IVA application performs the following checks:

  • CoreScanner and SDK package installation status using the standard package manager program or Linux commands.
  • File-by-file check on installed files.
  • Verify generic actions/behaviors of CoreScanner. Check cscore daemon to ensure systemd or systemv daemon is working properly, and ensure that operations (service controlling commands such like start, stop, restart, and status) on cscore daemon are working properly.
  • Ability to test basic CoreScanner commands and events.
  • Installation and environment setup for CoreScanner and JPOS test tools.

IVA execution generates a summary report containing the status of these verification tests.


IVA Outcome

The utility executes in a predefined order and generates a text report indicating the status of the test. This report verifies that driver installation is successful and working as expected.

Following is a section of a sample output report:


===========================================================
Zebra Technologies Corescanner Driver Install Verifier App
===========================================================
Install verifier app started: [08122016_03:32:56]
- - - - - - - - - - - - - - - - - - - - - - -
You are running root..................................................................[ SUCCESS ]
- - - - - - - - - - - - - - - - - - - - - - -
Found RPM based package manager in your system.
Found Debain based package manager in your system.
zebra-scanner-corescanner package......................................[ FOUND ]
zebra-scanner-devel package.................................................[ FOUND ]
zebra-scanner-javapos package..............................................[ FOUND ]
...


Installing the IVA

To install the IVA utility:

  1. Place install-verifier-app.tar.gz into the selected directory using the cp command or the system GUI.
  2. Extract install-verifier-app.tar.gz using the tar command or the system GUI.

    
    $> tar -xvf install-verifier-app.tar.gz
    
    
  3. Open a terminal window. Change the directory to install-verifier-app and build the source. The zebra-install-verifier executable file is now available in the directory.

    
    $> make
    g++ -c main.cpp -o main.o -I/usr/share/include/zebra-scanner
    g++ -c pugixml.cpp -o pugixml.o -I/usr/include/zebra-scanner
    g++ -c xml_formatter.cpp -o xml_formatter.o -I/usr/include/zebra-scanner
    g++ -o zebra-install-verifier main.o pugixml.o xml_formatter.o -L/usr/share/zebra-scanner/corescanner/
    -lcs-client
    
    

Execute the zebra-install-verifier using the command line interface.

Executing the IVA

The auto_run.sh script is available in the same directory as zebra-install-verifier. Ensure you have root permission to execute the script.


$> sh auto_run.sh

The tool runs initial commands in the background and displays the status on the console/terminal window. Use the self-help menu to choose the test case and the execution steps.


Sample menu from the app:
==============================================================
==1.: Continue to next test after the PNP event.
==2.: Skip to next test.
==0.: Exit.
==============================================================

Continue to test and verify CoreScanner installation using this menu. Applications refresh at the end of each verification entry.

IVA verifies the following:

  • Status of CoreScanner and SDK installation (RPM/Debian package and source tarball installation)
  • CoreScanner daemon is working properly
  • CoreScanner command GetScanner
  • PNP events
  • Barcode scanning events
  • CoreScanner Command: RSM Get All Attributes
  • CoreScanner Command: RSM Get Attribute
  • CoreScanner Command: Execute an action attribute (beep, LED ON/OFF)
  • SNAPI Imaging with pull trigger and release trigger
  • SNAPI direct commands: AIM ON/OFF

Test Utilities

The Zebra Scanner SDK includes the following test utilities that demonstrate SDK functionality to help you gain an understanding of the Zebra Scanner SDK.

  • Zebra Scanner SDK C++ GUI Demonstration Application, GTK
  • Zebra Scanner SDK C++ Console Sample Application, Commandline (see Chapter 5, SAMPLE SOURCE CODE)

NOTE You may need to install all dependent packages before installing the CoreScanner.

The Zebra Scanner SDK test utilities support the following functionality:

  • Discovery of asset tracking information
  • Barcode scanning
  • Image and video capture
  • Attribute query and setting
  • Host variant switching
  • Firmware upgrade.

Scanner SDK C++ GTK-based Sample Application

The Scanner SDK C++ Sample Application demonstrates SDK functionality by simulating an application that communicates with the Scanner SDK. It includes C++ source code and solution and project files for further reference.



Verifying Scanner SDK Functionality

This section provides test cases to demonstrate Zebra Scanner SDK functionality. See Installing the CoreScanner and SDK for more information.

Scanner Discovery / Asset Tracking / Successful SDK Installation Validation

  1. Connect a Zebra USB scanner(s) to the host computer.
  2. Scan one of the following barcodes to place the scanner in USB Hand-held or USB SNAPI mode.

    USB (IBM Hand-Held)
    Symbol Native API (SNAPI) with Imaging Interface
  3. Launch the Zebra Scanner SDK Sample Utility on the host computer.


  4. Use the change directory (cd) command to change to the /usr/share/zebra-scanner/samples/gui-app directory and run the corescanner-gui-app executable file.
  5. Click Discover Scanners to display all connected scanners. This executes an Open for all types of scanners and an ExecCommand with the REGISTER_FOR_EVENTS method using the following XML and a GetScanners API call:

    
    <inArgs>
        <cmdArgs>
            <arg-int>6</arg-int>
            <arg-int>1,2,4,8,16,32</arg-int>
        </cmdArgs>
    </inArgs>
    
    

NOTE The first <inArgs> tag in the XML contains the number of events to register, in this example, 6. The second <arg-int> tag contains the event IDs to register separated by commas (",").

Table Supported Event IDs

Event Name Event ID
SUBSCRIBE_BARCODE 1
SUBSCRIBE_IMAGE 2
SUBSCRIBE_VIDEO 4
SUBSCRIBE_RMD 8
SUBSCRIBE_PNP 16
SUBSCRIBE_OTHER 32

The GetScanners API call produces the following XML code:


<?xml version="1.0" encoding="UTF-8" ?>
    <scanners>
        <scanner type="SNAPI">
            <scannerID>1</scannerID>
            <serialnumber>7116000501003</serialnumber>
            <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
            <VID>1504</VID>
            <PID>6400</PID>
            <modelnumber>DS670-SR20001ZZR</modelnumber>
            <DoM>27APR07</DoM>
            <firmware>NBRPUAAC</firmware>
        </scanner>
    </scanners>

Table GetScanners Output For This Example

Scanner Information Value Description
Scanner ID 1 A unique ID that the SDK assigns to a scanner. Any scanner specific method executed via ExecCommand must point to this.
Serial Number 7116000501003 Device serial number printed on the label.
Model Number DS670-SR20001ZZR Device model number.
Date of Manufacture 27APR07 Device date of manufacture.
Firmware Version NBRPUAAC Current firmware version.
H/W GUID A2E647DED2163545B18BCEBD0A2A133D Hardware Unique ID.

The XML consists of the scanner type, scanner ID, serial number, GUID, VID, PID, model number, date of manufacture, and firmware version of the connected scanners.

The Connected Scanners list displays all discovered scanners by processing the XML from the GetScanners command along with asset tracking information returned by querying device parameters. This information indicates the SDK was installed successfully.


Barcode Scanning

Connect and discover a scanner. See Verifying Scanner SDK Functionality

Scanning a barcode returns decoded data as XML on the Barcode tab. To illustrate the implementation, the sample application displays only the barcode data below the XML data.


Example

Scan the following barcode after discovering the scanner in the sample application.

UPC-A

This returns the following XML:


<?xml version="1.0" encoding="UTF-8" ?>
<outArgs>
    <scannerID>2</scannerID>
    <arg-xml>
        <scandata>
            <modelnumber>DS670-SR20001ZZR</modelnumber>
            <serialnumber>7116000501003</serialnumber>
            <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
            <datatype>8</datatype>
            <datalabel>0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x31 0x32</datalabel>
            <rawdata>0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x31 0x32</rawdata>
        </scandata>
    </arg-xml>
</outArgs>                                                                    

The sample application processes this XML and displays the decoded barcode in the Decoded Barcode text box, and the symbology in the Symbology text box.

Image and Video Capture

  1. Connect and discover an imaging scanner. See Verifying Scanner SDK Functionality
  2. Select a SNAPI mode scanner ID from the Select Scanner drop-down list. The selection appears in the Connected Scanners list.

    NOTE If no SNAPI scanner appears in the Connected Scanners list, connect an imaging scanner that supports image/video transfer. For a list if scanner models and their supported communication modes, refer to the Scanner SDK for Windows website: www.zebra.com/scannersdkforwindows.

    Alternatively, select the SNAPI mode scanner in the Connected Scanners area. The selected scanner's ID appears in the Select Scanner drop-down list.


  3. Select the Image & Video tab.
  4. Select an image type of JPG, TIFF, or BMP. This executes an ExecCommand API call using the ATTR_SET method and following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-xml>
                <attrib_list>
                    <attribute>
                        <id>304</id>
                        <datatype>B</datatype>
                        <value>4</value>
                    </attribute>
                </attrib_list>
            </arg-xml>
        </cmdArgs>
    </inArgs>      
    
    

    NOTE The <scannerID> tag in the XML contains the scanner ID selected in the Connected Scanners list. The <id> tag contains the image file type parameter of the selected scanner, in this example, 304. The value 4 indicates the image type the user gets from the scanner. See following table.

    Table Image Types

    Image Type Value
    BMP_FILE_SELECTION 3
    TIFF_FILE_SELECTION 4
    JPEG_FILE_SELECTION 1

    NOTE These values may vary by scanner model. Refer to the scanner Product Reference Guide for information on scanner parameters.

  5. Check Enable Video View Finder. This executes an ExecCommand API call with the ATTR_SET method and the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-xml>
                <attrib_list>
                    <attribute>
                        <id>324</id>
                        <datatype>B</datatype>
                        <value>1</value>
                    </attribute>
                </attrib_list>
            </arg-xml>
        </cmdArgs>
    </inArgs>                                                                            
    
    

    NOTE The <scannerID> tag in the XML contains the ID of the scanner selected in the Connected Scanners list. The <id> tag contains the video view finder parameter number of the scanner and value 1 indicates that the view finder is enabled. A value 0 indicates the view finder is disabled.

  6. Click either Image to put the scanner into image capture mode or Video to put the scanner into video capture mode. This executes an ExecCommand API call using the DEVICE_CAPTURE_IMAGE method for Image, or DEVICE_CAPTURE_VIDEO method for Video, with the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
    </inArgs>                                                                                    
    
    
  7. Click Pull Trigger on the bottom left side of the utility. The scanner captures an image if in image capture mode, or begins video capture if in video capture mode. Click Release Trigger to stop video capture.

    Clicking Pull Trigger or Release Trigger executes an ExecCommand API call using the corresponding DEVICE_PULL_TRIGGER or DEVICE_RELEASE_TRIGGER method with the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
    </inArgs>                                                                                    
    
    

    NOTE You can use the trigger on the scanner to start and stop image or video capture instead of the soft trigger buttons provided in the sample utility.


    If you registered with ImageEvent you receive an image event for the pull trigger when in image mode. If you registered with VideoEvent you receive a video event for the pull trigger when in video mode.

Beep the Beeper

Zebra scanners sound the beeper when the host system invokes the Beeper method.

  1. Connect and discover a scanner. See Verifying Scanner SDK Functionality
  2. Select a SNAPI or IBM mode scanner ID from the Select Scanner drop-down list. The selection appears in the Connected Scanners list.
  3. On the Actions tab, select the beep sequence.


  4. Click Beep to execute an ExecCommand API call with the SET_ACTION method and following XML code:

                                                                        
                                                                                <inArgs>
                                                                                <scannerID>1</scannerID>
                                                                                <cmdArgs>
                                                                                <arg-int>2</arg-int>
                                                                                </cmdArgs>
                                                                                </inArgs>                                
                                                                        
                                                                        

    NOTE The <scannerID> tag in the XML contains the scanner ID selected in the Connected Scanners list. The <arg-int> tag in the XML contains the beep value selected in the Beeper drop-down list.

Flash the LED

Zebra scanners flash an LED when the host system initiates the flash LED method.

  1. Connect and discover a scanner. See Verifying Scanner SDK Functionality
  2. Select a SNAPI or OPOS/IBM OPOS mode scanner ID from the Select Scanner drop-down list. The selection appears in the Connected Scanners list.
  3. On the Actions tab, select the desired LED.


  4. Click On to execute an ExecCommand API call with the SET_ACTION method and the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-int>43</arg-int>
        </cmdArgs>
    </inArgs>                                                                                                                                                                  
    
    

    NOTE The <scannerID> tag in the XML contains the scanner ID selected in the Connected Scanners list. The <arg-int> tag in the XML contains the corresponding action value to turn on or off the LED selected from the drop-down list.

    To control the LED, change the action value in the <arg-int> tag.

    Click Off to execute an ExecCommand API call using the DEVICE_LED_OFF method with the same XML code that turned it on.

    NOTE The Beep the Beeper and Flash the LED XML code examples are the same except for the method name. All XML used in an ExecCommand API call has a common format. The </inArgs> tag always contains the <scannerID> tag and optionally contains <cmdArgs> tags and <arg-xml> tags inside the </inArgs> tag. <cmdArgs> can contain <arg-string>, <arg-bool>, and <arg-int> tags. Execute different commands for the same XML by changing the method parameter in ExecCommand.

Attribute and Parameter Query

To query parameters from a specific device, such as the Date of Manufacture and Firmware Version:

  1. Connect and discover a scanner. See Verifying Scanner SDK Functionality
  2. Select the scanner to query from the list of Connected Scanners.
  3. On the RSM tab, click Get All IDs to retrieve a list of all attribute IDs supported by the scanner. This executes an ExecCommand API call with the ATTR_GETALL method and the following XML:

    
    <inArgs>
        <scannerID>1</scannerID>
    </inArgs>                                  
    
    

    NOTE The <scannerID> tag in the XML contains the ID of the scanner selected in the Connected Scanners list

    The sample application receives the following XML output and displays the corresponding attribute IDs.

    
    <?xml version="1.0" encoding="UTF-8" ?>
    <outArgs>
        <scannerID>1</scannerID>
        <arg-xml>
            <modelnumber>DS670-SR20001ZZR</modelnumber>
            <serialnumber>7116000501003</serialnumber>
            <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
            <response>
                <opcode>5000</opcode>
                <attrib_list>
                    <attribute name="">0</attribute>
                    <attribute name="">1</attribute>
                    <attribute name="">2</attribute>
                    <attribute name="">3</attribute>
                    <attribute name="">4</attribute>
                    <attribute name="">5</attribute>
                    <attribute name="">6</attribute>
                    <attribute name="">7</attribute>
                    <attribute name="">8</attribute>
                    <attribute name="">9</attribute>
                    <attribute name="">10</attribute>
                    <attribute name="">11</attribute>
                    <attribute name="">12</attribute>
                    <attribute name="">13</attribute>
                    <attribute name="">14</attribute>
                    <attribute name="">15</attribute>
                    <attribute name="">16</attribute>
                    <attribute name="">17</attribute>
                    <attribute name="">18</attribute>
                    <attribute name="">19</attribute>
                    <attribute name="">20</attribute>
                    <attribute name="">21</attribute>
                    <attribute name="">22</attribute>
                    <attribute name="">23</attribute>
                    <attribute name="">24</attribute>
                    <attribute name="">25</attribute>
                    <attribute name="">26</attribute>
                    <attribute name="">27</attribute>
                    <attribute name="">28</attribute>
                    <attribute name="">29</attribute>
                    <attribute name="">30</attribute>
                    <attribute name="">31</attribute>
                    <attribute name="">34</attribute>
                    <attribute name="">35</attribute>
                    <attribute name="">36</attribute>
                    <attribute name="">37</attribute>
                    <attribute name="">38</attribute>
                    <attribute name="">39</attribute>
                    <attribute name="">655</attribute>
                    <attribute name="">656</attribute>
                    <attribute name="">657</attribute>
                    <attribute name="">658</attribute>
                    <attribute name="">659</attribute>
                    <attribute name="">665</attribute>
                    <attribute name="">670</attribute>
                    <attribute name="">672</attribute>
                    <attribute name="">673</attribute>
                    <attribute name="">705</attribute>
                    <attribute name="">716</attribute>
                    <attribute name="">718</attribute>
                    <attribute name="">721</attribute>
                    <attribute name="">724</attribute>
                    <attribute name="">726</attribute>
                    <attribute name="">727</attribute>
                    <attribute name="">728</attribute>
                    <attribute name="">730</attribute>
                    <attribute name="">731</attribute>
                    <attribute name="">734</attribute>
                    <attribute name="">735</attribute>
                    <attribute name="">745</attribute>
                    <attribute name="">6000</attribute>
                    <attribute name="">6001</attribute>
                    <attribute name="">6002</attribute>
                    <attribute name="">6003</attribute>
                    <attribute name="">6004</attribute>
                    <attribute name="">20004</attribute>
                    <attribute name="">20006</attribute>
                    <attribute name="">20007</attribute>
                    <attribute name="">20008</attribute>
                    <attribute name="">20009</attribute>
                    <attribute name="">20010</attribute>
                    <attribute name="">20011</attribute>
                    <attribute name="">20013</attribute>
                </attrib_list>
            </response>
        </arg-xml>
    </outArgs>
    
    

    NOTE To find the corresponding attribute names, refer to the scanner Product Reference Guide, available on the Zebra Support website. Attributes include configuration parameters, monitored data, and asset tracking information.


Querying Specific Attributes

To query attributes, select attribute IDs and click Get Value. This executes an ExecCommand API call with the ATTR_GET method and the following XML.


<inArgs>
    <cmdArgs>
        <scannerID>1</scannerID>
        <arg-xml>
            <attrib_list>535,20004,1,140,392</attrib_list>
        </arg-xml>
    </cmdArgs>
</inArgs>

note The <scannerID> tag in the XML contains the ID of the scanner selected in the Connected Scanners list and the <attrib_list> tag with the attribute IDs selected on the RSM tab.

For example, to retrieve the values of the Date of Manufacture, Firmware Version, UPC -A status, Beeper Volume, and ADF Rule parameters, select these attribute IDs and click Get Value. This executes an ExecCommand API call with the ATTR_GET method and the XML shown above. See the following table for the corresponding IDs

Table Device Parameters to Query

Parameter Attribute #
Date of Manufacture 535
Firmware Version 20004
UPC A status 1
Beeper Volume 140
ADF Rule 392

After a successful command, the output XML appears in the Logs tab as follows:


<?xml version="1.0" encoding="UTF-8" ?>
<outArgs>
    <scannerID>1</scannerID>
    <arg-xml>
        <modelnumber>DS670-SR20001ZZR</modelnumber>
        <serialnumber>7116000501003</serialnumber>
        <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
        <response>
            <opcode>5001</opcode>
            <attrib_list>
                <attribute>
                    <id>535</id>
                    <name></name>
                    <datatype>S</datatype>
                    <permission>R</permission>
                    <value>27APR07</value>
                    </attribute>
                    <attribute>
                    <id>20004</id>
                    <name></name>
                    <datatype>S</datatype>
                    <permission>R</permission>
                    <value>DS6707X4</value>
                    </attribute>
                    <attribute>
                    <id>1</id>
                    <name></name>
                    <datatype>F</datatype>
                    <permission>RWP</permission>
                    <value>True</value>
                    </attribute>
                    <attribute>
                    <id>140</id>
                    <name></name>
                    <datatype>B</datatype>
                    <permission>RWP</permission>
                    <value>0</value>
                    </attribute>
                    <attribute>
                    <id>392</id>
                    <name></name>
                    <datatype>A</datatype>
                    <permission>RWP</permission>
                    <value>0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00</value>
                </attribute>
            </attrib_list>
        </response>
    </arg-xml>
</outArgs>

The sample application processes this XML and displays the output on the RSM tab.


Parameter Setting (Device Configuration)

To set parameters of a specific device, such as UPC-A status or beeper volume:

  1. Query the parameter. See Attribute and Parameter Query
  2. To set an attribute, select and edit the attribute value in the RSM window.
  3. Select the row of the updated attribute and click Set Value or Store Value. This executes an ExecCommand API call using the ATTR_SET or ATTR_STORE method and the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-xml>
                <attrib_list>
                    <attribute>
                        <id>1</id>
                        <datatype>F</datatype>
                        <value>False</value>
                    </attribute>
                </attrib_list>
            </arg-xml>
        </cmdArgs>
    </inArgs>                                                                                    
    
    

NOTE The <scannerID> tag in the XML contains the ID of the scanner selected in the Connected Scanners list and the <attrib_list> tag contains the <attribute> tags selected on the RSM tab.

Examples

The following examples demonstrate how to enable or disable a symbology, program an ADF rule, control beeper volume, and control LEDs.

Before starting an example, scan the Set All Defaults barcode to return all parameters to default values (replacing the scanner's current settings). Refer to the scanner Product Reference Guide for default values.

Set All Defaults

Enable / Disable a Symbology

To disable a symbology, refer to the scanner Product Reference Guide to determine the attribute ID. The attribute ID of the UPC-A parameter is 1. To change and validate the setting:

  1. Put the scanner into USB OPOS (Hand-held) or USB SNAPI mode by scanning one of the barcodes in Scanner Discovery / Asset Tracking / Successful SDK Installation Validation, or using the procedure in Host Variant Switching.

  2. Get the value of attribute ID 1, which is TRUE if you scanned the Set All Defaults barcode.
  3. To disable UPC-A, change the value of attribute ID 1 to FALSE on the RSM tab, and click Set Value or Store Value. This executes an ExecCommand API call with the ATTR_SET or ATTR_STORE method and the XML shown in Parameter Setting.

If the command was successful, the scanner cannot scan the following UPC-A barcode.

UPC-A

Program an ADF Rule

To create an ADF rule to add the prefix "A" to any barcode and an Enter key after, modify the scanner ADF buffer. The attribute ID of the ADF rule is 392.

To change and validate the setting:


USB Host Type = HID Keyboard Wedge

  1. Scan the following barcode, or see Host Variant Switching, to switch the scanner to HID keyboard mode. This enables the scanner to send data to any text editor

    USB Keyboard HID
  2. Open a text editor such as Windows Notepad.
  3. Scan the Sample UPC-A Barcode with the text editor as the active window to insert the barcode data "012345678912" in the window.
  4. Put the scanner into USB OPOS (Hand-held) or USB SNAPI mode by scanning one of the barcodes in Scanner Discovery / Asset Tracking / Successful SDK Installation Validation, or using the procedure in Host Variant Switching
  5. In the sample application, change the value of the selected scanner's attribute 392 to: 0x01 0x0C 0x11 0xF4 0x14 0x10 0x47 0x0D
  6. Click Store Value. The sample application executes an ExecCommand API call using the ATTR_STORE method and the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-xml>
                <attrib_list>
                    <attribute>
                        <id>392</id>
                        <datatype>A</datatype>
                        <value>0x01 0x0C 0x11 0xF4 0x14 0x10 0x47 0x0D</value>
                    </attribute>
                </attrib_list>
            </arg-xml>
        </cmdArgs>
    </inArgs>
    
    
  7. After successfully executing the command, repeat steps 1 - 3.

The text entered in Notepad is "A012345678912<Enter key>".

Beeper Volume Control

The beeper volume attribute ID is 140, and the scanner beeper has three volume levels:

  • 2 = Low
  • 1 = Medium
  • 0 = High

To change and validate this setting:

  1. Put the scanner into USB OPOS (Hand-held) or USB SNAPI mode by scanning one of the barcodes in Scanner Discovery / Asset Tracking / Successful SDK Installation Validation, or using the procedure in Host Variant Switching.
  2. Scan the Sample UPC-A Barcode and listen to the beeper
  3. Select attribute ID 140 from the RSM attribute grid. Its value is 0 if you scanned the Set All Defaults barcode at the beginning of the example.
  4. Change the value to 2 and click Set Value or Store Value. The sample application executes an ExecCommand API call with the ATTR_SET or ATTR_STORE method and the following XML code:

    
    <inArgs>
        <scannerID>1</scannerID>
        <cmdArgs>
            <arg-xml>
                <attrib_list>
                    <attribute>
                        <id>140</id>
                        <datatype>B</datatype>
                        <value>2</value>
                    </attribute>
                </attrib_list>
            </arg-xml>
        </cmdArgs>
    </inArgs>
    
    
  5. Scan the Sample UPC-A Barcode again. The beeper volume is lower if the command was successful.

NOTE Changes made using the Store Value commands are permanent, persisting over power down and power up cycles. Changes made using the Set Value command are temporary and are discarded after the next power down.

Beeper and LED Control

Attribute ID for beeper and LED control is 6000. To change and validate this setting:

  1. Put the scanner into USB OPOS (Hand-held) or USB SNAPI mode by scanning one of the barcodes in Scanner Discovery / Asset Tracking / Successful SDK Installation Validation, or using the procedure in Host Variant Switching.
  2. To turn on the scanner LED, execute an ExecCommand API call with the ATTR_SET or ATTR_STORE method and the following XML code:

    
    <inArgs>
    <scannerID>1</scannerID>
    <cmdArgs>
    <arg-xml>
    <attrib_list>
    <attribute>
    <id>6000</id>
    <datatype>X</datatype>
    <value>43</value>
    </attribute>
    </attrib_list>
    </arg-xml>
    </cmdArgs>
    </inArgs>                                                                        
    
    

NOTE You can execute several actions by changing the tag in this XML. For example, to turn off the LED, change the value to 42; to beep the beeper, change the value to an integer between 0 and 25.

Host Variant Switching

  1. Connect and discover a scanner. See Scanner Discovery / Asset Tracking / Successful SDK Installation Validation.
  2. On the Actions tab, select a target mode from the Switch Host Variant drop-down list.
  3. If desired, select Permanent Change or Silent Reboot options (hidden by the Switch Host Variant drop-down list).


  4. Click Switch Host Mode to reboot the scanner and set the target mode. This executes an ExecCommand API call with the DEVICE_SWITCH_HOST_MODE method and the following XML code:

    
    <inArgs>
    <scannerID>1</scannerID>
    <cmdArgs>
    <arg-string>XUA-45001-1</arg-string>
    <arg-bool>TRUE</arg-bool>
    <arg-bool>FALSE</arg-bool>
    </cmdArgs>
    </inArgs>
    
    

    NOTE The <scannerID> tag in the XML code contains the ID of the scanner selected in the Connected Scanners list. The <arg-string> tag contains the string code of the selected target host variant.

    NOTE The first <arg-bool> tag contains the boolean value for the silent reboot option. A value of TRUE silently reboots the scanner (without reboot beeps). The second <arg-bool> tag contains the boolean value for the permanent change option. A value of TRUE persists the target host variant over power down and power up cycles. Otherwise the host variant change is temporary until the next reboot.

HID Keyboard mode only supports the IBM Hand-held USB and SNAPI host variants.

Firmware Upgrade

Firmware Upgrade Scenarios

There are three firmware upgrade scenarios.

Loading a compatible, different version of firmware to the scanner

Firmware upgrade downloads the firmware file to the scanner and activates the firmware. Activation takes approximately 50 seconds, during which the LED blinks red and the scanner does not respond to network queries.

When activation (programming) completes, the scanner reboots. The LED turns off, the scanner emits a power up beep, and powers up with the new firmware.

A firmware download can take up to 20 minutes depending on the connection speed between the POS terminal and the scanner, the operating mode of the scanner, and the size of the firmware file.

Loading the same version of firmware that is on the scanner

A firmware file can include multiple components. When loading the same version of firmware, some components in the firmware file may be the same as those on the scanner, while other components are different.

Before loading firmware, the scanner driver reads the header information of each firmware component to validate the model number and version, and only loads components that are different on the scanner. For example, if the first component downloading from the firmware file is the same version as one already on the scanner, the component does not load.

Loading an incompatible version of firmware on the scanner

This occurs when attempting to load firmware designed for one scanner model, for example a DS6707, onto another incompatible scanner model, for example the DS6708.

A firmware file can include multiple components. Before downloading firmware to the scanner, the scanner driver reads the header information of each firmware component to validate the model number and version. If the firmware component model number does not match the scanner, the component does not load. This process continues, verifying each remaining component in the firmware file.

Firmware Upgrade Procedure

  1. Connect and discover a scanner. See Scanner Discovery / Asset Tracking / Successful SDK Installation Validation.
  2. Use 123Scan to obtain the latest scanner plug-in which contains the firmware .DAT file.

    1. Download and launch 123Scan from www.zebra.com/123Scan
    2. Using 123Scan, confirm you have the latest scanner plug-in, which contains a number of files including the firmware file and release notes.

      • To download the latest scanner plug-ins from within 123Scan2, on the help menu, select Check for updates.
      • For a list of scanner models, plug-ins, and firmware files supported in 123Scan2 on the help menu, select Supported scanners and plug-ins.
      • The plug-ins are located in one of the following 123Scan2 sub folders:

      For Windows XP systems: [WINDOWSDRIVE]\ Documents and Settings\ [USERNAME]\Application Data\123Scan2\Plug-ins

      For later versions of Windows: [WINDOWSDRIVE]\Users\ Application Data\123Scan2\Plug-ins

  3. Extract the firmware .DAT file from 123Scan plug-in:

    1. Rename the file extension of the plug-in from .SCNPLG to .ZIP
    2. Use a standard archive tool, such as WinZip, to extract the firmware update file which contains the file extension .DAT

    For example, the DS9808 plug-in is named DS9808-COMMON SR MODELS-S-017.SCNPLG. Change .SCNPLG to .ZIP and access the firmware file CAAABS00-006-R02D0.DAT using WinZip.

  4. In the sample application, select the Advanced tab and browse to and select the firmware .DAT file.
  5. Check the Bulk Update option if desired.

    NOTE There are two communication interfaces (channels), USB HID or the faster USB Bulk, to perform a firmware update. Most SNAPI devices support USB Bulk firmware update but some do not. To determine if your scanner supports USB Bulk mode, refer to the Scanner SDK for Windows website: www.zebra.com/scannersdkforwindows.

  6. Click Update to transfer the firmware file to the scanner. This executes an ExecCommand API call with the UPDATE_FIRMWARE method and the following XML code:

    
    <inArgs>
    <scannerID>1</scannerID>
    <cmdArgs>
    <arg-string>D:\scanner\ScannerFW\DS6707\DS6707X4.DAT</arg-string>
    <arg-int>2</arg-int>
    </cmdArgs>
    </inArgs>
    
    

    NOTE The <scannerID> tag in the XML contains the ID of the scanner selected in the Connected Scanners list. The <arg-string> tag contains the path to the firmware file. The <arg-int> tag contains 2 if the bulk update option is selected, or 1 if not.

  7. If you have registered with ScanRMDEvent, you receive six types of events per firmware update cycle, shown in table below.

    Table Firmware Update Event Types

    Event Value Event Type Description
    11 SCANNER_UF_SESS_START Triggered when flash download session starts
    12 SCANNER_UF_DL_START Triggered when component download starts
    13 SCANNER_UF_DL_PROGRESS Triggered when block(s) of flash completed
    14 SCANNER_UF_DL_END Triggered when component download ends
    15 SCANNER_UF_SESS_END Triggered when flash download session ends
    16 SCANNER_UF_STATUS Triggered when update error or status

    The OnScanRMDEvent function has two parameters:

    • The first short type parameter contains the event type described above.
    • The second parameter contains an XML for the event types in table above. Processing the XML provides further information. The receiving XML formats for each event types are as follows, and include information about the scanner it updates.

    NOTE A firmware file can include multiple components. Before downloading firmware to the scanner, the scanner driver reads the header information of each firmware component to validate the model number and version. If the component model number does not match the scanner’s, the component does not load. This process verifies each component in the firmware file.

    1. SCANNER_UF_SESS_START

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <sess_start>
      <modelnumber>DS670-SR20001ZZR</modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <maxcount>3075</maxcount>
      <status>0</status>
      </sess_start>
      </arg-xml>
      </outArgs>
      
      

      NOTE The <maxcount> tag contains the number of records in the firmware file.

    2. SCANNER_UF_DL_START

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <dl_start>
      <modelnumber>DS670-SR20001ZZR</modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <software_component>0</software_component>
      <status>0</status>
      </dl_start>
      </arg-xml>
      </outArgs>
      
      

      NOTE The <software_component> tag contains the component number that starts downloading.

    3. SCANNER_UF_DL_PROGRESS

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <dl_progress>
      <modelnumber> DS670-SR20001ZZR </modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <software_component>1</software_component>
      <progress>7</progress>
      <status>600</status>
      </dl_progress>
      </arg-xml>
      </outArgs>
      
      

      NOTE The <progress> tag contains the record number that is currently downloading. The tag contains the record of the download progress. 600 indicates the resident firmware.

    4. SCANNER_UF_DL_END

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <dl_end>
      <modelnumber> DS670-SR20001ZZR </modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <software_component>2</software_component>
      <size>0</size>
      <status>0</status>
      </dl_end>
      </arg-xml>
      </outArgs>
      
      
    5. SCANNER_UF_SESS_END

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <sess_end>
      <modelnumber> DS670-SR20001ZZR </modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <status>0</status>
      </sess_end>
      </arg-xml>
      </outArgs>
      
      
    6. SCANNER_UF_STATUS

      
      <?xml version="1.0" encoding="UTF-8"?>
      <outArgs>
      <scannerID>1</scannerID>
      <arg-xml>
      <sess_info>
      <modelnumber> DS670-SR20001ZZR </modelnumber>
      <serialnumber>S/N:7108E15933CA1B4BB776F7BDB4B3F826</serialnumber>
      <GUID>7108E15933CA1B4BB776F7BDB4B3F826</GUID>
      <status>506</status>
      </sess_info>
      </arg-xml>
      </outArgs>
      
      
  8. After file transfer completes, click Launch to activate (program into the scanner) the new firmware. Activation takes approximately one minute, during which the scanner blinks the red LED, cannot scan barcodes, and does not respond to network queries. When activation completes, the scanner reboots and turns off the LED, and then emits a power up beep and restarts with the new firmware.