Software Development Kit (SDK) for 5080, 5180, and 5380
Decoded Miniature Image Scan Engines
User’s Guide
Disclaimer
Honeywell International Inc. (“HII”) reserves the right to make changes in specifications and other information contained in this document without prior notice, and the reader should in all cases consult HII to
determine whether any such changes have been made. The information in this publication does not represent a commitment on the part of HII.
HII shall not be liable for technical or editorial errors or omissions contained herein; nor for incidental or
consequential damages resulting from the furnishing, performance, or use of this material.
This document contains proprietary information that is protected by copyright. All rights are reserved.
No part of this document may be photocopied, reproduced, or translated into another language without
the prior written consent of HII.
Other product names or marks mentioned in this document may be trademarks or registered trademarks
of other companies and are the property of their respective owners.
Web Address: www.honeywellaidc.com
Table of Contents
Chapter 1 - Introduction
Features of the 5X00 Series ................................................................................................1-1
Target Operating Systems for the 5X00 Series ...................................................................1-1
The 5X10/5X80 Software Development Kit (5X00 Series) provides a set of libraries, tools, and sample source code to help software developers create an interface between their host system and a Honeywell miniature image scan engine. The 5X00 Series
consists of:
• The API Definition and Documentation
• API Libraries
• Sample Code
Features of the 5X00 Series
• The 5X00 Series contains software libraries that interact with image/data capture engines using a documented API
(Application Programming Interface). The API functions are defined on a higher level so they can be easily understood and
integrated into your applications, so you don’t have to learn minute details of the engine interface protocol. You simply compile
your code with the library header files and link in the library for your platform. Afterward, all engine functionality is at your
disposal.
• The image/data capture engine is easily integrated into a variety of host platforms.
• The 5X00 Series captures images and returns them as unformatted data, or as one of the standard file formats (BMP, TIFF,
and JPG). Captured images can then be saved to disk and easily imported into a variety of common tools and applications.
• A single API is used for all Honeywell decoding engines. The libraries for all engines are identical for a given host platform.
There are different libraries for each platform, but the API interface is the same for all of them, so you only need to learn a
single API.
• Libraries are available for the Microsoft
operating system, Windows
• Sample code is included that demonstrate how to use specific aspects of the 5X00 Series, as well as the buildable source
and executable code for a demo application.
• The communication driver library is separate from the main engine API library.
®
9x, and Windows NT® derivatives.
®
Windows® family of operating systems. This includes both the Windows® CE
Target Operating Systems for the 5X00 Series
The 5X00 Series is designed for use with the following operating systems:
•Windows
processors:
Pocket PC 2000ARM, MIPS, SH3
PocketPC 2002ARM
PocketPC 2003ARMV4
CE.Net Standard SDK ARMV4, ARMV4I, ARMV4T, SH3, SH4, X86
•Windows
®
CE versions WinCE 4.2, WinCE 5.0, Windows® Pocket PC 2000, and Pocket PC 2002 supporting the following
®
9x, Windows NT® 4.0, Windows® 2000 and Windows® XP
1 - 1
Interface Diagram
User Application
SDK Driver Interface Layer - hhpImgrSdk.dll
SDK API Interface Layer - commDrv.dll
OS Communications Driver
Physical Connection: RS-232, USB, etc.
Image Engine
SDK API Interface Layer - commDrv.dll
Physical Connection: RS-232, USB, etc.
The following diagram shows the interface between the 5X00 Series and the Image Engine:
5X00 Series Library Files
The SDK API and SDK communications layers are provided in the dynamic link libraries, hhpImgrSdk.dll and commDrv.dll,
respectively. The library link file hhpImgrSdk.lib and the include files hhpImgrSdk.h, hhpSymCfg.h and hhpImgrCfg.h are also
provided. In order to use the 5X00 Series, you must include hhpImgrSdk.h in any source files that call the SDK functions. The
library include files must be in the include path for the application’s project. This means that the files must either be in the
source file build directory, or in the developer’s Studio include path. Also, the library link file, hhpImgrSdk.lib, must be added to
the application project link list and link path. Since the .dll and .lib files are operating system and processor type dependent,
care must be taken to use the proper files for the chosen target environment.
SDK Library
File
commDrv.dll
hhpImgrSdk.dll
hhpImgrSdk.libProject Link Path
hhpSymCfg.hProject Include Path
hhpImgrCfg.hProject Include Path
hhpImgrSdk.hProject Include Path
OemDll.hProject Include Path
Where ResidesFunction
Target Device
Windows Folder
Target Device
Windows Folder
1 - 2
Sends commands from API to the appropriate OS driver. Handles low level
communications protocols.
Contains the exported SDK API. Formats requests into imager commands,
then calls commDrv layer.
Library exports file. Allows your application to link without actually including
the SDK code at link time.
Definitions, structures, and enumerated types related to symbology setup.
Automatically included when hhpImgrSdk.h is included.
Definitions, structures, and enumerated types for imaging as well as all
other imager configurations, except communications. Automatically
included when hhpImgrSdk.h is included.
Include file that must be included in application code. Contains definitions,
structures, and enumerated types for communication configuration, as well
as the SDK error codes and SDK function API prototypes.
Only necessary if you create a helper dll for the SDK to provide access to
the imager hardware sleep and trigger lines.
5X00 Series API Library Summary
The following is a summary of the API functions. The full description of each function is found on the page noted.
Core Functions
Core FunctionSummary
Page
Error Management Function
hhpGetErrorMessageReturns a descriptive text string for the specified SDK error code.2-4
Connection Functions
These functions open, close, and verify a connection to an imager.
hhpConnect
hhpDisconnectCloses down the open imager connection.2-3
hhpEngineConnectedChecks if the connection to the imager is valid.2-4
hhpNamedConnect
Establishes and initializes a connection to the imager at the specified port and
connection settings.
Establishes and initializes a connection to the imager at the specified driver
name and connection settings.
2-3
2-5
Asynchronous Notification and Control Functions
Image and barcode capture can be either blocking (synchronous) or non-blocking (asynchronous).
In blocking (synchronous) mode, the SDK function call does not return until the barcode or image is received, the request times
out, or an error occurs. In non-blocking (asynchronous) mode, the capture call returns immediately. Your application is notified
of the completion when either a barcode or an image was received, the time-out for the call was reached, or an error was detected.
You can specify which notification methods you wish to receive.
Your application can subscribe to one or more of the following notification methods: Windows Event, Windows Message, and/or
Callback Function. When notification is received, your application can call hhpGetAsyncResult (see page 2-4) to retrieve the
return code as well as the image, barcode, or text data. The asynchronous interface is also the manor in which imager-initiated
barcode capture data, such as from a hardware trigger, is returned.
There is also a cancel function (see hhpCancelIo on page 2-2) that allows you to cancel any ongoing operation. You should be
aware that when the callback function method is used, any processing done during the callback is run within the context of the
SDK’s asynchronous read thread. This means that the SDK is unable to receive images or barcodes until the callback returns.
hhpCancelIoCancels any synchronous or asynchronous I/O in process.1-3
hhpGetAsyncResult
hhpSetAsyncMethods
Retrieves the results (image/barcode, etc.) of an asynchronous
I/O event.
Allows the application to select how it wishes to be notified on completion of
an asynchronous I/O event.
2-4
2-10
Imaging and General Configuration Functions
The imaging and configuration functions provide a simplified API for modifying the imager setup, image/barcode capture
configuration, and symbology configuration. In order to limit the number of functions a developer must master, the design
philosophy is to allow configuration control using only a small number of setup functions. The imager configuration is broken down
into functional groups with structures containing the configurable items for each. Individual configuration items are specified within
structures by use of a bit field mask. In this way, single configuration items can be read or written using minimal communication
traffic. There are functions for reading and writing parts or all of the HHP_CONFIG imager configuration structure as well as
writing the setup/configuration for individual symbologies. If the specified symbology is not available in the imager’s version of
the symbol decoder, (e.g., Data Matrix in a linear and PDF417 decoder), the symbology functions return
RESULT_ERR_UNSUPPORTED. Finally, to facilitate easy configuration management from device to device and application to
application, the 5X00 Series also provides methods for retrieving and setting the whole imager configuration as a single stream
so it can be saved to disk and restored at a later time.
hhpReadConfigItem
hhpReadConfigStream
Retrieves a single configuration group or whole imager configuration from the
imager.
Retrieves the current whole imager configuration as a single buffer. This
buffer can be saved to a file and later restored.
2-6
2-7
1 - 3
Core Functions (Continued)
Core FunctionSummary
hhpReadImagerCapabilities
hhpReadEngineInfo
hhpSetConfigItemToDefaults
hhpWriteConfigItem
hhpWriteConfigStream
Retrieves the imager settings (fixed) for image size, image bit depth, and
maximum message length.
Reads information about the image engine contained in the image engine
PSOC.
Sets a selected symbology, or all symbology configurations, to their default
values.
Writes some or all of the configuration items for a single configuration group or
for all configuration groups, with the exception of version and communication
groups.
Writes an entire data stream of programmable parameters from a previous
call to hhpReadConfigStream.
Page
2-8
2-8
2-10
2-12
2-13
Symbology Configuration Functions
These functions allow you to read and set the symbology configurations.
hhpEnableDisableSymbologyEnables or disables a single symbology, or all symbologies.2-3
hhpReadSymbologyConfig
hhpReadSymbologyRangeMaxMinReturns the specified symbology range maximum and minimum values.2-9
hhpSetSymbologyDefaultsDefaults a single symbology, or all symbologies.2-11
hhpWriteSymbologyConfig
Retrieves the current or default symbology configuration for a specified
symbology, or for all symbologies.
Writes some or all of a single symbology, or all symbologies’ configuration
items.
2-8
2-14
Barcode Capture Functions
The 5X00 Series captures barcodes from imagers that have hardware triggers or some other non-SDK initiated barcode captures
without having to poll the imager to see if there is any data to read. This allows the imager to be put into low power mode without
having to wake up to answer the polling message.
All barcode result strings are returned in TCHAR arrays, which, if running on a WinCE device or if using a Unicode Desktop build,
are 2 bytes per character. You can specify a Unicode code page other than the default ANSI code page (CP_ACP).
Initiates a synchronous (wait for finish before returning from call) or
hhpCaptureBarcode
hhpSetBarcodeDataCodePage
hhpCaptureRawBarcode
asynchronous (return immediately) barcode capture. Decoded data returned
is translated by code page and locale.
Specifies the code page used to convert the barcode characters to Windows
text. The default is the ANSI code page.
Initiates a synchronous (wait for finish before returning from call) or
asynchronous (return immediately) barcode capture. Decoded data returned
is unmodified 8 bit (ASCII) data.
2-2
2-10
2-2
Image Capture Functions
The image capture functions provide both synchronous and asynchronous operation.
A synchronous capture is specified by setting the bWait parameter of hhpAcquireImage or hhpGetLastImage to TRUE. For
synchronous operation, the function will not return until an image has been captured and transferred (hhpAcquireImage), just
transferred (hhpGetLastImage), or an error has occurred.
Asynchronous captures are specified by setting bWait to FALSE. The function call returns immediately and the caller is notified
on request completion as long as at least one of the event notification methods has been enabled. You can receive transfer
progress updates by Windows messages or by providing a pointer to a DWORD. Both hhpAcquireImage and hhpGetLastImage
allow the caller to override the current imager transfer configuration in the imager.
Initiates a synchronous (wait for finish before returning from call) or
hhpAcquireImage
asynchronous (return immediately) image capture. The image acquisition and
transfer parameters can also be specified.
2-1
1 - 4
Core Functions (Continued)
Core FunctionSummary
Initiates transfer of the last image captured. (This includes images captured
hhpGetLastImage
during barcode scan.) The call can be made synchronously or
asynchronously, and the transfer parameters can be specified.
Page
2-4
Intelligent Imaging (Signature Capture) Functions
Intelligent imaging is barcode capture combined with an image window capture. The image window is cut from the same image
used to capture a barcode. This is how the SDK provides the ability to capture a signature associated with a barcode. In fact, a
successful barcode capture is required before the intelligent image window is sent by the imager. You can specify whether the
image is returned grayscale or black and white.
hhpAcquireIntelligentImageBarcode capture combined with an image window capture.2-1
hhpRawAcquireIntelligentImageCaptures portion of the image in which a barcode is decoded. 2-5
Miscellaneous Functions
hhpSendActionCommand
hhpSendMessageSends menu commands to the imager. 2-9
hhpUpgradeFirmwareUpgrades the current imager firmware with a new firmware file. 2-11
hhpSetHardwareLineDllFileName
Turns on illumination LEDs, Aimers, (and sound beeper for imagers that have
one) outside the image or barcode capture.
Allows you to specify the name of an OEM dll file. This file can contain some
or all of the OemDll exports that provide support for hardware trigger and low
power mode hardware lines.
2-9
2-11
Data Types, Structures, and Enumerated Types
The 5X00 Series API uses structures (see Structures and Mask Definitions beginning on page 4-1) and enumerated types (see
Enumerated Types and Definitions beginning on page 3-1) extensively . The definitions are in the include files in the 5X00
Series package. All 5X00 Series-specific structures have a dwStructSize member that must be set to sizeof( struct name ).
This insures that the structure being passed to a given function is the structure type expected by the function and, if writing is
done to the structure, that the structure size boundary is not exceeded. Furthermore, all imager configuration structures (except
the all inclusive structure HHP_CONFIG) have a DWORD member dwMask. The mask allows you to specify only certain members within a structure. Set the mask value by ORing together the appropriate masks for the given structure for the particular
items within the structure that should be read/written. Samples of programs that demonstrate this can be found in Program
Samples beginning on page 6-1. This technique is also used by Microsoft
®
dows
SDK structure CHARFORMAT).
The following Windows
Note:A “P” in front of a data type means a pointer to the type.
®
data types are included for clarity.
®
in their Windows® SDK (for example, see Win-
Windows Data Types
BOOL32 bit signed integer used by most Microsoft SDK functions in place of a true Boolean.
BYTE8 bit unsigned variable.
DWORD32 bit unsigned integer variable.
HANDLE
HWNDA Windows handle to an application window.
PVOID32 bit unsigned integer that points to void data type (generic pointer).
TCHAROS-dependent character variable. 16 bit for Unicode systems, otherwise 8 bits.
WORD16 bit unsigned integer variable.
A Windows WIN32 handle type. Returned from opening files, creating events, semaphores, or
mutexes.
1 - 5
Windows Data Types (Continued)
HHP_EVENT_CALLBACK
Pointer to a callback function (see hhpImgrSdk.h) called in response to the completion of an
asynchronous 5X00 Series function call or event. (See example on page 6-4.)
SDK Enumerated Types
Beep OptionsEnumeration (not an enumerated type) that can be used with an hhpSendActionCommand.
Compression_t
ConfigItems_t
DECODE_METHODEnumerated type of decode methods available to decode symbols.
DECODER_TYPEEnumeration of types of decoders and, by extension, what symbologies can be decoded.
EngineType_tDescribes the connection, the imager, and the type of engine.
FileFormat_tEnumerated type for specifying the format of the data returned in the HHP_IMAGE structure.
HP_ACTION
HHP_AIMER_MODESEnumerated type to specify the aimer mode.
HHP_AUTOEXPOSURE
HHP_BAUD_RATE
HHP_BEEPER_VOLUME
HHP_CONNECT_TYPE
HHP_DATA_BITSEnumerated type for number of serial data bits.
HHP_DUTY_CYCLE
HHP_EVENT_TYPEEnumerated type that describes the type of asynchronous event being reported.
HHP_FRAME_RATE
HHP_GAIN
HHP_PARITYEnumerated type for serial parity.
HHP_SEQ_MODESEnumerated type to specify the sequence acquisition mode.
HHP_STOP_BITSEnumerated type for number of serial stop bits.
HHP_SYS_SPEED
HHP_TRIG_MODESEnumerated type to specify the trigger mode.
OCRDirection_tEnumerated type for setting the text direction for OCR decoding.
OCRMode_tEnumerated type for setting the font for OCR symbology decoding.
On Off Enumeration (not an enumerated type) that can be used with hhpSendActionCommand.
Result_t
SetupType_t
Symbology ID enumeration
Enumerated type for specifying the form of compression (if any) to use when transferring an
image from the imager to the SDK. See Compression Mode Formats on page 3-4.
Enumerated type to specify that the configuration structure is being sent to the Read/Write
config item functions.
Enumerated type whose items describe which imager command functionality (beeper, aimers,
lights) is to be acted upon.
Enumerated type to specify whether the imager tries to auto adjust the image exposure and, if
so, how.
Enumerated type of the supported baud rates for serial devices.
Note: A special driver is required if a baud rate greater than 115200 is selected.
Enumerated type to select the imager beeper volume when sounding the beeper. This structure
is ignored for products that do not have a beeper.
Enumerated type used in hhpConnect to specify the connection type and connection port where
the imager is connected.
Enumerated type to specify the behavior of the illumination and aimer LEDs during image
capture.
Enumerated type to select the image capture frame rate. Only valid when no auto exposure is
selected.
Enumerated type to select the image capture gain. This type is only valid when no auto
exposure is selected.
Enumerated type to specify the rate (in Mhz) at which all components other than the CPU are
to be clocked.
Enumerates the function result codes returned by the SDK functions. See Error Codes on page
3-1.
Enumerated type for specifying whether a read configuration item call should return the current
settings or the imager default setting.
Enumerates all the available symbologies supported in the imager decoder. Non-data type
used in the symbology configuration functions.
1 - 6
SDK Structure Types
A full description of the SDK structure types can be found in Enumerated Types and Definitions beginning on page 3-1.
Note:Important: Make sure to set the structure members dwStructSize and dwMask.
Individual Symbology Structures
All symbologies, except OCR, use either SymFlagsOnly_t or SymFlagsRange_t for configuration. There is a define for each
symbology (except OCR) that points to one of these two structures.
SymFlagsOnly_tStructure for symbologies that don’t have minimum and maximum data lengths.
SymFlagsRange_tStructure for symbologies that have minimum and maximum data lengths.
SymCodeOCR_t or OCR_TStructure to configure OCR symbology.
Configuration Structures
HHP_BEEPER
HHP_CONFIGSuper structure whose members are all the other configuration structures.
HHP_DECODE_MSGReturns decoded, code page and locale-translated data output from the SDK.
HHP_DECODER_CONFIGConfigures decoding behavior other than symbology setup.
HHP_ENGINE_INFO
HHP_IMAGE
HHP_IMAGE_ACQUISITION
HHP_IMAGE_TRANSFER
HHP_IMAGER_CAPS
HHP_INTEL_IMG
HHP_POWER_SETTINGSConfigures the power management options of the imager.
HHP_RAW_DECODE_MSGReturns raw (8 bit ASCII) decoded data output from the SDK.
HHP_SERIAL_PORT_CONFIGSpecifies serial port configuration for serial imagers.
HHP_SEQUENCESpecifies how the sequence acquisition mode is configured.
HHP_SYM_CONFIGContains a list of all the structures for all the symbologies.
HHP_TEXT_MSG
HHP_TRIGGERConfigures the trigger mode of the imager.
HHP_VERSION_INFOQueries imager and SDK software revisions.
Configures whether the beeper sounds on power up, decode, or command processing.
This is ignored if the imager does not have a beeper.
Structure used by the hhpReadEngineInfo (page 2-8) call that returns information about
the image engine. (5X80 engines with PSOC only.)
Returns image data from the SDK. It also specifies the format in which the image data is
returned.
Specifies how images are captured by the imager. This includes gain, exposure, frame
rates, and illumination.
Specifies how images are shipped from the imager to the SDK. This includes image
processing items such as cropping, subsampling, histogram stretching, and transfer
compression.
Retrieves the fixed characteristics of the imager: full image size, capture bits per pixel, and
maximum text/barcode message size (sent from imager). Structure in which
Specifies the location and size of the image returned as part of an intelligent image
capture. The location information is specified in minimum bar widths of the barcode
portion of the intelligent image.
Returns non-decoded data output from the SDK. The data is translated by code page and
locale.
1 - 7
1 - 8
2
API Function Descriptions
The following is an alphabetic listing of each API function with its complete description and a prototype for each function. All API
functions (with the exception of hhpEngineConnected (page 2-4) return a result code of type Result_t. See Error Codes on page
3-1 for the result code values.
hhpAcquireImage
This function causes the imager to capture an image and transfer it to the host. Values to be used from the structures are
specified by setting the appropriate bit mask for each item in the structure’s mask member.
pImgPointer to an HHP_IMAGE structure if bWait is TRUE. If bWait is FALSE, the parameter
is ignored and should be NULL.
pImgTransOptional pointer to an HHP_IMAGE_TRANSFER structure. This structure overrides (just
for this call) the current imager configuration, and specifies the pixel subsample, cropping
rectangle, transfer compression type, compression factor (for JPEG lossy transfer), and
progress notification method. If this parameter is NULL, the current imager configuration
settings are used except for the progress notification methods that must be specified for
each call if notification is desired.
pImgAcquOptional pointer to an HHP_IMAGE_ACQUISITION structure. This structure overrides
(just for this call) the current imager configuration, to specify and configure the image
capture method (type of autoexposure control or manual mode). If this parameter is NULL,
the current imager configuration settings are used.
bWaitIf TRUE, do not return until the image is received or an error occurs. If FALSE, return
immediately. One of the event notification methods must be enabled to receive notification
on completion. (See hhpSetAsyncMethods on page 2-10.)
hhpAcquireIntelligentImage
The location of the window of interest must be provided in units of minimum barcode widths. This allows the imager to grab the
same physical window, no matter how far the imager is from the page. The resultant image window is always squared with the
X and Y axis of the returned image, so even if the barcode page is rotated relative to the imager, the resultant image appears
square to the image edges.
There is only one intelligent image call that supports both synchronous and asynchronous capture. If synchronous capture is
used, all members of this structure must be valid. If asynchronous capture is used, you will receive
HHP_INTELIMG_BARCODE_EVENT for the barcode data, and HHP_INTELIMG_IMAGE_EVENT for the image data. The
barcode data is returned in a normal barcode structure (HHP_DECODE_MSG), while the intelligent image data is returned in an
HPP_IMAGE structure.
Note:Since the HHP_INTEL_IMG structure requires that image offsets and size be specified in barcode units, the
HHP_INTEL_IMG structure has a size member that allows you to specify (in pixels) the maximum allowable width and
height for the returned image.
pIntelImgPointer to an HHP_INTEL_IMG structure that contains the setup parameters describing
the location of the intelligent image relative to the barcode.
pDecodeMsgPointer to an HHP_DECODE_MSG structure if bWait is TRUE. If bWait is FALSE, the
parameter is ignored and should be NULL. The intelligent image barcode information is
returned here.
dwTimeoutMaximum time (in milliseconds) to attempt to decode before declaring a no decode.
pImgPointer to an HHP_IMAGE structure if bWait is TRUE. If bWait is FALSE, the parameter
is ignored and should be NULL.
bWaitIf TRUE, do not return until the image is received or an error occurs. If FALSE, return
immediately. One of the event notification methods must be enabled to receive notification
on completion. (See hhpSetAsyncMethods on page 2-10.)
hhpCancelIo
Cancels the current barcode or image capture.
hhpCancelIo(
void
)
hhpCaptureBarcode
This function causes the imager to capture images and attempt to decode them. Decoded data returned is translated by code
page and locale. Barcode capture can be synchronous or asynchronous. Synchronous capture is specified by setting the bWait
parameter hhpCaptureBarcode to TRUE. In this case, the function will not return until a barcode is read, an error occurs, or the
decode timeout is reached. Asynchronous capture is specified by setting the bWait parameter hhpCaptureBarcode to FALSE,
or whenever a barcode capture is initiated other than by the 5X00 Series (e.g., from a hardware trigger). In order to be notified
of an asynchronous transfer, you must enable at least one of the notification methods (see hhpSetAsyncMethods on page 2-10).
hhpCaptureBarcode(
PHHP_DECODE_MSG pDecodeMsg,
DWORD dwTimeout,
BOOL bWait
)
ParameterDescription
pDecodeMsgPointer to an HHP_DECODE_MSG structure if bWait is TRUE.
If bWait is FALSE, the parameter is ignored and should be NULL. (HHP_DECODE_MSG
will be passed to hhpGetAsyncMethods() call instead.) The function returns immediately,
and you are notified when symbols are decoded, an error occurs, or decoding times out
(no barcode) using the specified event notification method(s).
dwTimeoutMaximum time (in milliseconds) to attempt to decode before declaring a no decode. A
value of CURRENT_DECODE_TIMEOUT specifies that the timeout is whatever is
currently set on the imager. A value of 0 indicates no timeout.
bWaitIf TRUE, wait for capture to complete before returning. If FALSE, one of the event
notification methods must be enabled to receive notification upon completion.
hhpCaptureRawBarcode
This function causes the imager to capture images and attempt to decode them. Decoded data returned is unmodified 8 bit ASCII
data. Barcode capture can be synchronous or asynchronous. Synchronous capture is specified by setting the bWait parameter
hhpCaptureRawBarcode to TRUE. In this case, the function will not return until a barcode is read, an error occurs, or the decode
timeout is reached. Asynchronous capture is specified by setting the bWait parameter hhpCaptureRawBarcode to FALSE, or
whenever a barcode capture is initiated other than by the 5X00 Series (e.g., from a hardware trigger). In order to be notified of
an asynchronous transfer, you must enable at least one of the notification methods (see hhpSetAsyncMethods on page 2-10).
pDecodeMsgPointer to an HHP_RAW_DECODE_MSG structure if bWait is TRUE.
If bWait is FALSE, the parameter is ignored and should be NULL. (HHP_DECODE_MSG
will be passed to hhpGetAsyncMethods() call instead.) The function returns immediately,
and you are notified when symbols are decoded, an error occurs, or decoding times out
(no barcode) using the specified event notification method(s).
dwTimeout Maximum time (in milliseconds) to attempt to decode before declaring a no decode. A
value of CURRENT_DECODE_TIMEOUT specifies that the timeout is whatever is
currently set on the imager. A value of 0 indicates no timeout.
bWaitIf TRUE, wait for capture to complete before returning. If FALSE, one of the event
notification methods must be enabled to receive notification upon completion.
hhpConnect
This function opens a connection to an imager. The connection must be closed by calling hhpDisconnect(). The caller can verify
that the imager is connected by calling hhpEngineConnected().
Opens the selected communications port and establishes connection with the imager and starts the read data thread.
hhpConnect(
HHP_CONNECT_TYPE connectType,
PVOID pStruct
)
ParameterDescription
connectTypeDescribes the type of connection and hardware port, e.g., HHP_COM1, HHP_COM2,
HHP_COM3.
pStructAn optional structure that contains setup information for the hardware port, or NULL.
PHHP_SERIAL_PORT_CONFIG is used to configure a serial port connection.
hhpDisconnect
Closes the communications port and stops the read data thread.
hhpDisconnect(
void
)
hhpEnableDisableSymbology
Enables/disables an individual symbology or all symbologies.
hhpEnableDisableSymbology(
int nSymId,
BOOL bEnable
)
ParameterDescription
nSymId One of the symbology enumerated types, e.g., SYM_CODE39, SYM_OCR, or SYM_ALL
to enable/disable all symbologies.
bEnableTRUE to enable symbology, FALSE to disable symbology.
2 - 3
hhpEngineConnected
This function determines whether the imager is connected. This function checks to to see if the imager has lost power (due to
the host going into a suspended state), or if the imager has been removed.
hhpEngineConnected(
void
)
hhpGetAsyncResult
Retrieves the data from the last signal event (image/barcode capture). This function can be called with pResultStruct set to NULL
to obtain the event type. This is useful when the notification method is a Windows event.
hEventType Type of data causing the event notification. The valid values are:
HHP_BARCODE_EVENT
HHP_IMAGE_EVENT
HHP_TEXT_ MSG_EVENT
HHP_INTELIMG_BARCODE_EVENT
HHP_INTELIMG_IMAGE_EVENT
pResultStruct An HHP_DECODE_MSG, HHP_IMAGE, or HHP_TEXT_MSG structure pointer,
depending on the value of hEventType. This parameter can be NULL if just the event type
is desired. This is of use when the Event Handle notification is used.
hhpGetErrorMessage
This function returns a text message describing the meaning of a Result_t error code. See Error Codes on page 3-1 for complete
descriptions.
hhpGetErrorMessage(
Result_t nErrorCode,
PTCHAR ptcErrorMsg,
int nMaxChars
)
ParameterDescription
nErrorCodeError code returned from one of the other 5X00 Series functions.
ptcErrMsgTCHAR buffer to hold error message string.
nMaxCharsMaximum number of characters that can fit in ptcErrorMsg including NULL.
hhpGetLastImage
This function causes the imager to transfer the last image captured to the host. If bWait is TRUE, the function will not return until
the image is fully received or an error occurs. If bWait is FALSE, the function returns immediately and you are notified when
image transfer has completed or an error has occurred. pImgTrans is an optional parameter and can be NULL. Setting the
appropriate bit mask for each item specifies active members of this structure. This function can be used to obtain the image from
the last barcode capture attempt as well as the last image from an image capture attempt.
pImgPointer to an HHP_IMAGE structure if bWait is TRUE. If bWait is FALSE, the parameter
is ignored and should be NULL.
pImgTransOptional pointer to an HHP_IMAGE_TRANSFER structure. This structure overrides (just
for this call) the current imager configuration, and specifies the pixel subsample, cropping
rectangle, transfer compression type, compression factor (for JPEG lossy transfer), and
progress notification method. If this parameter is NULL, the current imager configuration
settings are used except for the progress notification methods that must be specified for
each call if notification is desired.
bWaitIf TRUE, do not return until the image is received or an error occurs. If FALSE, return
immediately. One of the event notification methods must be enabled to receive notification
on completion.
hhpNamedConnect
This function opens a connection to an imager. The connection must be closed by calling hhpDisconnect (page 2-3). The caller
can verify that the imager is connected by calling hhpEngineConnected (page 2-4).
hhpNamedConnect(
PTCHAR ptcConnectName,
PVOID pStruct
)
ParameterDescription
ptcConnectNameThe name of driver for the hardware port, e.g., "COM1:" or "\\.\COM12."
pStructAn optional structure that contains setup information for the hardware port, or NULL.
HHP_SERIAL_PORT_CONFIG is used to configure a serial port connection.
hhpRawAcquireIntelligentImage
Captures a portion of the image in which a barcode is decoded. The position of the image is specified relative to the center of
the barcode. This function differs from hhpAcquireIntelligentImage (page 2-1) in that the barcode data is returned as a raw
(untranslated) byte data array.
Note:Since the HHP_INTEL_IMG structure requires that image offsets and size be specified in barcode units, the
HHP_INTEL_IMG structure has a size member that allows you to specify (in pixels) the maximum allowable width and
height for the returned image.
pIntelImgPointer to an HHP_INTEL_IMG structure that contains the setup parameters describing
the location of the intelligent image relative to the barcode.
pRawDecodeMsgPointer to an HHP_RAW_DECODE_MSG structure if bWait is TRUE. If bWait is FALSE,
the parameter is ignored and should be NULL. The intelligent barcode raw data
(untranslated) is returned here.
dwTimeoutMaximum time (in milliseconds) to attempt to decode before declaring a no decode.
pImgPointer to an HHP_IMAGE structure if bWait is TRUE. If FALSE, the parameter is ignored
and should be NULL.
bWaitIf TRUE, do not return until the image is received, the decode timeout is reached, or an
error occurs. If FALSE, return immediately. One of the event notification methods must
be enabled to receive notification of completion (see hhpSetAsyncMethods on page 2-10).
2 - 5
hhpReadConfigItem
Reads the configuration items for one or all of the configuration structures found in the main 5X00 Series configuration structure
HHP_CONFIG.
hhpReadConfigItem(
SetupType_t cfgType,
ConfigItems_t item,
PVOID pStruct
)
2 - 6
ParameterDescription
cfgTypeUse SETUP_TYPE_CURRENT for the current settings, or SETUP_TYPE_DEFAULT for
the customer default settings.
item One of the members of the enumerated type ConfigItems_t. The valid values are:
BEEPER_CONFIGReturns beeper control settings for devices with audible
beepers. The settings include volume, beep on decode,
and beep on reset.
TRIGGER_CONFIGReturns values for all trigger timeouts and current
trigger mode.
DECODER_CONFIGReturns the decoder setup. This includes single
decode, multiple decodes, print weight, centered
decode, and aimer.
POWER_CONFIGContains low power configuration settings: trigger
mode, low power timeout, low power imaging, LED
brightness, aimer LED settings, and system clock
speed.
VERSION_INFOReturns the SDK, imager firmware, and imager boot
code versions.
SYMBOLOGY_CONFIGReturns the enable and setup parameters for all
symbologies. Individual symbologies can be read by
calling hhpReadSymbologyConfig.
SERIAL_PORT_CONFIGIf using a serial connection imager, this returns the
serial port setup parameters of the imager.
IMAGE_ACQUISITIONReturns the current imager settings for capture mode,
manual exposure, manual gain, manual frame rate,
target white value, target window, aimer and
illumination duty cycle, and triggering mode (hardware
trigger dependent).
IMAGE_TRANSFERReturns the current image transfer protocols, such as
cropping window, pixel subsample, and transfer
compression.
SEQUENCE_CONFIGReturns the sequence mode enable/disable state and
the data sequence command string.
ALL_CONFIGAll of the above except serial port config.
pStructPointer to the appropriate structure based on parameter “item:”
HHP_BEEPER
HHP_TRIGGER
HHP_DECODER_CONFIG
HHP_POWER_SETTINGS
HHP_VERSION_INFO
HHP_SYM_CONFIG
HHP_SERIAL_PORT_CONFIG
HP_IMAGE_ACQUISITION
HHP_IMAGE_TRANSFER
HHP_SEQUENCE
HHP_CONFIG
hhpReadConfigStream
Reads the full imager configuration as a single stream of data into a buffer. The buffer contains all the configuration items in an
ASCII stream so that it can be written to a disk for storage. No interpretation is done on the data stream, therefore, the data
stream contains both read only, and read/write data.
2 - 7
hhpReadConfigStream(
PBYTE puchCfgStream,
int nMaxLen,
PINT pnBytesReturned
)
ParameterDescription
puchCfgStream Buffer to hold the raw imager configuration stream.
nMaxLenMaximum number of bytes that fit in buffer puchCfgStream.
pnBytesReturnedPointer to an integer where the number of bytes returned in puchCfgStream is placed.
hhpReadEngineInfo
Reads information about the image engine contained in the image engine PSOC. This call is only valid for imagers that have a
PSOC. If the attached imager is not an 5X80 image engine, or the engine does not have a PSOC, the function returns the error
code RESULT_ERR_UNSUPPORTED.
hhpReadEngineInfo(
PHHP_ENGINE_INFO pEngInfo
)
ParameterDescription
pEngInfoPointer to an engine information structure in which the engine information is returned. The
dwStructSize member must be set to size (HHP_ENGINE_INFO) before making the call.
hhpReadImagerCapabilities
Returns the fixed imager capabilities, such as imager bits per pixel or image capture width and height.
Note:As with all other HHP structures, the dwStructSize member of the structure must be set before calling this function. (Set
to sizeof (HHP_IMAGER_CAPS).)
hhpReadImagerCapabilities(
HHP_IMAGER_CAPS pImgrCaps
)
ParameterDescription
pImgrCapsPointer to the HHP_IMAGER_CAPS structure.
hhpReadSymbologyConfig
Reads configuration items for a single symbology or for all symbologies. Individual items to be read are specified by adding the
appropriate mask bit (OR it) to the mask member of the structure to which it belongs. Only items whose bits are set are read; all
other items are ignored.
hhpReadSymbologyConfig(
SetupType_t cfgType,
int nSymbol,
PVOID pvSymStruct
)
ParameterDescription
cfgTypeUse SETUP_TYPE_CURRENT for the current settings, or SETUP_TYPE_DEFAULT for
the customer default settings.
nSymbol One of the symbology enumerated types, e.g., SYM_CODE39, SYM_OCR, or SYM_ALL
to read all symbologies.
pStruct Pointer to the appropriate structure based on nSymbol, e.g., CODE39_T, OCR_T, or
HHP_SYM_CONFIG if all symbologies.
2 - 8
hhpReadSymbologyRangeMaxMin
Returns the specified symbology range maximum and minimum values. If a symbology has no range values, the function returns
-1 for the minimum and maximum values.
hhpReadSymbologyRangeMaxMin(
int symbol,
PLONG pnRangeMin,
PLONG pnRangeMax
)
ParameterDescription
intThe enumerated symbology types, eg., SYM_CODE39, SYM_PDF417, or SYM_ALL to
read the max/min range for all symbologies.
pnRangeMinA LONG pointer to hold the minimum range value for single symbologies, or a LONG array
of size NUM_SYMBOLOGIES if SYM_ALL specified. The min value will be -1 if the
symbology does not support a minimum length value.
pnRangeMaxA LONG pointer to hold the maximum range value for single symbologies, or a LONG array
of size NUM_SYMBOLOGIES if SYM_ALL specified. The max value will be -1 if the
symbology does not support a maximum length value.
hhpSendActionCommand
This command allows the application to modify some of the imager hardware states. The items that can be modified include
turning the illumination LEDs on/off, turning the aimer LEDs on/off, or causing the device’s beeper to beep/double beep.
hhpSendActionCommand(
HHP_ACTION actionCmd,
int nVal )
ParameterDescription
actionCmdOne of the values of enum HHP_ACTION (HHP_AIMER_CMD,
HHP_ILLUMINATION_CMD, or HHP_BEEP_CMD).
nValHHP_ON/HHP_OFF for illumination or aimers
HHP_SINGLE_BEEP/HHP_DOUBLE_BEEP for beeper.
hhpSendMessage
The SDK API provides access to almost all of the imager command set. hhpSendMessage allows applications to send menu
(imager) commands directly to the imager (both wrapped and unwrapped) and to receive the actual uninterpreted imager
response. This command allows a developer to send debug commands to the imager.
hhpSendMessage(
PBYTE puchMsg,
int nLen,
BOOL bSendRaw,
PBYTE puchReply,
int nLenToRead,
PINT pnRetLen
)
2 - 9
ParameterDescription
puchMsgCommand sent to the imager with or without command wrapper. If no wrapper, set
bSendRaw to TRUE.
nLenNumber of bytes to send (in puchMsg).
bSendRawIf TRUE, the SYN M CR command wrapper is NOT added to the command before sending
it to the imager. If FALSE, the command is sent withSYN M CR command wrapper.
puchReplyBuffer to hold imager response. Can be NULL if no response required.
nLenToReadNumber of bytes to read from imager in response. 0 if no response.
pnRetLenPointer to number of bytes returned in pnRetLen. NULL if no response required.
hhpSetAsyncMethods
hhpSetAsyncMethods sets the methods by which the caller wishes to be notified upon receipt of a barcode or image.
hhpSetAsyncMethods(
HANDLE hEventHandle,
HWND hWndHandle,
HHP_EVENT_CALLBACK EventCallback
)
ParameterDescription
hEventHandleHandle to a Windows Event. The event should specify manual reset.
hWndHandle Handle to the application window that should receive the SDK defined message
WM_HHP_EVENT_HWND_MSG. The message parameters are:
WPARAM The event type (hhpEventType_t)
LPARAM The number of bytes received
EventCallback Callback function of type HHPEVENTCALLBACK, which is BOOL CALLBACK name (
EventType_t,DWORD ).
hhpSetBarcodeDataCodePage
This function changes the code page used when translating the decoded data from a string of bytes to Unicode. The default
value is CP_ACP (ANSI code page). There is no error checking on the values sent to this function, so you must determine
whether or not a code page is valid on the given system.
hhpSetBarcodeDataCodePage(
DWORD dwCodePage
)
ParameterDescription
dwCodePageCode page to use when converting from BYTE string to Unicode. The only 2 code pages
that are valid are CP_ACP and CP_OEMCP.
hhpSetConfigItemToDefaults
Defaults a configuration group or individual group structure items.
hhpSetConfigItemToDefaults(
ConfigItems_t item
)
2 - 10
ParameterDescription
item One of the members of the enumerated type ConfigItems_t. The valid values are:
BEEPER_CONFIGResets HHP_BEEPER structure settings to their
defaults.
TRIGGER_CONFIGResets HHP_TRIGGER structure settings to their
defaults.
DECODER_CONFIGResets HHP_DECODER structure settings to their
defaults.
POWER_CONFIGResets HHP_POWER_SETTINGS structure settings to
their defaults.
SYMBOLOGY_CONFIGResets HHP_SYM_CONFIG structure settings to their
IMAGE_TRANSFERResets HHP_IMAGE_TRANSFER structure settings to
their defaults (not progress notification methods).
ALL_CONFIGResets all of the above.
hhpSetHardwareLineDllFileName
The SDK API provides the ability to provide OEM device-dependent extensions to support the imager hardware sleep lines, and
hardware trigger and/or special COM port driver configuration/initialization. The definitions and function prototype are located in
the header file OemDll.h. Also see OEM-Configurable SDK Functionality on page 5-1.
ptcHwrFilenameName of DLL provided by OEM containing some or all of the function exports described in
the header file OemDll.h
hhpSetSymbologyDefaults
Resets an individual symbology or all symbologies to their default values.
hhpSetSymbologyDefaults(
int nSymId
)
ParameterDescription
nSymId One of the symbology enumerated types, e.g., SYM_CODE39, SYM_OCR, or SYM_ALL
to default all symbologies.
hhpUpgradeFirmware
The 5X00 Series provides the ability to update the firmware application running on the imager. hhpUpgradeFirmware checks the
file contents to verify that it is a firmware application file before the file is downloaded to the imager. The firmware file is
transferred to the imager compressed (lossless) unless the SDK has determined that the imager is running in bootstrap code
instead of the current firmware application. In this case, the file is transferred uncompressed. This function only supports
synchronous operation, so it does not return until the firmware file has been transferred to the imager and the imager has burned
the new code into flash memory. When this function returns, the connection (host COM port) is connected at the default baud
rate of 115200.
ptcFirmwareFilename String containing the fully qualified filename of the file that contains the code to be sent to the
imager. The file extension is usually .bin or .axf. The file is sent using an Hmodem, which is a
derivative of Xmodem 1K.
pdwTransferPercent Pointer to a DWORD that contains the current percent transferred value(0 to 100). If
pdwTransferPercent is valid, the transfer completion percent is written to it. This is updated after
each packet is sent.
hTransferNotifyHwndHandle to the window that is to receive the transfer update messages. The message is sent
when the percentage changes by more than 1%. The window associated with the handle should
hook the WM_HHP_PROGRESS_HWND_MSG message.
After file transfer is complete and while the imager is storing the new code in flash, the message
WM_HHP_IMAGER_FLASHING is sent to the window HWND (if valid). The parameters are:
WPARAM - Bytes transferred so far
LPARAM - Bytes to be sent
The window should also hook the WM_HHP_IMAGER_FLASHING message. The parameters
sent are:
1st Call wParam=1 lParam=0 ransfer is done and flashing has begun
Subsequent wParam=x lParam=1 Where x toggles between 0 and 1 every ½ second
Final Call wParam=0 lParam=0 Flashing is complete
hhpWriteConfigItem
Writes the configuration items for one or all of the configuration structures found in the main 5X00 Series configuration structure
HHP_CONFIG. Individual items can be specified by adding the appropriate mask bit by ORing it with the dwMask member of
the structure. Only items whose bits are set are written; all other items are ignored.
hhpWriteConfigItem(
ConfigItems_t item,
PVOID pStruct
)
2 - 12
ParameterDescription
item One of the members of the enumerated type ConfigItems_t. The valid values are:
BEEPER_CONFIGWrites the HHP_BEEPER structure settings specified
by the dwMask value to the imager.
TRIGGER_CONFIGWrites the HHP_TRIGGER structure settings specified
by the dwMask value to the imager.
DECODER_CONFIGWrites the HHP_DECODER_CONFIG structure
settings specified by the dwMask value to the imager.
POWER_CONFIGWrites the HHP_POWER_SETTINGS structure
settings specified by the dwMask value to the imager.
VERSION_INFOReturns the SDK, imager firmware, and imager boot
code versions.
SYMBOLOGY_CONFIGWrites the HHP_SYM_CONFIG individual structure
symbology settings specified by each structure's
dwMask value to the imager.
SERIAL_PORT_CONFIGWrites the HHP_SERIAL_PORT_CONFIG structure
settings specified by the dwMask value to the imager.
Connection to the imager is maintaned.
IMAGE_ACQUISITIONWrites the HHP_IMAGE_ACQUISITION structure
settings specified by the dwMask value to the imager.
IMAGE_TRANSFERWrites the HHP_IMAGE_TRANSFER structure
settings specified by the dwMask value to the imager
(not progress notification methods).
SEQUENCE_CONFIGReturns the sequence mode enable/disable state and
the data sequence command string.
ALL_CONFIGWrites the members specified in each of the structures
of HHP_CONFIG. This includes all of the above except
SERIAL_PORT_CONFIG.
pStructPointer to the appropriate structure based on item:
HHP_BEEPER
HHP_TRIGGER
HHP_DECODER_CONFIG
HHP_POWER_SETTINGS
HHP_SYM_CONFIG
HHP_IMAGE_ACQUISITION
HHP_IMAGE_TRANSFER
HHP_SEQUENCE
HHP_CONFIG
hhpWriteConfigStream
Writes an entire data stream of programmable parameters to the device.
hhpWriteConfigStream(
PBYTE puchCfgStream,
int nLen
)
ParameterDescription
puchCfgStreamBuffer to hold the raw imager configuration stream.
nMaxLenMaximum number of bytes that fit in buffer puchCfgStream.
2 - 13
hhpWriteSymbologyConfig
Writes configuration items for a single symbology or for all symbologies. Individual items to be written are specified by adding
the appropriate mask bit (OR it) to the mask member of the structure to which it belongs. Only items whose bits are set are
written; all other items are ignored.
hhpWriteSymbologyConfig(
int nSymId,
PVOID pvSymStruct
)
ParameterDescription
nSymId One of the symbology enumerated types, e.g., SYM_CODE39, SYM_OCR, or SYM_ALL
to write all symbologies.
pStruct Pointer to the appropriate structure based on nSymbol, e.g., CODE39_T, OCR_T, or
HHP_SYM_CONFIG if all symbologies.
Symbology Identifiers
Note:Please consult the appropriate symbology specification for discussion of AIM symbology IDs and modifiers.
hhpReadConfigItem(), all the symbology config items for all the
symbologies will be retrieved. Use hhpReadSymbologyConfig()
to specify individual symbology structures.
Read/Write HHP_CONFIG items from structure memory in all
HHP configuration member structures.
3 - 5
Trigger Modes Enum
HHP_MANUAL_SERIAL = 0,
UNUSED,Unused.
HHP_MANUAL_LOW_POWER,
HHP_PRESENTATION,
HHP_SCANSTAND,
HHP_HOST_NOTIFY
HHP_SNAP_AND_SHIP
Requires trigger to scan (either software or hardware). No Low
Power Mode.
Requires trigger to scan (either software or hardware). Image
enters low power mode based on low power mode timeouts.
The imager uses ambient light to detect barcodes. For further
information please see the 5X80 Integration Manual.
Constantly looks for the scan stand barcode. When the imager
detects a barcode that is different from than the scan stand
barcode, it initiates a full trigger. For further information please
see the 5X80 Integration Manual.
Captures and sends an image when triggered (instead of
scanning for barcodes).
Sequence Mode
HHP_SEQ_DISABLED = 0,Sequence mode disabled.
HHP_SEQ_ENABLED,Sequence mode enabled but not required.
HHP_SEQ_REQUIREDSequence mode enabled and required.
Serial Port Baud Rates
SERIAL_BAUD_300 = 300,300 BPS
SERIAL_BAUD_600 = 600, 600 BPS
SERIAL_BAUD_1200 = 1200, 1200 BPS
SERIAL_BAUD_2400 = 2400, 2400 BPS
SERIAL_BAUD_4800 = 4800, 4800 BPS
SERIAL_BAUD_9600 = 9600, 9600 BPS
SERIAL_BAUD_19200 = 19200, 19200 BPS
SERIAL_BAUD_38400 = 38400, 38400 BPS
SERIAL_BAUD_57600 = 57600, 57600 BPS
SERIAL_BAUD_115200 = 115200, 115200 BPS
// Baud Rates that Require USB Serial or SIO950 Compatible Serial Port Driver
SERIAL_BAUD_230400 = 230400, 230400 BPS
SERIAL_BAUD_460800 = 460800, 460800 BPS
SERIAL_BAUD_921600 = 921600, 921600 BPS
Baud Rates that Require USB Serial or SIO950 Compatible Serial Port Driver
SERIAL_BAUD_230400 = 230400, 230400 BPS
SERIAL_BAUD_460800 = 460800, 460800 BPS
SERIAL_BAUD_921600 = 921600921600 BPS
3 - 6
Serial Data Bits
SERIAL_DATA_BITS_7 = 7,7 bit data
SERIAL_DATA_BITS_88 bit data
Parity
SERIAL_PARITY_NONE = ‘N’,No parity
SERIAL_PARITY_ODD = ‘O’,Odd parity
SERIAL_PARITY_EVEN = ‘E’,Even parity
SERIAL_PARITY_MARK = ‘M’,Mark parity
SERIAL_PARITY_SPACE = ‘S’Space parity
Stop Bits
SERIAL_ONE_STOPBITS = 1,1 stop bit
SERIAL_TWO_STOPBITS,2 stop bits
Connection Types
Currently limited to serial ports.
HHP_COM1=0,COM1
HHP_COM2, COM2
HHP_COM3, COM3
HHP_COM4, COM4
HHP_COM5, COM5
HHP_COM6, COM6
HHP_COM7, COM7
HHP_COM8, COM8
HHP_COM9, COM9
HHP_COM10, COM10
HHP_COM11, COM11
HHP_COM12, COM12
HHP_COM13, COM13
HHP_COM14, COM14
HHP_COM15, COM15
HHP_COM16, COM16
HHP_COM17, COM17
HHP_COM18, COM18
HHP_COM19, COM19
HHP_LAST_COMM_PORT=255Last valid comm port.
3 - 7
Decoder Symbology Support
HHP_1D_CODES_ONLY=0,1D Linear and stacked linear codes only.
HHP_1D_AND_PDF_CODES,Same as above plus PDF417 and MicroPDF417.
HHP_ILLUMINATION_CMD,No longer supported by imagers.
HHP_BEEP_CMDBeeper command (sound a single or double beep).
On/Off Enum
HHP_OFF=0,Turn Off (HHP_AIMER_CMD and HHP_ILLUMINATION_CMD).
HHP_ON=1Turn On (HHP_AIMER_CMD and HHP_ILLUMINATION_CMD).
Beep Execute Enum
HHP_SINGLE_BEEP=0, Single Beep (HHP_BEEP_CMD).
HHP_DOUBLE_BEEP=1 Double Beep (HHP_BEEP_CMD).
Imager Type Enum
HHP_UNKNOWN_IMAGERUnable to determine engine type.
HHP_DECODED_IMAGER_4080Serial (RS-232) 4080 imager with internal decoder.
HHP_DECODED_IMAGER_4080_USBUSB serial 4080 imager with internal decoder.
HHP_DECODED_IMAGER_5080VGASerial (RS-232) 5080 VGA imager with internal decoder.
HHP_DECODED_IMAGER_5080VGA_USBUSB serial 5080 VGA imager with internal decoder.
HHP_DECODED_IMAGER_5080VGA_PSOC
HHP_DECODED_IMAGER_5080VGA_PSOC_USBUSB serial 5080 VGA imager with internal decoder and PSOC.
HHP_DECODED_IMAGER_5080Serial (RS-232) 5080 imager with internal decoder.
HHP_DECODED_IMAGER_5080_USBUSB serial 5080 imager with internal decoder.
HHP_DECODED_IMAGER_5080_PSOCSerial (RS-232) 5080 imager with internal decoder and PSOC.
HHP_DECODED_IMAGER_5080_PSOC_USBUSB serial 5080 imager with internal decoder and PSOC.
Serial (RS-232) 5080 VGA imager with internal decoder and
PSOC.
Illumination Color Enum (5X10/5X80 engines only)
SECONDARY_LEDSAlternate illumination color (if supported by engine).
PRIMARY_LEDSPrimary illumination color.
3 - 8
4
Structures and Mask Definitions
Important: All structures have a dwStructSize member that MUST BE SET before calling any of the 5X00 Series API functions.
Most structures have a dwMask member. This specifies which structure members are active (to be read or written). Select
structure items by ORing the individual structure masks for each of the items you wish to be active together.
This insures that the proper structure has been passed to the function being called.
Symbology Structures and Defines
All symbology structures are 1 of 3 possibilities.
Important: Symbology configuration definitions for each symbology are ORed together in the dwFlags member of the symbology
#define SYMBOLOGY_ENABLE0x00000001Enable Symbology bit.
#define SYMBOLOGY_CHECK_ENABLE0x00000002Enable usage of check character.
#define SYMBOLOGY_CHECK_TRANSMIT0x00000004Send check character.
#define SYMBOLOGY_START_STOP_XMIT0x00000008Include the start and stop characters in the
#define SYMBOLOGY_ENABLE_APPEND_MODE0x00000010Code39 append mode.
#define SYMBOLOGY_ENABLE_FULLASCII0x00000020Enable Code39 Full ASCII.
#define SYMBOLOGY_NUM_SYS_TRANSMIT0x00000040UPC-A/UPC-E Send Num Sys.
#define SYMBOLOGY_2_DIGIT_ADDENDA0x00000080Enable 2 digit Addenda (UPC and EAN).
#define SYMBOLOGY_5_DIGIT_ADDENDA0x00000100Enable 5 digit Addenda (UPC and EAN).
#define SYMBOLOGY_ADDENDA_REQUIRED0x00000200Only allow codes with addenda (UPC and
#define SYMBOLOGY_ADDENDA_SEPARATOR0x00000400Include Addenda separator space in
#define SYMBOLOGY_COMPOSITE_UPC0x00002000Enable UPC Composite codes.
#define SYMBOLOGY_AZTEC_RUNE0x00004000Enable Aztec Code Run.
#define SYMBOLOGY_AUSTRALIAN_BAR_WIDTH0x00010000Include Australian postal bar data in string.
#define SYMBOLOGY_AUS_CUST_FIELD_NUM 0x00020000Customer fields as numeric data using the
#define SYMBOLOGY_AUS_CUST_FIELD_AlPHA 0x00040000Customer fields as alphanumeric data
Flags for Aztec Mesas are reused, since Aztec Mesas have no addenda, extended UPC-E, or UPC-E1 enable flags.
#define SYMBOLOGY_TELEPEN_OLD_STYLE 0x04000000Telepen Old Style mode.
#define SYMBOLOGY_POSICODE_LIMITED_10x08000000PosiCode Limited of 1
structure. The applicable flags are dependent on symbology. For example, Aztec Code accepts only
SYMBOLOGY_ENABLE, while Postnet accepts SYMBOLOGY_ENABLE and SYMBOLOGY_CHECK_TRANSMIT.
decoded result string.
EAN).
returned string.
SYMBOLOGY_ENABLE for UPC-E0).
N Table.
using the C Table.
4 - 1
#define SYMBOLOGY_POSICODE_LIMITED_20x10000000PosiCode Limited of 2
#define SYMBOLOGY_CODABAR_CONCATENATE0x20000000Codabar concatenate.
Flags for OCR are reused, since none of the other flags apply to OCR.
Symbology structure sets masks to specify which items of config structure are to be set or read.
#define SYM_MASK_FLAGS0x00000001 Flags are valid.
#define SYM_MASK_MIN_LEN0x00000002 Min Length valid.
#define SYM_MASK_MAX_LEN0x00000004 Max Length valid.
#define SYM_MASK_OCR_MODE0x00000008 OCR mode valid.
#define SYM_MASK_DIRECTION0x00000010 OCR direction valid.
#define SYM_MASK_TEMPLATE0x00000020 OCR template valid.
#define SYM_MASK_GROUP_H0x00000040 OCR group H valid.
#define SYM_MASK_GROUP_G0x00000080 OCR group H valid.
#define SYM_MASK_CHECK_CHAR0x00000100 OCR check char valid.
#define SYM_MASK_ALL0xffffffff Generic all mask.
Structure for symbologies with no specified minimum or maximum length:
typedef struct _tagSymFlagsOnly
{
DWORD dwStructSize;Set to sizeof( SymFlagsOnly_t );
DWORD dwMask;Mask which can only be 0 or SYM_MASK_FLAGS.
DWORD dwFlags;OR of valid flags for the given symbology.
} SymFlagsOnly_t, *PSymFlagsOnly_t;
4 - 2
Min/Max barcode lengths for symbologies that have length settings:
CodeMinMax
Aztec13750
China Post280
Codabar260
Codablock F12048
Code 11180
Code 16K1160
Code 128080
Code 2 of 5148
Code 39 048
Code 49181
Code 93080
DataMatrix11500
EAN•UCC Composite12435
IATA Code 2 of 5148
Interleaved 2 of 5280
Korean Post280
Matrix 2 of 5180
MaxiCode1150
MicroPDF4171366
MSI448
PDF41712750
Plessey Code448
PosiCode280
QR Code13500
Reduced Space Symbology (RSS)474
Telepen160
Structure for symbologies with minimum and maximum length:
typedef struct _tagSymFlagsRange
{
DWORD dwStructSize; Set to sizeof( SymFlagsRange_t );
DWORD dwMask;Item Masks – SYM_MASK_FLAGS,MIN_LEN,MAX_LEN.
DWORD dwFlags;OR of valid flags for the given symbology.
DWORD dwMinLen;Minimum length for valid barcode string for this symbology.
DWORD dwMaxLen; Maximum length for valid barcode string for this symbology.
DWORDdwStructSize;Set to size of ( SymCodeOcr_t );
DWORDdwMask;Item masks.
OCRMode_tocrMode;OCR Enable/Mode structure.
OCRDirection_t ocrDirection;OCR direction structure. Not supported.
TCHARtcTemplate[ MAX_TEMPLATE_LEN ];Template for decoded data (‘d’ - decimal,
TCHARtcGroupG[ MAX_GROUP_H_LEN ];Group G character string.
‘a’ - ASCII, ‘l’ - letter, ‘e’ - extended).
4 - 3
TCHARtcGroupH[ MAX_GROUP_G_LEN ];Group H character string.
TCHARtcCheckChar[ MAX_CHECK_CHAR_LEN ];Check character string.
} SymCodeOCR_t, *PSymCodeOCR_t;
Structure of all Symbology Structures
There is one structure for each symbology. This info is stored in imager config.
Define aliases for each symbology structure:
#define AZTEC_T SymFlagsRange_tAztec Code has max and min length values.
#define MESA_T SymFlagsOnly_tAztec Mesa has flags only.
#define CODABAR_T SymFlagsRange_tCodabar has max and min length values.
#define CODE11_TSymFlagsRange_tCode 11 has max and min length values.
#define CODE128_TSymFlagsRange_tCode 128 has max and min length values.
#define CODE39_TSymFlagsRange_tCode 39 has max and min length values.
#define CODE49_TSymFlagsRange_tCode 49 has max and min length values.
#define CODE93_TSymFlagsRange_tCode 93 has max and min length values.
#define COMPOSITE_TSymFlagsRange_tComposite code has max and min length values.
#define DATAMATRIX_TSymFlagsRange_tData Matrix has max and min length values.
#define EAN8_TSymFlagsOnly_tEAN-8 has flags only.
#define EAN13_TSymFlagsOnly_tEAN-13 has flags only.
#define INT25_TSymFlagsRange_tInterleaved 2 of 5 has max and min length values.
#define MAXICODE_TSymFlagsRange_tMaxiCode has max and min length values.
#define MICROPDF_TSymFlagsRange_tMicroPDF417 has max and min length values.
#define OCR_TSymCodeOCR_tOCR has its own structure.
#define PDF417_TSymFlagsRange_tPDF417 has max and min length values.
#define POSTNET_TSymFlagsOnly_tPostnet has flags only.
#define QR_TSymFlagsRange_tQR Code has max and min length values.
#define RSS_TSymFlagsRange_tRSS Codes have max and min length values.
#define UPCA_TSymFlagsOnly_tUPC-A has flags only.
#define UPCE_TSymFlagsOnly_tUPC-E has flags only.
#define ISBT_TSymFlagsOnly_tISBT Code has flags only.
#define BPO_TSymFlagsOnly_tBritish Post has flags only.
#define CANPOST_TSymFlagsOnly_tCanadian Post has flags only.
#define AUSPOST_TSymFlagsOnly_tAustralian Post has flags only.
#define IATA25_TSymFlagsRange_tIATA 2 of 5 has max and min length values.
#define CODABLOCK_TSymFlagsRange_tCodablock has max and min length values.
#define JAPOST_TSymFlagsOnly_tJapanese Post has flags only.
#define PLANET_TSymFlagsOnly_tPlanet Code has flags only.
#define DUTCHPOST_TSymFlagsOnly_tKIX Post has flags only.
#define MSI_TSymFlagsRange_tMSI Code has max and min length values.
#define TLCODE39_TSymFlagsOnly_tTLCode 39 has flags only.
#define MATRIX25_TSymFlagsRange_tMatrix 2 of 5 Code has max & min length values.
#define KORPOST_TSymFlagsOnly_tKorea Post only has enable.
#define TRIOPTIC_T SymFlagsOnly_tTrioptic Code has flags only.
#define CODE32_T SymFlagsOnly_tCode 32 has flags only.
#define CODE25_T SymFlagsRange_tCode 2 of 5 has min and max length values.
#define PLESSEY_T SymFlagsRange_tPlessey Code has min and max length values.
#define CHINAPOST_T SymFlagsRange_tChina Post has min and max length values.
#define TELEPEN_T SymFlagsRange_tTelepen Code has min and max length values.
#define CODE16K_T SymFlagsRange_tCode 16K has min and max length values.
#define POSICODE_T SymFlagsRange_tPosiCode has min and max length values.
#define COUPONCODE_T SymFlagsOnly_tUPC Coupon code has flags only.
#define CODE4CB_TSymFlagsOnly_t4 State Customer Barcode.
#define UPUIDTAG_T SymFlagsOnly_tID tag (UPU 4-State) has flags only.
Data structures for decoded barcode message: hhpCaptureBarcode() and hhpGetAsyncResults(). Not stored in imager.
#define MAX_MESAGE_LENGTH4096
typedef struct _tagHHP_DECODE_MSG
{
DWORDdwStructSize;Size of decode structure.
TCHARpchMessage[ MAX_MESAGE_LENGTH ];decoded message data
TCHARchCodeID;AIM Id of symbology
TCHARchSymLetter;Hand Held Products Id of symbology
TCHARchSymModifier;Modifier characters
DWORDnLength;length of the decoded message
} HHP_DECODE_MSG, DecodeMsg_t, *PHHP_DECODE_MSG;
typedef struct _tagHHP_RAW_DECODE_MSG
{
WORDwStructSize;Size of decode structure
BYTEchMessage[ MAX_MESAGE_LENGTH ];Decoded message data
BYTEhCodeID;AIM ID of symbology
BYTEhSymLetter;HHP ID of symbology
BYTEhSymModifier;Modifier characters
DWORDLength;Length of the decoded message
#define WHITE_VALUE_MASK0x00001Target value (0-255) for the “white” pixel.
#define WHITE_WINDOW_MASK0x00002Acceptable delta from target white.
#define MAX_CAPTURE_RETRIES_MASK0x00004Max # of frames to try to get white value.
#define ILLUMINATION_DUTY_CYCLE_MASK0x00008How LEDs behave during image capture.
#define LIGHTS_DUTY_CYCLE_MASK0x00008Duplicate of above mask.
#define AIMER_DUTY_CYCLE_MASK0x00010How aimers behave during image capture.
#define FIXED_GAIN_MASK0x00020If manual mode, gain value to use.
#define FIXED_EXPOSURE_MASK0x00040If manual mode, exposure value to use.
#define FRAME_RATE_MASK0x00080If manual mode, frame rate to use.
#define AUTOEXPOSURE_MODE_MASK0x00100Barcode, Photo, or manual AGC mode.
#define IMAGE_CAPTURE_MODE_MASK0x00100Same as above mask.
Following 2 items are not config items and are only used in hhpAcquireImage():
#define WAIT_FOR_TRIGGER_MASK0x00200Wait for trigger before capture.
#define PREVIEW_MODE_IMAGE_MASK0x00400Capture a preview image (214x160x8 JPEG).
Grouped masks:
#define CAPTURE_MASK_CONFIG_ALL0x001ffMask for all configuration items.
#define CAPTURE_MASK_FIXED_AGC0x00180Mask for all manual exposure mode items.
#define CAPTURE_MASK_ALL0x007ffMask for all structure members.
4 - 6
Image Acquisition structure:
typedef struct _tagHHP_IMAGE_ACQUISITION
{
DWORDdwStructSize;Size of structure in bytes.
DWORDdwMask;Mask of active items.
Config items
DWORDdwWhiteValue;Target “white pixel” value.
DWORDdwWhiteWindow;Acceptable delta from white value.
DWORDdwMaxNumExposures;Max frame capture tries for white value.
HHP_DUTY_CYCLEilluminatCycle;Illumination duty cycle (never on, on during imag-
ing).
HHP_DUTY_CYCLEaimerCycle;Aimer duty cycle (never on, on during imaging).
HHP_GAINfixedGain;If manual capture mode, gain value for capture.
DWORDdwFixedExposure; If manual capture mode, exposure time for cap-
ture.
HHP_FRAME_RATEframeRate; If manual capture mode, frame rate for capture.
HHP_AUTOEXPOSUREcaptureMode; Autoexposure (AGC) Capture mode: barcode,
photo or manual.
Capture time only, not real config items:
BOOLbWaitForTrigger;Wait for hardware or software trigger before cap-
turing image.
BOOLbPreviewImage;Capture a preview image. These are subsample
3, full window, JPEG transfer images.
} HHP_IMAGE_ACQUISITION, *PHHP_IMAGE_ACQUISITION;
Image Transfer bit masks:
#define BITS_PER_PIXEL_MASK0x00001Number of bits per pixel transferred (1 or 8).
#define SUBSAMPLE_VALUE0x00002Subsample value (1-10).
#define SUBSAMPLE_VALUE_MASK0x00002Subsample value (1-10).
#define BOUNDING_RECTANGLE_MASK0x00004Rectangular region within image to send.
#define COMPRESSION_MODE_MASK0x00008No Compression, Lossless or Lossy.
#define HISTOGRAM_STRETCH_MASK0x00010Range -> 0 - 255.
#define COMPRESSION_FACTOR_MASK0x00020If lossy compression, image quality percent.
#define EDGE_ENHANCEMENT_MASK0x00100Edge sharpening filter.
#define GAMMA_CORRECTION_MASK0x00200Gamma correction.
#define TEXT_ENHANCEMENT_MASK0x00400Text sharpening filter.
#define INFINITY_FILTER_MASK0x00800Sharpening for image beyond normal focus.
#define FLIP_IMAGE_MASK0x01000Rotate the image 180 degrees.
#define NOISE_FILTER_MASK 0x02000Smoothing (fly spec) filter.
#define TRANSFER_UPDATE_HWND0x00040Transfer progress message window.
#define TRANSFER_UPDATE_DWORD0x00080Pointer to DWORD for percent of transfer complete.
#define TRANSFER_MASK_ALL0x03fffMask to select all configuration items in structure.
#define TRANSFER_MASK_ALL_NO_NOTIFY0x03f3fMask to select all structure members.
Image Transfer structure:
typedef struct _tagHHP_IMAGE_TRANSFER
{
DWORDdwStructSize;Size of structure in bytes.
DWORDdwMask; Mask of active items.
Config items:
DWORDdwBitsPerPixel;Bits per pixel for transferred image (1 or 8 bits
only).
DWORDdwSubSample;Subsample value. This means take every dwSub-
Sample pixels of every dwSubSample row. The
default is 1.
4 - 7
RECTboundingRect;Rectangle describing a window within the image.
All pixels outside this rectangle are omitted from
the transferred image.
BOOLbHistogramStretch;Scaled frequency of total image pixels.
Compression_tcompressionMode;How image is compressed on transfer. Compres-
sion reduces the amount of data to transfer but
can reduce image quality (Lossy compression)
and does take a finite length of time.
DWORDdwCompressionFactor;Lossy compression is JPEG lossy. If lossy com-
pression, this value specifies the image quality
percentage from 100 (virtually no loss) to 1 (very
poor). Image size drops with decrease in image
quality.
DWORDdwEdgeEhancement;A sharpening filter used to sharpen light/dark
edges within the image. The valid range of values
is 0 (no edge enhancement) to 23 (maximum edge
enhancement).
DWORDdwGammaCorrection;Applies gamma correction to the image. The valid
range is 0 (no gamma correction) to 1000 (maxi-
mum correction).
DWORDdwTextEnhancement;This filter is an edge sharpening filter optimized for
text. The valid range is 0 (no text enhancement) to
255 (maximum enhancement).
BOOLbInfinityFilter;This is a boolean flag (TRUE or FALSE) that
applies a filter to the image that sharpens objects
beyond the normal focal distance of the imager.
BOOLbFlipImage;This is a boolean flag (TRUE or FALSE) that flips
the image 180°
BOOL bNoiseFilter;This is a boolean flag (TRUE or FALSE) that
sent if this member mask specified and its value is
a valid windows handle.
PDWORDpdwTransferPercent;If non-NULL and specified in MASK, the percent
complete of the transfer is placed here. It is up to
the caller to check the value in a thread or timer
callback.
} HHP_IMAGE_TRANSFER, *PHHP_IMAGE_TRANSFER;
Data structure for captured image: hhpAcquireImage(), hhpGetLastImage() and hhpGetAsyncResult(). Not stored in imager.
typedef struct _tagHHP_IMAGE
{
DWORDdwStructSize;Size of structure in bytes.
PBYTEpuchBuffer;Buffer for image.
LONGnBufferSize;Size of buffer in bytes.
FileFormat_tfileFormat;Format for returned data.
DWORDdwJpegQFactor;JPEG Quality Factor.
LONGnBytesReturned;Number of bytes returned.
SIZEimgSize;Size of image returned.
LONGnCapturedFrames;Number of frames captured prior to this image.
LONGnGain;Gain value used to capture this image.
LONGnExposureTime;Exposure time used to capture this image.
4 - 8
LONGnUnderexposedPixels;Number of underexposed pixels in image.
LONGnOverexposedPixels;Number of overexposed pixels in image.
} HHP_IMAGE, *PHHP_IMAGE;
Other Imager Configuration Structures and Defines
Beeper member valid bitmasks:
#define BPMASK_ON_DECODE0x00001Beep on successful decode.
#define BPMASK_SHORT_BEEP0x00002Beep on imager reset.
#define BPMASK_MENU_CMD_BEEP0x00004Beep on receive menu command.
#define BPMASK_BEEP_VOLUME0x00008Set the beeper volume.
#define BPMASK_ALL0x0000fMask for all members valid.
Beeper structure:
typedef struct _tagHHP_BEEPER
{
DWORDdwStructSize;Size of structure in bytes.
DWORDdwMask;Mask of active items.
BOOLbBeepOnDecode;Sound beeper on successful decode.
BOOLbShortBeep;Sound beeper whenever imager resets.
BOOLbMenuCmdBeep;Sound beeper whenever a menu command is received.
BEEPER_VOLUMEbeepVolume;Set the beeper volume.
#define TRGMASK_TRIG_MODE0x00001Enable/disable manual trigger mode.
#define TRGMASK_TIMEOUT0x00002Sanity timeout on trigger event.
#define TRGMASK_ALL0x00003All members valid mask.
Triggering control:
typedef struct _tagHHP_TRIGGER
{
DWORDdwStructSize;Size of structure in bytes.
DWORDdwMask;Mask of active items.
HHP_TRIG_MODESTriggerMode;Trigger mode.
DWORDdwTriggerTimeout;0->9999 (milliseconds).
LONG nAimerY;Aimer Y
LONG nLaserPower;Laser power in mW
TCHAR tcFirmwareChecksum[ MAX_CHECKSUM_LEN ];Firmware Checksum (ASCII Hex)
TCHAR tcFirmwareRev[ MAX_SHORT_VERSION_LEN ];Firmware revision number.Number
LONG nLedCtrlMode;How LEDs are controled.
LONG nLedClr;LED color (red or green LEDs)
LONG nPwmFreq;PWM base frequence.
LONG nRedLedCurrent;Red LED current (mA).
LONG nRedLedMaxCurrent; Red LED max current (mA).
LONG nGreenLedCurrent;Green LED current (mA).
LONG nGreenLedMaxCurrent;Green LED max current (mA).
LONG nAimerCurrent;Aimer current (mA).
LONG nAimerMaxCurrent;Aimer max current (mA).
LONG nPixelClockFreq;Pixel clock frequency (MHz)
TCHAR tcRegisterChecksum[ MAX_CHECKSUM_LEN ];Register chcksum (ASCII hex)
LONG nSymId;Symbology identifier SYM_xxxx
LONG nLength;Match length or 9999 to match any length.
TCHAR tcStartChars[ MAX_NUM_START_CHARS+1 ];Matching string (from start)
} SeqBarCode_t, *PSeqBarCode_t;
Sequence structure:
typedef struct _tagHHP_SEQUENCE_MODE
{
DWORDdwStructSize;Size of structure in bytes
DWORDdwMask;Mask of active items
HHP_SEQ_MODES sequenceMode;Disabled/Enabled/Enabled & Required
DWORDdwNumBarCodes;This MUST be sent if sending seqBarCodes
SeqBarCode_tseqBarCodes[ MAX_SEQ_BARCODES ];Barcodes to sequence in order they are to be
sent
TCHARtchSeqCmdBlk[ SIZE_OF_SEQUENCE_BLOCK ];
} HHP_SEQUENCE_MODE, *PHHP_SEQUENCE_MODE;
Decode method stucture masks:
#define DCMASK_MAX_MESSAGE_LENGTH0x00001Maximum length of decoded string. This item is Read Only.
#define DCMASK_DECODE_MULTIPLE0x00002Look for and report all barcodes in captured frame.
#define DCMASK_USE_AIMERS0x00004Use aimers when capturing barcodes.
#define DCMASK_PRINT_WEIGHT0x00008Relative contrast between barcode and background (0-9).
#define DCMASK_DECODE_METHOD0x00010Normal, linear codes only. Fastest (may miss codes at
edges of image).
#define DCMASK_CENTER_ENABLE0x00020Only accept barcodes whose boundaries intersect center
window.
#define DCMASK_CENTER_WINDOW0x00040Rectangle about center of image for previous mask.
4 - 10
#define DCMASK_ILLUMINAT_LED_COLOR 0x00080Illumination LED color to use.
#define DCMASK_ALL0x000ffAll structure members are active.
Decoder functionality settings:
typedef struct _tagHHP_DECODER_CONFIG
{
DWORDdwStructSize;Size of structure in bytes.
DWORDdwMask; Mask of active items.
DWORDdwMaxMsgSize;Maximum length for any returned barcode string. This is a
read only value.
BOOLbDecodeMultiple;Decode and send all symbols decoded with first frame
where at least 1 symbol is found.
BOOLbUseAimers;Turn on aimers during barcode capture.
DWORDdwPrintWeight;How dark the barcode elements are relative to the back-
ground (1-7).
DECODE_METHOD decodeMethod;Normal decoder, linear codes only, fast normal decoder,
which omits checking at the image margins as well as
some bad barcode correction.
BOOLbCenterDecodeEnable;Does symbol have to intersect center decode window to be
valid.
RECTcenterWindow;Bounding coords of center window that decoded symbol
must intersect
ILLUM_LED_COLOR illumLedColor;Illumination LED color to use.
} HHP_DECODER_CONFIG, *PHHP_DECODER_CONFIG;
Aimer Modes:
typedef enum
{
AIMER_MODE_ALWAYS_OFF=0,No aimer LEDs.
AIMER_MODE_ILLUM_AND_AIM,Aimer LEDs and illumination LEDs on simultaneously.
AIMER_MODE_ALWAYS_ONAimer LEDs always on.
DWORDdwTriggerTimeout;0->300000 (milliseconds).
DWORDdwLowPowerTimeout; 0 -> 300.
DWORDdwLEDIntensityPercent;0 -> 100%.
HHP_SYS_SPEEDsystemClockSpeed; Clock speed for reset of system (except RS-232).
HHP_AIMER_MODESAimerMode;Aimer always on, alternating between illumination
These are used to notify on suspend (WinCE Suspend) – Not stored in imager:
HANDLEhPowerOffHandle;Handle for system suspend wakeup notification.
HWNDhPowerOffHwnd;Window HWND for system suspend wakeup noti-
fication message.
} HHP_POWER_SETTINGS, *PHHP_POWER_SETTINGS;
Version setting item masks – Items are read only:
#define VERMASK_SDK_API0x00001SDK version number.
#define VERMASK_IMAGER_FIRMWARE0x00002Imager firmware version.
#define VERMASK_IMAGER_PART_NUM0x00004Imager part number.
#define VERMASK_IMAGER_BOOT_CODE0x00008Imager boot code version.
#define VERMASK_IMAGER_DEVICE_TYPE0x00010Device type of which imager is part.
#define VERMASK_ALL0x0001fAll version info mask.
DWORDdwStructSize; Size of structure in bytes.
DWORDdwMask; Mask of active items.
TCHARtcAPIRev[ MAX_VERSION_STRING_LEN ];SDK API version string.
TCHARtcFirmwareRev[ MAX_VERSION_STRING_LEN ];Imager firmware version.
TCHARtcPartNumber[ MAX_VERSION_STRING_LEN ];Imager firmware part number.
TCHARtcBootCodeRev[ MAX_VERSION_STRING_LEN ];Imager boot code version.
TCHARtcDeviceType[ MAX_DEVICE_TYPE_STRING_LEN ] ;Imager device identifier.
} HHP_VERSION_INFO, *PHHP_VERSION_INFO;
Structure that includes all structures used to configure imager. See ConfigItems_t when specifying structure to call hhpReadConfigItem() and hhpWriteConfigItem().
typedef struct _tagHHP_CONFIG
{
DWORDdwStructSize;Size of HHP_CONFIG structure in bytes.
HHP_BEEPERbeeperCfg;Beeper configuration structure.
HHP_TRIGGERtriggerCfg;Trigger configuration structure.
HHP_DECODER_CONFIGdecoderCfg;Decoder function configuration structure.
HHP_POWER_SETTINGSpowerCfg;Power modes configuration structure.
HHP_VERSION_INFOversionInfo;Version information structure.
HHP_SYM_CONFIGsymbolCfg;Decoder symbology enables and configuration
structure.
HHP_IMAGE_ACQUISITIONimgAcqu;Image acquisition configuration structure.
HHP_IMAGE_TRANSFERimgTrans;Image transfer configuration structure.
} HHP_CONFIG, *PHHP_CONFIG;
4 - 12
Intelligent Image Capture:
typedef struct
{
DWORDdwStructSize;Size of HHP_INTEL_IMG structure in bytes.
DWORDdwAspectRatio;Ratio of barcode height to minimum barcode element width.
LONGnOffsetX;Offset from barcode center to the image window center in X
LONGnOffsetY;Offset from barcode center to the image window center in Y
DWORDdwWidth;Width of image in minimum barcode units.
DWORDdwHeight;Height of image in minimum barcode units.
SIZEmaxImgSize;Maximum width and height for resulting intelligent image in pix-
BOOLbSendBinary;Have reader binarize data before transfer.
DWORDdwStructSize; Size of HHP_SERIAL_PORT_CONFIG structure in bytes.
HHP_BAUD_RATEbaudRate;Baud rate for connection. NOTE: Reader always powers up at
HHP_DATA_BITSdataBits;Number of data bits.
HHP_PARITYparity;Parity.
HHP_STOP_BITSstopBits;Number of stop bits.
BOOLbAutoBaud;Not supported in the IT4500.
direction, relative to barcode center in minimum barcode units.
direction, relative to barcode center in minimum barcode units.
els. Image size is guaranteed not to exceed either dimension.
115200. The 5X00 Series changes the baud rate to this value
once it connects at 115200. Also, the SDK will not allow you to
connect at bauds above 115200 for WinCE unless the port
driver is sio950.dll (high speed driver for sio950 chipset).
Imager capabilities structure – Items are read only:
typedef struct _tagHHP_IMAGER_CAPS
{
DWORDdwStructSize; Size of HHP_IMAGE_CAPS structure in bytes.
SIZEfullImgSize;Size of image captured by imager before cropping and subsam-
pling.
DWORDdwImgrBpp;Bits per pixel of image captured by imager.
DECODER_TYPEdecoderType;Level of symbology support in the imager’s decoder.
IMAGER_TYPEimagerType;Decoded Out Serial, Decoded Out USB, Non-Decoded Out.
} HHP_IMAGER_CAPS, *PHHP_IMAGER_CAPS;
Imager Type (decoded out or non decoded out)
typedef enum
{
HHP_UNKNOWN_IMAGERUnable to determine engine type.
HHP_DECODED_IMAGER_4080Serial (RS-232) 4080 imager with internal decoder.
HHP_DECODED_IMAGER_4080_USBUSB serial 4080 imager with internal decoder
HHP_NON_DECODED_IMAGER_4000Incorporated 4000 imager.
HHP_DECODED_IMAGER_5080VGAUSB serial 5080 VGA imager with internal decoder.
HHP_DECODED_IMAGER_5080VGA_USBSerial (RS-232) 5080 VGA imager with internal decoder and
HHP_DECODED_IMAGER_5080VGA_PSOCSerial (RS-232) 5080 imager with internal decoder.
HHP_DECODED_IMAGER_5080VGA_PSOC_USBUSB serial 5080 imager with internal decoder.
HHP_NON_DECODED_IMAGER_5000VGA_PSOCIncorporated 5000 VGA imager with PSOC.
HHP_DECODED_IMAGER_5080Serial (RS-232) 5080 imager with internal decoder.
HHP_DECODED_IMAGER_5080_USBUSB serial 5080 imager with internal decoder.
HHP_NON_DECODED_IMAGER_5000Incorporated 5000 imager.
HHP_DECODED_IMAGER_5080_PSOCSerial (RS-232) 5080 imager with internal decoder and PSOC.
HHP_DECODED_IMAGER_5080_PSOC_USBUSB serial 5080 imager with internal decoder and PSOC.
HHP_NON_DECODED_IMAGER_5000_PSOCIncorporated 5000 imager with PSOC.
} ImagerType_t, IMAGER_TYPE;
4 - 14
5
OEM-Configurable SDK Functionality
The 5X80 accommodates a variety of PDA/PDT, static mount, and "gun" type installations, so the 5X00 Series has included the
flexibility to modify some SDK behaviors. You can provide a DLL that affords the SDK access to the hardware trigger, hardware
sleep lines, and access to the open driver handle and registry entries, which can be used to specify high speed baud rates
(greater than 115200). You can also specify whether to force a Y-modem communications protocol for image transfers.
OEM Supplied DLL
The OEM DLL interface is described in SDK header file OemDll.h. The DLL can export some or all of the available functionality.
If the DLL is named ImgrHwrLines.dll and is located in the default library search path, it will be loaded automatically by the SDK.
Otherwise, it can by loaded manually by calling the SDK function hhpSetHardwareLineDllFileName. The DLL exports are
described in the following list:
ConfigureCommPort
ConfigureCommPort performs any special driver configuration that needs to be done to support the specified communication port
settings. Configuring the communications driver requires the current driver handle, so you must also support
SetCommDriverHandle(). The function is called by the SDK whenever you set/change the communication port settings. It is
called after the SDK is finished processing pConfig, so any changes you make will not be overridden.
bool ConfigureCommPort(
PCommPortConfig pConfig
)
ParameterDescription
pConfigThe communication settings requested. The CommPortConfig structure contains:
Baud Rate, Data Bits, Parity, Stop Bits and RTS control.
ImagerPoweredDown
ImagerPoweredDown checks the imager powered down hardware line for the imager power state. The powered down hardware
line is active high. ImagerPoweredDown returns true if the hardware line is high, false if it is low.
bool ImagerPoweredDown(
void
)
ModifyCommPortDCB
ModifyCommPortDCB receives the RS-232 configuration (DCB) structure just before it's sent to the serial driver. You can then
modify the RTS/CTS and DTR/DTS settings if they are used for the imager’s power or trigger.
void ModifyCommPortDCB(
LPDCB lpDCB
)
ParameterDescription
LPDCB lpDCBStructure used by windows to configure a serial port.
SetCommDriverHandle
SetCommDriverHandle receives the handle to the open communications port. The handle can then be used to access private
driver ioctl calls.
void SetCommDriverHandle(
HANDLE hDriver
)
5 - 1
ParameterDescription
hDriverThe current handle to the open driver used to communicate with the imager.
SetHardwareTrigger
SetHardwareTrigger triggers the imager hardware trigger line, depending on bEnable. The hardware trigger line is active low.
void SetHardwareTrigger(
bool bEnable
)
ParameterDescription
bEnableIf true, set trigger line low to trigger imager. If false, set trigger line high to turn off trigger.
WakeUpImager
WakeUpImager toggles the imager hardware wakeup line from low to high, delay, (see Integration Manual for timing), then from
high back to low.
void ImagerPoweredDown(
void
)
Registry Entries
There are two registry entries used to modify the SDK default behavior. The values are both located in the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Hand Held Products\MatrixDemos.
Baud Rate
The SDK will not normally allow high speed serial connections (connections greater than 115200 baud) unless it recognizes the
driver name in the registry. The first registry value, BaudRate, specifies the first baud rate at which the demos will attempt to
connect. It also overrides the normal block that sets high speed baud rates. This lets you specify a baud rate greater than
115200.
ForceHmodem
The SDK does not normally use its Y-Modem variant, Hmodem, if a high speed serial connection is specified. However, if your
driver does not support true hardware RTS flow control, there is a substantial risk of communication buffer overruns. These
overruns can cause data loss, especially during image transfer. The registry value ForceHmodem lets you force the use of the
communications protocol, preventing data buffer overflow.
5 - 2
6
Program Samples
Configuration Management
Sample 1 - Set code 39 defaults turning on Full ASCII
// Make sure to set the structure size!
decodeInfo.dwStructSize = sizeof( HHP_DECODE_MSG );
// Call the SDK function to capture a barcode setting the bWait parameter to TRUE, 6
second timeout.
if ( (nResult = hhpCaptureBarcode( &decodeInfo,6000,TRUE ) == RESULT_SUCCESS )
{
// Make sure to set the structure size!
decodeInfo.dwStructSize = sizeof( HHP_DECODE_MSG );
// Wait on event being set by SDK then call SDK to get results.
if( WaitForSingleObject( hEvent,7000 ) == WAIT_OBJECT_0 )
nResult = hhpGetAsyncResult( &event,&decodeInfo );
Sample 5 - An asynchronous barcode capture message notification
Note:You must hook the message WM_HHP_EVENT_HWND_MSG in your message loop to receive a barcode event
notification. In this example, the message is hooked to call OnEventMsg.
TCHARtcErrMsg[ 128 ]; // Error message buffer.
Result_tnResult = RESULT_ERR_INTIALIZE; // Return code.
HWNDhWnd = GetSafeHwnd();// The window to which message is to be
// Register the message window with the SDK.
if ( (nResult = hhpSetAsyncMethods( NULL,hWnd,NULL ) == RESULT_SUCCESS )
{
// Call the SDK function to capture a barcode, 6 second timeout. Unless call fails, you
will get a message when command completes.
if ( (nResult = hhpCaptureBarcode( NULL,6000,FALSE ) != RESULT_SUCCESS )
{
// Capture image specifies:
for capture - Photo Mode and Lights On During Frames.
for Transfer - Subsample value of 1 and Lossless transfer.
Note: You don’t really have to pass anything except the HHP_IMAGE structure as long as you
want the imager config settings for capture and transfer. Also, no progress feedback will
be received.
HHP_IMAGEimage;// Structure to hold captured image
HHP_IMAGE_TRANSFER imgTrans;// Image transfer options (override
}
// Remember to delete your buffer.
delete [ ] image.puchBuffer;
Sample 8 - An asynchronous image capture using Windows Messaging
Note:You must hook the message WM_HHP_PROGRESS_HWND_MSG in your message loop to receive a barcode event
notification. Here, assume the message is hooked to call OnEventMsg.
// Capture image specifies:
for capture - none (use imager config settings)
for transfer - subsample value of 2 and JPEG transfer, progress notification
HHP_IMAGE_TRANSFER imgTrans;// Image transfer options (override
// Make sure to set imgTrans structure size!
imgTrans.dwStructSize = sizeof( HHP_IMAGE_TRANSFER );
// Set the subsample, compression, and, since you’re specifying lossy compression (JPEG),
add the compression factor masks. You are also asking to receive both a Windows message
with progress information, as well as having the SDK update a DWORD with the percentage
of transfer completion. For the latter, it is important the DWORD not lose scope or be
deleted before the asynchronous call completes. You might have a thread or timer that
looks at this value periodically before altering the user.
// Verify the event type is barcode
if( eventType == HHP_IMAGE_EVENT )
{
// Set the HHP_IMAGE structure size and allocate a buffer for the data, set the
buffer size and how we want to receive the data in the buffer.
Image.dwStructSize = sizeof( HHP_IMAGE );
Image.puchBuffer = new BYTE[ 324000 ];// Allocate a buffer big enough to
Image.nBufferSize = 324000;// SDK wants to know how big the
Image.fileFormat = FF_BMP_GRAY;// 8 bit bmp file format data
}
// Remember to delete your buffer
delete [ ] image.puchBuffer;
don’t actually use it here.
hold 640x480x8 plus header (if BMP)
buffer is so there’s no overflow
return( 0 );
}
6 - 7
6 - 8
7
Customer Support
Product Service and Repair
Honeywell International Inc. provides service for all its products through service centers throughout the
world. To obtain warranty or non-warranty service, contact the appropriate location below to obtain a
Return Material Authorization number (RMA #) before returning the product.