Unitech PA600 Owner's manual

PA600
Programming Manual
V 1.6 1/11/2008

- 2
1. INTRODUCTION.................................................................................................................6
1.1 How to download data from scanner.......................................................................................................................6
1.2 COM definition for PA600............................................................................................................................................7
2. USI.DLL – UNITECH SCANNER INTERFACE DLL...........................................................8
2.1. Register the application to the USI DLL..................................................................................................................8
2.2. Unregister the application from the USI.DLL.......................................................................................................10
2.3. Enable / Disable Scanner........................................................................................................................................... 10
2.4. Reset Scanner.............................................................................................................................................................. 10
2.5. Get error code .............................................................................................................................................................. 10
2.6. Returns the system error code................................................................................................................................10
2.7. Get scan data................................................................................................................................................................ 11
2.8. Get length of scanned data....................................................................................................................................... 12
2.9. Get Symbology name ................................................................................................................................................. 12
2.10. Clear scan data system buffer.............................................................................................................................13
2.11. Good read indicator................................................................................................................................................ 13
2.12. Wait for acknowledgement of the last sent command.................................................................................. 13
2.13. Save setting to profiles..........................................................................................................................................13
2.14. Save scanner setting into specified file.............................................................................................................14
2.15. Change scanner setting from specified setting profile................................................................................. 14
2.16. Automatically enable scanner beam with pressing trigger key.................................................................. 14
2.17. Stop auto scanning function................................................................................................................................14
2.18. Check if auto scanning is enable........................................................................................................................14
2.19. Check if Scan2Key.exe program is running or not......................................................................................... 15
2.20. Test if Scan2Key is enabled..................................................................................................................................15
2.21. Load/Unload Scan2Key.exe.................................................................................................................................. 15
2.22. Enable/Disable Scan2Key .....................................................................................................................................15
2.23. Send scanner command to decoding chip....................................................................................................... 16

- 3
2.24. Only send single command decoding chip...................................................................................................... 16
2.25. Send command to decoding chip ....................................................................................................................... 16
2.26. Send scanner command set to decoding chip................................................................................................ 17
2.27. Get scanner command set from decoding chip.............................................................................................. 17
2.28. Send scanner command set string to decoding chip.................................................................................... 17
2.29. Get scanner command set string from decoding chip.................................................................................. 18
2.30. Get scanner related version information...........................................................................................................18
2.31. Enable prompt warming message from USI..................................................................................................... 18
2.32. Scanner working mode (available for 2D model)............................................................................................18
2.33. Get image (available for 2D model)..................................................................................................................... 19
2.34. Resize image (available for 2D model)............................................................................................................... 19
2.35. Save image to file (available for 2D model) ......................................................................................................19
2.36. Get terminator ..........................................................................................................................................................19
2.37. Set terminator...........................................................................................................................................................20
2.38. Get good read sound mode and sound name ................................................................................................. 20
2.39. Set good read sound mode and sound name.................................................................................................. 20
2.40. Set previewsize (only for 2D engine)..................................................................................................................20
2.41. Set previewsize time-out (only for 2D engine)................................................................................................. 20
2.42. Set good read sound mode and sound name.................................................................................................. 21
3. CONTROL COMMAND FOR DECODER CHIP................................................................22
4. SCANNER3.DLL – BACKWARD COMPATIBLE API FOR PT930/PT930S’S
SCANNER3.DLL........................................................................................................................27
4.1. Enable Decoder............................................................................................................................................................27
4.2. Disable Decoder...........................................................................................................................................................27
4.3. Check barcode input .................................................................................................................................................. 27
4.4. Read barcode data......................................................................................................................................................28
4.5. Get DLL version no..................................................................................................................................................... 28
4.6. Reset all symbologies to default.............................................................................................................................28

- 4
5. SCANKEY3.DLL – BACKWARD COMPATIBLE API FOR PT930/PT930S’S
SCANKEY3.DLL........................................................................................................................29
5.1. Enable Decoder............................................................................................................................................................29
5.2. Disable Decoder...........................................................................................................................................................29
5.3. Get DLL version no..................................................................................................................................................... 29
5.4. Disable laser trigger key............................................................................................................................................29
5.5. Enable laser trigger key............................................................................................................................................. 29
5.6. Reset all symbologies to default.............................................................................................................................29
6. SYSIOAPI.DLL .................................................................................................................30
6.1. Keypad Related Functions........................................................................................................................................ 30
6.1.1. Disable/enable power button ............................................................................................................................... 30
6.1.2. Set keypad utility input mode............................................................................................................................... 30
6.1.3. Get keypad utility input mode............................................................................................................................... 30
6.1.4. Check Alpha key is pressing................................................................................................................................30
6.1.5. Check Function Key status................................................................................................................................... 31
6.1.6. Enable/Disable Function Key............................................................................................................................... 31
6.2. Scanner Related Functions.......................................................................................................................................31
6.2.1. Enable/Disable Scanner trigger key ................................................................................................................... 31
6.2.2. Turn on/off Scan Engine....................................................................................................................................... 31
6.2.3. Get Trigger keys Status........................................................................................................................................ 31
6.2.4. Get Scanner Status............................................................................................................................................... 32
6.2.5. Check Trigger key is pressing ............................................................................................................................. 33
6.3. LED related function................................................................................................................................................... 33
6.4. LCD/Backlight related function................................................................................................................................34
6.4.1. Screen Backlight Control...................................................................................................................................... 34
6.4.2. Get Screen Backlight Status................................................................................................................................34
6.4.3. Keypad Backlight Control..................................................................................................................................... 34
6.4.4. Get Keypad Backlight Status............................................................................................................................... 34
6.4.5. Screen Backlight Brightness Control.................................................................................................................. 35
6.4.6. Enable/Disable LCD screen................................................................................................................................. 35
6.5. SD slot related functions........................................................................................................................................... 36
6.5.1. Inquire SD slot status............................................................................................................................................ 36
6.5.2. Enable/Disable SD slot......................................................................................................................................... 36
6.6. Enable/Disable Vibration...........................................................................................................................................36
6.7. WiFi module related functions................................................................................................................................. 37
6.7.1. Inquire WiFi module status................................................................................................................................... 37
6.7.2. Enable/Disable WiFi module status.................................................................................................................... 37
6.8. Bluetooth related API ................................................................................................................................................. 38
6.8.1. Enable/Disable Bluetooth Power status............................................................................................................. 38
6.8.2. Get BT Power Status............................................................................................................................................. 38

- 5
7. BlueTooth relative API - BTAPI.DLL ..............................................................................39
7.1. Enable/Disable Bluetooth Power status...................................................................................................39
7.2. Get BT Power Status..................................................................................................................................39
8. DYNAMIC LOAD DLL.......................................................................................................40
9. USEFUL FUNCTION CALL - WITHOUT INCLUDE SYSIOAPI.DLL................................41
9.1. Warm-boot, Cold-boot and power off..................................................................................................................... 41
9.2. GET DEVICE ID.............................................................................................................41
10. UPDATE NOTES .................................................... ERROR! BOOKMARK NOT DEFINED.

- 6
1. Introduction
1.1 How to download data from scanner
The major difference between the PA600 and a standard HPC/PalmPC is barcode input
capability. The WinCE Reference Manual contains no information regarding barcode input.
This section will introduce the programming structure of the barcode sub-system and the
programming utility library for the PA600. Inside the PA600 there is an advanced decoding
chip to control SE950 laser engine and to handle barcode decoding. Below is system
diagram for the PA600 barcode:
According to the above diagram, the PA600 communicates with Decoder Chip by mean of
serial port COM4. Its communication parameter is fixed on 38400,N,8.1. Normally, the
Decoder Chip is in sleep mode when COM4 is not activated. When COM4 is activated, the
Decoder Chip will start working, and it will decode the barcode “signal” from the laser engine
when the trigger key is pressed. After decoding, barcode data and its symbology type will
be sent directly to PA600.
Many programmers find it difficult to control the Decoder Chip via programming language
alone, especially if they are not familiar with barcode and serial port controls. Because of
this, Unitech provides the following utility library and program for the user or application
programmer to control the Decoder Chip:
1.Application program “Scan2Key.exe” is a useful application program that can read
input data from the laser scanner and then directly input the data into PA600’s
keyboard buffer. “Scan2Key.exe” makes barcode data input simple, and can be
especially valuable to those programmers not familiar with COM port programming.
User program simply reads the barcode data from the keyboard. For barcode
symbologies setting, you can run Scanner Setting from Control Panel to define all of
supporting symbologies and delimiter.
2.Utility library:
For programming control, PA600 provides USI.DLL to let user control scanner input,
symbologies setting and profile controlling. Please refer to 2 for detail API lists.
USI.DLL is Unitech’s new scanner function library on PA600. For backward compatible
issue, Unitech still provide Scanner3.DLL and ScanKey3.DLL for existing
PT930/PT930SA user to port their software into PA600, but several APIs on
Scanner3.DLL and ScanKey3.DLL have already been removed on PA600. User can
refer to 0and 5 for detail supporting API.
CPU
COM1Advanced
Decoder
Chip
SE950
Laser
Engine

- 7
1.2 COM definition for PA600
COM 0 USB to serial
COM 1 Reserve
COM 2 Bluetooth
COM 3 IrDAComm
COM 4 Scanner (Hamster)
COM 5 BTModem
COM 6 USB client
COM 7 Reserve
COM 8 Reserve
COM 9 RawIR

- 8
2. USI.DLL – Unitech Scanner Interface DLL
Note : For PA600 programming, it need to dynamically load DLL for using Unitech built-in DLL (Unitech
will not provide *.H and *.LIB for compiler for mobile 5.0 OS), please refer to Chapter 8 for
programming guide.
2.1. Register the application to the USI DLL
Function Description:
Register the application to the USI DLL, so that the DLL can communicate with the application. It
will also open and initial scanner port (COM4, for example) and set the scanner to the working
mode. The application should call USI_Unregister to unregister from the DLL after done with the
scanner.
Function call:
BOOL USI_Register(HWND hwnd, UINT msgID);
Parameter: (input)
hwnd: Handle of the window to which USI DLL will send messages to report all activities,
including error messages, scan data ready, etc.
msgID: Specifies the message to be posted. DLL will post messages by calling:
PostMessage(hwnd, msgID, msg, param).
The window procedure will receive custom message about msgID and wParam parameter
can be one of the followings:
SM_ERROR_SYS Indicates a system error, which is caused by a call to the system
function. Param contains the error code from GetLastEror().
SM_ERROR Indicates an error. Param contains the cause of error, which can
be on of followings:
SERR_INVALID_HWND Invalid window handle.
SERR_INVALID_MSGID msgID cannot be 0.
SERR_OPEN_SCANNER Open or initial scanner port failed.
SERR_CHECKSUM Checksum error in received packet.
SERR_DATALOST New scan data is lost because data buffer is not
empty.
SERR_BUFFEROVERFLOW Data buffer overflow. The default size is 4K bytes.
SM_REPLY Indicates received a reply. All the responses from the scanner
except the scan data will be notified by this message.
SM_DATAREADY Indicates that scan data is successfully decoded and ready to
retrieve.
SM_ACK Indicates received a ACK.
SM_NAK Indicates received a NAK.
SM_NOREAD Indicates received a No-Read packet.
Note: Scanner port settings are defined in registry as described below:
[HKEY_LOCAL_MACHINE\SOFTWARE\Unitech America Inc.\Scanner\Settings]
"COMPORT"="COM4:"
"BAUDRATE"="38400"
"STOPBITS"="1"
"PARITY"="None"
"CHECKPARITY"="1"

- 9

-
2.2. Unregister the application from the USI.DLL
Function Description:
Unregister the application from the DLL. It will close the scanner port, and by default it will disable
the scanner.
Function call:
void USI_Unregister();
2.3. Enable / Disable Scanner
Function Description:
To start or stop USI function. This function is useful for application to temporarily stop scanner
function if it is only need keypad input or keep clear input buffer.
Function call:
BOOL USI_EnableScan(BOOL bStatus);
Parameter: (input)
bStatus:TRUE : Enable Scanner
FALSE : Disable Scanner
Return:
BOOL : TRUE : OK
FALSE : Failure
2.4. Reset Scanner
Function Description:
Set the scanner to the working mode, and reset the communication control.
Function call:
BOOL USI_Reset();
Return:
Always TRUE
2.5. Get error code
Function Description:
Returns the error code (SERR_***).
Function call:
DWORD USI_GetError();
Return:
Returns the error code (SERR_***), which has been described in USI_Register function.
2.6. Returns the system error code
Function Description:
Returns the system error code, which is returned by GetLastError. It will also return the description
of the error in buffer if it is not NULL.
Function call:
DWORD USI_GetLastSysError(LPTSTR buffer, int len);
Return:
Returns the system error code, which is returned by system function GetLastError. It will also return
the description of the error in buffer retrieved by system function FormatMessage if it is not NULL.
For a complete list of error codes, refer to the SDK header file WINERROR.H.

-
2.7. Get scan data
Function Description:
Retrieves the scan data into the buffer. USI_GetData returns data in buffer in ASCII code, while
USI_GetData2 returns in Unicode. Parameter len specifies the maximum length of the buffer.
Returns the length of characters. It also returns the barcode type if type is not NULL. Return 0
means that the buffer is too short to hold the data.
The scanner will be disabled when scanner successfully decoded a data, so the data is protected
from been destroyed by trying continuously scanning. Call USI_GetData / USI_GetData2 or
USI_ResetData will automatically enable the scanner.
USI_GetData should be called when SM_DATAREADY message is received. Or call
USI_ResetData to discard the data. Both of them will reset the data buffer and enable scanner, so
that next scan data can come in.
If the data buffer is not empty and a new scan data occurs, it will be discarded and an error
message SM_ERROR with code of SERR_DATALOST will be sent.
For a complete list of barcode types, refer to the header file USI.H for the predefined data with
BCT_ prefix
Function call:
UINT USI_GetData(LPBYTE buffer, UINT len, UINT* type);
UINT USI_GetData2(LPTSTR buffer, UINT len, UINT* type);
Parameter: (input)
len: UINT : Len specifies the maximum length of the buffer.
Parameter: (output)
buffer: LPBYTE : Data buffer for storing scanned data
type: UINT : barcode type which is defined on USI.H. Please refer to below list
BCT_CODE_39 // Code 39
BCT_CODABAR // CodaBar
BCT_CODE_128 // Code 128
BCT_INTERLEAVED_2OF5 // Interleaves 2 of 5
BCT_CODE_93 // Code 93
BCT_UPC_A // UPC A
BCT_UPC_A_2SUPPS // UPC A with 2 Supps
BCT_UPC_A_5SUPPS // UPC A with 5 Supps
BCT_UPC_E0 // UPC E
BCT_UPC_E0_2SUPPS // UPC E with 2 Supps
BCT_UPC_E0_5SUPPS // UPC E with 5 Supps
BCT_EAN_8 // EAN 8
BCT_EAN_8_2SUPPS // EAN 8 with 2 Supps
BCT_EAN_8_5SUPPS // EAN 8 with 5 Supps
BCT_EAN_13 // EAN 13
BCT_EAN_13_2SUPPS // EAN 13 with 2 Supps
BCT_EAN_13_5SUPPS // EAN 13 with 5 Supps
BCT_MSI_PLESSEY // MSI Plessey
BCT_EAN_128 // EAN 128
BCT_UPC_E1 // UPC E1
BCT_UPC_E1_2SUPPS // UPC E1 with 2 Supps
BCT_UPC_E1_5SUPPS // UPC E1 with 5 Supps
BCT_TRIOPTIC_CODE_39 // TRIOPTIC CODE 39
BCT_BOOKLAND_EAN // Bookland EAN
BCT_COUPON_CODE // Coupon Code
BCT_STANDARD_2OF5 // Standard 2 of 5
BCT_CODE_11_TELPEN // Code 11 Telpen
BCT_CODE_32 // Code 32
BCT_DELTA_CODE // Delta Code

-
BCT_LABEL_CODE // Label Code IV & V
BCT_PLESSEY_CODE // Plessey Code
BCT_TOSHIBA_CODE // Toshiba Code China Postal Code
Return:
UINT : Data length
2.8. Get length of scanned data
Function Description:
Returns the data length of the scan data. When allocate the memory to hold the scan data, add at
least one additional byte for string terminator.
Function call:
UINT USI_GetDataLength();
Return:
UNIT : Data length
2.9. Get Symbology name
Function Description:
Returns the barcode name of the type
Function call:
LPCTSTR USI_GetBarcodeName(UINT type, LPBYTE buffer, UINT len);
Parameter: (input)
type: UINT : barcode type. (refer to below definition)
buffer: LPBYTE : Please refer to below table
Type Buffer
BCT_CODE_39 Code 39
BCT_CODABAR Codabar
BCT_CODE_128 Code 128
BCT_INTERLEAVED_2OF5 Interleaved 2 of 5
BCT_CODE_93 Code 93
BCT_UPC_A UPC A
BCT_UPC_A_2SUPPS UPC A with 2 Supps.
BCT_UPC_A_5SUPPS UPC A with 5 Supps.
BCT_UPC_E0 UPC E
BCT_UPC_E0_2SUPPS UPC E with 2 Supps.
BCT_UPC_E0_5SUPPS UPC E with 5 Supps.
BCT_EAN_8 EAN 8
BCT_EAN_8_2SUPPS EAN 8 with 2 Supps.
BCT_EAN_8_5SUPPS EAN 8 with 5 Supps.
BCT_EAN_13 EAN 13
BCT_EAN_13_2SUPPS EAN 13 with 2 Supps.
BCT_EAN_13_5SUPPS EAN 13 with 5 Supps.
BCT_MSI_PLESSEY MSI Plessey
BCT_EAN_128 EAN 128
BCT_TRIOPTIC_CODE_39 Trioptic Code 39
BCT_BOOKLAND_EAN Bookland EAN
BCT_COUPON_CODE Coupon Code
BCT_STANDARD_2OF5 Standard 2 of 5
BCT_CODE_11_TELPEN Code 11 or Telpen
BCT_CODE_32 Code 32 (Pharmacy Code)
BCT_DELTA_CODE Delta Code
BCT_LABEL_CODE Label Code IV & V
BCT_PLESSEY_CODE Plessey Code
BCT_TOSHIBA_CODE Toshiba Code (China Postal Code)
len: UINT : length of string on the 2nd parameter buffer

-
Return:
BOOL : TRUE : OK
FALSE : Failure
2.10.Clear scan data system buffer
Function Description:
Enable scanner and reset the data buffer so that next new scan data can come in.
Function call:
void USI_ResetData();
2.11.Good read indicator
Function Description:
Inform a good receiving of scan data, this will play a sound (wave file scanok.wav) and light the
LED lasting for 1 second.
Function call:
void USI_ReadOK();
Note:
USI will call the function GoodReadLEDOn function exported by the DLL defined in the registry
described below (UPI300.DLL is an example) to turn on and off the LED. If the DLL is not defined or
the function is not found, USI will bypass the call of GoodReadLEDOn.
[HKEY_LOCAL_MACHINE\SOFTWARE\Unitech America Inc.\Scanner\Settings]
"DLLLEDCONTROL"="UPI300.DLL"
The function prototype of GoodReadLEDOn is:
VOID WINAPI GoodReadLEDOn(BOOL fon);
Turn on when fon is TRUE, and turn off when fon is FALSE.
2.12.Wait for acknowledgement of the last sent command
Function Description:
Wait for acknowledgement of the last sent command until timeout. It is useful when a serial of
commands needs to be sent at a time. Before call USI_SendCommand, call
USI_WaitForSendEchoTO to make sure that the previous command is done.
Function call:
BOOL USI_WaitForSendEchoTO(DWORD timeout);
Parameter: (input)
timeout: DWORD : Specifies the timeout in millisecond.
Return:
Returns FALSE if timeout.
2.13.Save setting to profiles
Function Description:
Save current settings of scanner so that the settings will be persistent when the unit get power off
and on again.
Function call:
BOOL USI_SaveCurrentSettings();
Return:
TRUE if success, otherwise FALSE.

-
2.14.Save scanner setting into specified file
Function Description:
Save the current settings to file. The file takes “*.USI"as extension name.
Function call:
BOOL USI_SaveSettingsToFile(LPCTSTR filename);
Parameter: (input)
filename: LPCTSTR : file name for setting profile
Return:
TRUE = success
FALSE = error
2.15.Change scanner setting from specified setting profile
Function Description:
Load and activate the settings from file.
Function call:
BOOL USI_LoadSettingsFromFile(LPCTSTR filename, BOOL formulaOnly);
Parameter: (input)
filename: LPCTSTR : name of scanner setting profile (*.USI)
formulaOnly: BOOL : if TRUE, only data editing formulas are load. The other settings
remain unchanged
Return:
TRUE = success
FALSE = error
2.16.Automatically enable scanner beam with pressing trigger key
Function Description:
Start auto scanning. Scan engine will be automatically triggerrd on.
Function call:
BOOL USI_StartAutoScan(DWORD interval);
Parameter: (input)
interval: DWORD : Specifies the interval in milli-second
Note:
USI will call the function SetScannerOn function exported by the DLL defined in the registry
described below (UPI300.DLL is an example) to start and stop the scanner. If the DLL is not
defined or the function is not found, then auto scanning is not available.
[HKEY_LOCAL_MACHINE\SOFTWARE\Unitech America Inc.\Scanner\Settings]
"DLLSCANNERCONTROL"="UPI300.DLL"
The function prototype of SetScannerOn is:
VOID WINAPI SetScannerOn(BOOL fon);
Start when fon is TRUE, and stop when fon is FALSE.
2.17.Stop auto scanning function
Function Description:
Stop auto scanning
Function call:
void USI_StopAutoScan();
2.18.Check if auto scanning is enable
Function Description:
Check if auto scanning function is enabled or not
Function call:
BOOL USI_IsAutoScanning();
Return:
BOOL: TRUE : auto-scanning is running
FALSE : auto-scanning is disabled.

-
2.19.Check if Scan2Key.exe program is running or not
Function Description:
Test whether Scan2Key application is running at background. (It doesn't mean Scan2Key is
routing scanner input to keyboard, please call S2K_IsEnabled() to check if routing function is
enable or not)
Function call:
HWND S2K_IsLoaded();
Return:
NULL: Scan2Key is not running
Non-NULL: indicates scan2key is running. It actually returns window handle for scan2key, but
it is for internal use –send messages.
2.20.Test if Scan2Key is enabled
Function Description:
Test whether Scan2Key is enabled. Scan2Key routes scanning input from scanner to keypad
buffer, so that barcode data can be input as like from keystrokes on keypad.
Function call:
BOOL S2K_IsEnabled();
Return:
TRUE = enabled.
FALSE = disable
2.21.Load/Unload Scan2Key.exe
Function Description:
Load or unload Scan2Key
Function call:
BOOL S2K_Load(BOOL load, DWORD timeout);
Parameter: (input)
load: BOOL : TRUE = load Scan2Key
FALSE = unload Scan2Key
timeout: DWORD : when unload Scan2Key, it will wait until Scan2Key has been
removed from memory or timeout specified by this parameter.
Return:
TRUE = successfully loaded.
2.22.Enable/Disable Scan2Key
Function Description:
Enable or disable Scan2Key to put scanned data to standard keyboard input buffer. Scan2Key is
enabled by default.
Function call:
BOOL S2K_Enable(BOOL enable, DWORD timeout);
Parameter: (input)
enable: BOOL : TRUE = Enable scanned data to keyboard buffer
FALSE = Disable scanned data to keyboard
timeout: DWORD : when enable or disable Scan2Key, it will wait until Scan2Key has
been removed from memory or timeout specified by this parameter.
Return:
TRUE = if successfully enabled Scan2Key, otherwise FALSE

-
2.23.Send scanner command to decoding chip
Function Description:
Send scanner command to decoder chip. This command will send a serial of bytes to decoder chip
as following: (Esc and BCC will be calculated and added automatically)
Esc, high-length, low-length, command-ID, operation, set, BCC
Please refer to complete command reference on section 4
BOOL HAM_SendCommand(BYTE highlen, BYTE lowlen, BYTE cmdID, BYTE op, BYTE set);
Parameter: (input)
highlen: BYTE : high byte of command length
lowlen: BYTE : low byte of command length
cmdID: BYTE : command ID
op: BYTE : operation mode for this command
set: BYTE : operand for this command
Return:
TRUE = Indicates the command has been successfully sent to queue to output.
2.24.Only send single command decoding chip
Function Description:
Send command to decoder chip. This is a variation of command HAM_SendCommand. It sends
following command to Hamster: (note, only two bytes without BCC)
Esc, 0x80+cmd
Function call:
BOOL HAM_SendCommand1(BYTE cmd);
Parameter: (input)
cmd: BYTE : command
Return:
TRUE = indicates the command has been successfully sent to queue to output.
2.25.Send command to decoding chip
Function Description:
Send command to decoder chip. This is a variation of command HAM_SendCommand. It will read
a number of parameters and packet them as in following format and send it to decoder chip.
Esc, parameter1, parameter2, …, BCC
The total number of parameters is specified by first parameter num.
Function call:
BOOL HAM_SendCommand2(BYTE num, BYTE parameter1, …);
Parameter: (input)
num: BYTE : number of total parameters
parameterx: BYTE : Parameter
Return:
TRUE = indicates the command has been successfully sent to queue to output.

-
2.26.Send scanner command set to decoding chip
Function Description:
This function call has the same function as HAM_SendCommand except that it takes a single
WORD parameter for the length and an extra timeout parameter. This is a synchronized function, it
returns when command has been sent to and got response from scanner.
USI_WaitForSendEchoTO is not needed before a next continuous send command call.
To send a string please call HAM_SendCommand_SetString.
BOOL HAM_SendCommand_Set(WORD len, BYTE cmdID, BYTE op, BYTE set, DWORD timeout)
Parameter: (input)
len: BYTE : Specifies length of command, which is actually always be 4.
cmdID: BYTE : command ID
op: BYTE : operation mode for this command
set: BYTE : operand for this command
timeout: DWORD : Specifies the timeout in millisecond
Return:
TRUE = indicates the setting has been set successfully.
2.27.Get scanner command set from decoding chip
Function Description:
This function call has the similar function as HAM_SendCommand_Set except that it retrieves
setting from scanner. This is a synchronized function, it returns when command has been sent to
and got response from scanner. USI_WaitForSendEchoTO is not needed before a next continuous
send command call.
BOOL HAM_SendCommand_Get(WORD len, BYTE cmdID, BYTE op, BYTE* get, DWORD
timeout)
Parameter: (input)
len: BYTE : Specifies length of command, which is actually always be 4.
cmdID: BYTE : command ID
op: BYTE : operation mode for this command
get: BYTE* : Pointer to a byte which will hold the setting retrieved from
scanner.
timeout: DWORD : Specifies the timeout in millisecond
Return:
TRUE = indicates the setting has been retrieve successfully.
2.28.Send scanner command set string to decoding chip
Function Description:
This function call has the same function as HAM_SendCommand_Set except that it sends a serial
of data instead of a single byte to scanner.
BOOL HAM_SendCommand_SetString(WORD len, BYTE cmdID, BYTE op, LPCSTR sets, int slen,
DWORD timeout)
Parameter: (input)
len: BYTE : Specifies length of command, which will be calculated and
adjusted automatically
cmdID: BYTE : command ID
op: BYTE : operation mode for this command
sets: LPCSTR : Specifies the string data
slen: int : Specifies the length of string data. Set to -1 to calculate
automatically
timeout: DWORD : Specifies the timeout in millisecond
Return:
TRUE = indicates the setting has been set successfully.

-
2.29.Get scanner command set string from decoding chip
Function Description:
This function call has the similar function as HAM_SendCommand_SetString except that it retrieves
setting from scanner
BOOL HAM_SendCommand_GetString(WORD len, BYTE cmdID, BYTE op, LPSTR gets, int* slen,
DWORD timeout)
Parameter: (input)
len: BYTE : Specifies length of command, which will be calculated and
adjusted automatically
cmdID: BYTE : command ID
op: BYTE : operation mode for this command
gets: LPSTR : Buffer which will hold the setting retrieved from scanner
slen: int* : Specifies the length of buffer and returns actual data length in the
buffer
timeout: DWORD : Specifies the timeout in millisecond
Return:
TRUE = indicates the setting has been retrieve successfully.
2.30.Get scanner related version information
Function Description:
Get Scanner related version information. It does not need to call USI_Register to use this function.
Function call:
BOOL USI_GetScannerVersion(LPTSTR model, LPTSTR firmware, LPTSTR sdk, int blen);
Parameter: (output)
model: LPTSTR : scanner model.
firmware: LPTSTR : firmware version number.
sdk: LPTSTR : sdk version number if available.
blen: int : specifies buffer length for parameters of model, firmware and
sdk.
Return:
Always True.
2.31.Enable prompt warming message from USI
Function Description:
Enables USI to report working information in a popup window
Function call:
BOOL USI_EnablePromptMessage(BOOL enable);
Parameter: (output)
enable: BOOL : True= enable, Fail:Disable
Return:
Always True.
2.32.Scanner working mode (available for 2D model)
Function Description:
Sets scanner engine to working mode of barcode decoding/Image/Preview (mode =
SWM_BARCODE) or image capture (mode = SWM_IMAGE) or preview and image capture (mode
= SWM_IMAGE_PREVIEW) for 2D scanner
Function call:
BOOL USI_SetWorkingMode(int mode);
Parameter: (output)
mode: int : mode = SWM_BARCODE –Barcode
mode = SWM_IMAGE –image capture
mode = SWM_IMAGE_PREVIEW –preview and image capture
for 2D scanner
Return:
Always True.

-
2.33.Get image (available for 2D model)
Function Description:
Retrieves captured image in bitmap format, and returns image size.
Function call:
HBITMAP USI_GetImageBitmap(SIZE* imagesize);
Parameter: (output)
imagesize: SIZE : Bitmap image size
Return:
HBITMAP : image
2.34.Resize image (available for 2D model)
Function Description:
Resizes a bitmap.
Function call:
HBITMAP USI_ResizeBitmap(HBITMAP hbmp, int cx, int cy, BOOL keepratio);
Parameter: (input)
hbmp: HBITMAP : the bitmap handle needs to be resized.
cx: int: : cx define new width dimension of the bmp.
cy int: : cy define new height dimension of the bmp.
keepratio: BOOL: : If keepratio is true, it will resize the bmp to fit the cx-cy
rectangle and keep the ratio of the original image.
Return:
HBITMAP : image
2.35.Save image to file (available for 2D model)
Function Description:
Saves captured image to a file. The image format is determined by the file extension name, which
can be .bmp, .jpg, .jpeg, .tif, .tiff or .raw. The compressionfactor is used for jpeg format.
Function call:
BOOL USI_SaveImageToFile(LPCTSTR filename, int compressionfactor);
Parameter: (input)
filename: LPCTSTR : File extension name defines format. HHP, SSI
support .bmp, .jpg, and .tif. Tohken supports .bmp and .jpg.
compressionfactor: int : compressionfactor is used for when format is jpg.
Return:
Always True.
2.36.Get terminator
Function Description:
Returns terminator. The returned constant value is defined in USI_SetTerminator.
Function call:
int USI_GetTerminator();
Return:
Int : terminator

-
2.37.Set terminator
Function Description:
Sets terminator.
Function call:
BOOL USI_SetTerminator(int terminator);
Parameter: (input)
terminator: int : TERMINATOR_ENTER : enter (CR/LF)
TERMINATOR_RETURN : return (CR)
TERMINATOR_LINEFEED : linefeed (LF)
TERMINATOR_NONE : no terminator
TERMINATOR_ENTERENTER : double enter (CR/CR)
Return:
Always True.
2.38.Get good read sound mode and sound name
Function Description:
Returns Good-Read-Echo mode and sound file name.
Function call:
int USI_GetGoodReadEcho(LPTSTR buffer, UINT blen);
Parameter: (input)
buffer: LPTSTR : returns sound file name which included path
blen: UINT : defines length of the buffer.
Return:
Int: GRE_PLAYSOUND : Play pre-set sound file
GRE_BEEP : Play default beep sound
GRE_NONE : No sound.
2.39.Set good read sound mode and sound name
Function Description:
Sets Good-Read-Echo mode and sound file name.
Function call:
BOOL USI_SetGoodReadEcho(int mode, LPTSTR SoundFileName);
Parameter: (input)
mode: int : GRE_PLAYSOUND : Play pre-set sound file
GRE_BEEP : Play default beep sound
GRE_NONE : No sound.
buffer: LPTSTR : sound file name which included path
Return:
It returns true when successful, false if mode is n/a.
2.40.Set previewsize (only for 2D engine)
Function Description:
Defines how large is the window for image preview.
Function call:
void USI_SetPreviewSize (SIZE size);
Parameter: (input)
size: SIZE : Size of image preview window
2.41.Set previewsize time-out (only for 2D engine)
Function Description:
Set timeout for preview in seconds. When in taking image preview mode, this timeout will stop
preview and trigger to capture the image.
Function call:
void USI_SetPreviewTimeout (DWORD timeout);
Parameter: (input)
timeout: DWORD : timeout in seconds
Other manuals for PA600
13
Table of contents
Other Unitech PDA manuals

Unitech
Unitech EA320 User manual

Unitech
Unitech PA690 User manual

Unitech
Unitech PA600 User manual

Unitech
Unitech PA768 Series User manual

Unitech
Unitech PA982 User manual

Unitech
Unitech PT630 Instruction Manual

Unitech
Unitech PA600 User manual

Unitech
Unitech PA760 User manual

Unitech
Unitech RH767 User manual

Unitech
Unitech PA520BTNF User manual

Unitech
Unitech PA960 User manual

Unitech
Unitech EA520 User manual

Unitech
Unitech PA960 User manual

Unitech
Unitech PA690 User manual

Unitech
Unitech PT630 User manual

Unitech
Unitech PA500II User manual

Unitech
Unitech EA320 User manual

Unitech
Unitech PA760 User manual

Unitech
Unitech PA600 User manual

Unitech
Unitech PA600BT User manual