The text of a manual · part 1 of 5
HT660/PA96x/PA982/RH767 Programming Manual, pages 1 to 10
Pages 1 to 10 of 46
The original document is the PDF (173 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Unitech PA966
Page 1
unitech
HT660/PA96x/PA982/RH767 Programming Manual
V 1.7 2008-01-15
Page 2
-2
1.
INTRODUCTION................................................................................................................. 6
1.1.
HOW TO DOWNLOAD DATA FROM SCANNER ........................................................... 6
1.2.
COM DEFINITION FOR HT660/PA96X/PA982/RH767 ................................................... 7
1.3.
USEFUL SAMPLE PROGRAM ....................................................................................... 7
1.4.
GET SDK FROM UNITECH?........................................................................................... 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 ......................................................................................................... 9
2.3.
Enable / Disable Scanner............................................................................................................................................. 9
2.4.
Reset Scanner ................................................................................................................................................................ 9
2.5.
Get error code ................................................................................................................................................................ 9
2.6.
Returns the system error code .................................................................................................................................. 9
2.7.
Get scan data................................................................................................................................................................ 10
2.8.
Get length of scanned data....................................................................................................................................... 11
2.9.
Get Symbology name ................................................................................................................................................. 11
2.10.
Clear scan data system buffer ............................................................................................................................. 12
2.11.
Good read indicator ................................................................................................................................................ 12
2.12.
Wait for acknowledgement of the last sent command .................................................................................. 12
2.13.
Save setting to profiles .......................................................................................................................................... 12
2.14.
Save scanner setting into specified file............................................................................................................. 13
2.15.
Change scanner setting from specified setting profile ................................................................................. 13
2.16.
Automatically enable scanner beam with pressing trigger key .................................................................. 13
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......................................................................................... 14
2.20.
Test if Scan2Key is enabled.................................................................................................................................. 14
Page 3
2.21.
Load/Unload Scan2Key.exe .................................................................................................................................. 14
2.22.
Enable/Disable Scan2Key ..................................................................................................................................... 15
2.23.
Send scanner command to decoding chip ....................................................................................................... 15
2.24.
Only send single command decoding chip ...................................................................................................... 15
2.25.
Send command to decoding chip ....................................................................................................................... 16
2.26.
2D imager supporting for PA966/967 ................................................................................................................. 16
3.
CONTROL COMMAND FOR DECODER CHIP................................................................ 17
4. SCANNER3.DLL – BACKWARD COMPATIBLE API FOR PT930/PT930S’S SCANNER3.DLL........................................................................................................................ 22 4.1.
Enable Decoder............................................................................................................................................................... 22
4.2.
Disable Decoder .............................................................................................................................................................. 22
4.3.
Check barcode input ...................................................................................................................................................... 22
4.4.
Read barcode data.......................................................................................................................................................... 23
4.5.
Get DLL version no........................................................................................................................................................ 23
4.6.
Reset all symbologies to default .................................................................................................................................... 23
5. SCANKEY3.DLL – BACKWARD COMPATIBLE API FOR PT930/PT930S’S SCANKEY3.DLL........................................................................................................................ 24
-3
5.1.
Enable Decoder............................................................................................................................................................... 24
5.2.
Disable Decoder .............................................................................................................................................................. 24
5.3.
Get DLL version no........................................................................................................................................................ 24
5.4.
Disable laser trigger key ................................................................................................................................................ 24
5.5.
Enable laser trigger key ................................................................................................................................................. 24
5.6.
Reset all symbologies to default .................................................................................................................................... 24
6.
UNITECHAPI.DLL ............................................................................................................ 25
6.1.
Disable ActiveSync ......................................................................................................................................................... 25
6.2.
Enable ActiveSync.......................................................................................................................................................... 25
6.3.
Suspend ........................................................................................................................................................................... 25
6.4.
Disable TaskBar ............................................................................................................................................................. 25
Page 4
6.5.
Enable TaskBar .............................................................................................................................................................. 26
6.6.
Disable Desktop .............................................................................................................................................................. 26
6.7.
Enable Desktop............................................................................................................................................................... 26
6.8.
Disable toolbar on windows explorer ........................................................................................................................... 26
6.9.
Enable toolbar on windows explorer ............................................................................................................................ 26
6.10.
Disable Connection..................................................................................................................................................... 27
6.11.
Enable Connection ..................................................................................................................................................... 27
7.
SYSIOAPI.DLL ................................................................................................................. 28
7.1. Keypad Related Functions............................................................................................................................................. 28 7.1.1. Get CAPS lock status (This function call is reserved for OS using, it is not suggested to be used on application if you are not fully understand OS operation behavior).............................................................................................................. 28 7.1.2. Get SHIFT status (This function call is reserved for OS using, it is not suggested to be used on application if you are not fully understand OS operation behavior) .................................................................................................................... 28 7.1.3. Get keypad type (This function call is reserved for OS using, it is not suggested to be used on application if you are not fully understand OS operation behavior) .................................................................................................................... 28 7.1.4. Disable/enable power button .................................................................................................................................... 29 7.1.5. Set keypad utility input mode................................................................................................................................... 29 7.1.6. Get keypad utility input mode (For HT660 only)..................................................................................................... 29 7.1.7. Check Alpha key is pressing (For PA962/PA966/PA982 only)............................................................................... 29 7.2. Scanner Related Functions ............................................................................................................................................ 30 7.2.1. Enable/Disable Scanner trigger key ......................................................................................................................... 30 7.2.2. Turn on/off Scan Engine .......................................................................................................................................... 30 7.2.3. Get Trigger keys Status ............................................................................................................................................ 30 7.2.4. Get Scanner Status.................................................................................................................................................... 30 7.2.5. Control trigger key’s key event. ............................................................................................................................... 31 7.2.6. Check Trigger key is pressing .................................................................................................................................. 32 7.3.
LED related function................................................................................................................................................... 32
7.4. Backlight related function ......................................................................................................................................... 32 7.4.1. Screen Backlight Control ......................................................................................................................................... 32 7.4.2. Get Screen Backlight Status ..................................................................................................................................... 33 7.4.3. Keypad Backlight Control (For PA966/PA962/PA982 only) .................................................................................. 33 7.4.4. Get Keypad Backlight Status (For PA966/PA962/PA982 only).............................................................................. 33 7.4.5. Screen Backlight Brightness Control ....................................................................................................................... 33 7.5. PCMCIA/CF slot related functions .......................................................................................................................... 34 7.5.1. Get physical slot ID .................................................................................................................................................. 34 7.5.2. Enable/Disable PCMCIA or CF slot .................................................................................................................... 34 7.5.3. Enable/Disable IO slots ............................................................................................................................................ 34 7.5.4. Inquire PCMCIA/CF slot status ............................................................................................................................... 35 7.5.5. Inquire IO slot status ................................................................................................................................................ 35 7.5.6. Disable PCMCIA/CF slot when resume................................................................................................................... 35 7.6. Check battery type ...................................................................................................................................................... 36 7.7. Enable/Disable LCD screen ......................................................................................................................................... 36
-4
Page 5
8.
BLUETOOTH RELATIVE API - BTAPI.DLL..................................................................... 37 8.1. 8.2. 8.3.
9.
Enable/Disable Bluetooth Power status ................................................................................................................. 37 Get BT Power status ................................................................................................................................................. 37 DLL Version................................................................................................................................................................ 37
RH767 HF READER ......................................................................................................... 38 9.1. 9.2. 9.3. 9.4. 9.5. 9.6. 9.7. 9.8. 9.9. 9.10.
10.
Get library version ..................................................................................................................................................... 38 Connect to RFID reade ............................................................................................................................................. 38 Select Card type ........................................................................................................................................................ 38 Get Reader Information ............................................................................................................................................ 38 Antenna Control ......................................................................................................................................................... 39 Close Reader ............................................................................................................................................................. 39 Set ISO-15693 Inventory Parameter ...................................................................................................................... 39 ISO-15693 Inventory ................................................................................................................................................. 39 Get Data From Reader ............................................................................................................................................. 40 Error Code .............................................................................................................................................................. 40
RH767 UHF READER....................................................................................................... 42
10.1. Class “MPRReader”................................................................................................................................................ 42 10.2. The Parameter in MPRReader ............................................................................................................................ 42 10.3. The Parameter in MPRReader ............................................................................................................................ 43 10.3.1. Connect to RFID Reader .................................................................................................................................. 43 10.3.2. Disconnect with RFID Reader ......................................................................................................................... 43 10.3.3. Clear All Tags In The Reader .......................................................................................................................... 43 10.3.4. The Event in MPRReader................................................................................................................................. 43
11.
USEFUL FUNCTION CALL – WITHOUT INCLUDE SYSIOAPI.DLL............................... 44
11.1.1.
-5
Warm-boot. Cold-boot and power off.............................................................................................................. 44
12.
GET DEVICE ID ................................................................................................................ 45
13.
GET OEM INFO ................................................................................................................ 45
14.
UPDATE NOTES .............................................................................................................. 46
Page 6
1. Introduction 1.1. How to download data from scanner The major difference between the HT660/PA96x/PA982 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 subsystem and the programming utility library for the HT660/PA96x/PA982. Inside the HT660/PA96x/PA982 there is an advanced decoding chip to control SE900 laser engine and to handle barcode decoding. Below is system diagram for the HT660/PA96x/PA982 barcode: Laser Engine
Advanced Decoder Chip
COM2
CPU
According to the above diagram, the HT660/PA96x/PA982 communicates with Decoder Chip by mean of serial port COM2. Its communication parameter is fixed on 38400,N,8.1. Normally, the Decoder Chip is in sleep mode when COM2 is not activated. When COM2 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 HT660/PA96x/PA982. 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 HT660/PA96x/PA982’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, HT660/PA96x/PA982 provide 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 HT660/PA96x/PA982. For backward compatible issue, Unitech still provide Scanner3.DLL and ScanKey3.DLL for existing PT930/PT930SA user to port their software into HT660/PA96x/PA982, but several APIs on Scanner3.DLL and ScanKey3.DLL have already been removed on HT660/PA96x/PA982. User can refer to 0and 5 for detail supporting API.
-6
Page 7
1.2. COM definition for HT660/PA96x/PA982/RH767 COM 1 COM 2 COM 3 COM 4 COM 5 COM 6 COM 7 COM 8 COM 9
Physical full RS232 port (ActiveSync) Scanner (Hamster) or RFID reader IrComm USB client IrDA or Bluetooth Reserve Bluetooth Printer Bluetooth Modem Bluetooth ActiveSync
1.3. Useful Sample program You can get useful sample program for VC, C# and VB.NET from below URL HT660 series C# http://w3.tw.ute.com/pub/cs/software/Sample_Program/HT660/c_sharp/c_sharp_sample.zip Vb.net http://w3.tw.ute.com/pub/CS/software/Sample_Program/HT660/VB.NET/VB.NET_sample.zip C++ http://w3.tw.ute.com/pub/CS/software/Sample_Program/HT660/evc/evc_sample.zip PA96x/PA982 series C# http://w3.tw.ute.com/pub/cs/software/Sample_Program/PA962/c_sharp/c_sharp_sample.zip Vb.net http://w3.tw.ute.com/pub/CS/software/Sample_Program/PA962/VB.NET/VB.NET_sample.zip C++ http://w3.tw.ute.com/pub/CS/software/Sample_Program/PA962/evc/evc_sample.zip
1.4. Get SDK from Unitech? You can get SDK from below URL HT660 PA962/963 PA966/967 PA982 RH767
-7
SDK http://w3.tw.ute.com/pub/cs/sdk/ht660/HT660SDK.zip SDK http://w3.tw.ute.com/pub/cs/sdk/pa962/pa962sdk.zip SDK http://w3.tw.ute.com/pub/cs/sdk/pa966/pa966sdk.zip SDK http://w3.tw.ute.com/pub/cs/sdk/pa982/Pa982SDK.zip SDK http://w3.tw.ute.com/pub/cs/sdk/RH767/RH767_CE5_SDK.zip
Page 8
2. USI.DLL – Unitech Scanner Interface DLL 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 (COM2, 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: SERR_INVALID_MSGID: SERR_OPEN_SCANNER: SERR_CHECKSUM:
Invalid window handle. msgID cannot be 0. Open or initial scanner port failed. 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"="COM2:" "BAUDRATE"="38400" "STOPBITS"="1" "PARITY"="None" -8
Page 9
"CHECKPARITY"="1"
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();
Return code: None
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 FALSE
Return code: BOOL :
: Enable Scanner : Disable Scanner
TRUE : OK FALSE : Failure
2.4. Reset Scanner Function Description: Set the scanner to the working mode, and reset the communication control. Function call: Return:
BOOL USI_Reset(); 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.
-9
Page 10
2.7. Get scan data Function Description: Retrieves the scan data into 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. 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 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. Function call: UINT USI_GetData(LPBYTE 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 UINT : Data length -