INTRODUCTION... 5 How to download data from scanner ... 5 COM definition for PA500... 6 USI.DLL – UNITECH SCANNER INTERFACE DLL... 7 2.1. Register the application to the USI DLL ... 7 2.2. Unregister the application from the USI.DLL ... 8 2.3.
Page 3
2.24. Only send single command decoding chip ... 14 2.25. Send command to decoding chip ... 15 CONTROL COMMAND FOR DECODER CHIP... 16 SCANNER3.DLL – BACKWARD COMPATIBLE API FOR PT930/PT930S’S SCANNER3.DLL... 21 4.1. Enable Decoder... 21 4.2. Disable Decoder... 21 4.3.
Page 4
6.4.2. Get Screen Backlight Status ... 27 6.4.3. Screen Backlight Brightness Control ... 27 DYNAMIC LOAD DLL... 28 USEFUL FUNCTION CALL - WITHOUT INCLUDE SYSIOAPI.DLL... 29 8.1. Warm-boot, Cold-boot and power off... 29 8.2. GET DEVICE ID ... 29 UPDATE NOTES ... 30...
This section will introduce the programming structure of the barcode sub-system and the programming utility library for the PA500. Inside the PA500 there is an advanced decoding chip to control SE900 laser engine and to handle barcode decoding. Below is system...
2. USI.DLL – Unitech Scanner Interface DLL Note : For PA500 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 7 for programming guide.
"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 Function call: Return code: None 2.3. Enable / Disable Scanner Function Description: To start or stop USI function. This function is useful for application to temporarily Function call: BOOL USI_EnableScan(BOOL bStatus);...
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.
UINT 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 Return: UNIT : data length 2.9.
(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);...
(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);...
2.17. Stop auto scanning function Function Description: Function call: 2.18. Check if auto scanning is enable Function Description: Function call: Return: 2.19. Check if Scan2Key.exe program is running or not Function Description: Function call: Return: 2.20. Test if Scan2Key is enabled Function Description: Function call: Return:...
2.22. Enable/Disable Scan2Key Function Description: Function call: Parameter: (input) Parameter: (output) Return: 2.23. Send scanner command to decoding chip Function Description: Parameter: (input) Return: TRUE = Indicates the command has been successfully sent to queue to output. 2.24. Only send single command decoding chip Function Description: Function call: Parameter: (input)
2.25. Send command to decoding chip Function Description: Function call: Parameter: (input) Parameter: (output) Return: TRUE = indicates the command has been successfully sent to queue to output. Send command to decoder chip. This is a variation of command It will read a number of parameters and packet them as in following format and send it to decoder chip.
3. Control command for decoder chip Important: This chapter describes low level command for scanner control function. If you already USI to do scanner programming, you don’t need to care about this chapter. In general, it is not suggested to use level command to control scanner, because there are timing issue on serial communication programming , and it is always need communication expert to do that and it is hard to explain it on document.
Page 17
Beep Esc,0,4,3,m,S1,BCC block_delay Esc,0,4,4,m,S1,BCC char_delay Esc,0,4,5,m,S1,BCC Function_code Esc,0,4,6,m,S1,BCC No meaning for you Capslock Esc,0,4,7,m,S1,BCC No meaning for you Language Esc,0,4,8,m,S1,BCC No meaning for you Baud_rate Esc,0,4,0D,m,S1,BCC No meaning for you Parity Esc,0,4,0E,m,S1,BCC No meaning for you Data_bits Esc,0,4,0F,m,S1,BCC No meaning for you Handshake Esc,0,4,10,m,S1,BCC No meaning for you...
Page 18
Mterminator Esc,0,4,31,m,S1,BCC No meaning for you Sentinal Esc,0,4,32,m,S1,BCC No meaning for you Track_selection Esc,0,4,33,m,S1,BCC No meaning for you T2_account_only Esc,0,4,34,m,S1,BCC No meaning for you Separator Esc,0,4,35,m,S1,BCC No meaning for you Must_have_data Esc,0,4,36,m,S1,BCC No meaning for you Track1_sequence Esc,0,L,37,m,S1,…Si,BCC No meaning for you Track2_sequence Esc,0,L,38,m,S1,…Si,BCC No meaning for you...
Page 20
Supplement_two Esc,0,4,88,m,S1,BCC Supplement_five Esc,0,4,89,m,S1,BCC Supplement_mh Esc,0,4,8a,m,S1,BCC Supplement_ssi Esc,0,4,8b,m,S1,BCC Delta_code_set Esc,0,4,8c,m,S1,BCC Delta_c_enable Esc,0,4,8d,m,S1,BCC Delta_code_cdc Esc,0,4,8e,m,S1,BCC Delta_code_cds Esc,0,4,8f,m,S1,BCC Get_version Esc,0,3,90,2,BCC DumpSetting Esc,Lh,Ll,91,m,S1...Si,BC EAN128Brace Esc,0,4,92,m,S1,BCC Remove AimingTime Esc,0,4,93,m,S1,BCC Exchange data Esc,Lh,Ll,a3,S1,S2,...,Sn, Note: Hamster save these commands to buffer and do not execute until it receives an Execute command (Esc,ENQ).
4. Scanner3.DLL – Backward compatible API for PT930/PT930S’s Scanner3.dll Note : For PA500, it need to dynamically load DLL for using Unitech built-in DLL (Unitech will not provide *.H and *.LIB for compiler), please refer to Chapter 7 for programming guide.
4.4. Read barcode data Function Description: Get input barcode data and its type from system buffer. Function call: BOOL PT_GetBarcode( TCHAR *szBarcodeBuffer,TCHAR *cType); Parameter: (output) szBarcodeBuffer : string buffer for storing input data cType : Type of Input data =00H =01H =02H =03H...
5. ScanKey3.DLL – Backward compatible API for PT930/PT930S’s ScanKey3.dll Note : For PA500, it need to dynamically load DLL for using Unitech built-in DLL (Unitech will not provide “USI.H” and “USI.LIB” for compiler), please refer to Chapter 7 for programming guide.
API functions are provided through DLL to assist programmer to write application for PA500. Note : For PA500 programming, it need to dynamically load DLL for using Unitech built-in DLL (Unitech will not provide *.H and *.LIB for compiler), please refer to Chapter 7 for programming guide.
6.2. Scanner Related Functions To save power, the decoder IC is disabled when scanner is not in use. It can be enabled through USI functions. Following functions are meaningful only if decode IC is enabled. 6.2.1. Enable/Disable Scanner trigger key Function Description: This function enables/disables trigger keys.
= CreateEvent(NULL, TRUE, FALSE, kKeybdAlphaKeyEventName); while (1) 6.3. LED related function Function Description: There are two LEDs above the screen of PA500, red and green LEDs. Only the green LED can be controlled by programmer. Function call: void GoodReadLEDOn(BOOL fON)
6.4. LCD/Backlight related function There are two backlight controls, screen backlight and keypad backlight. They are controlled separately. For screen backlight, you can adjust brightness of backlight also. 6.4.1. Screen Backlight Control Function Description: This function turns screen backlight on or off. Function call: void BacklightOn(BOOL fON) Parameter(Input)
7. Dynamic Load DLL Compiler would not load the DLL while use dynamic load DLL, it help user to load the DLL if it exists while the application executed. The follow is the example. Note: Even user does not need include the header and lib file but need to know the function definition. ////////////////////////////////////////////////////////////////////////////////////////// HINSTANCE g_hUSIDLL;...
VK_OFF, bScan, KEYEVENTF_SILENT, dwExtraInfo ); keybd_event( VK_OFF, bScan, KEYEVENTF_KEYUP, dwExtraInfo ); 8.2. Get Device ID In PA500, an unique ID had been burnt into terminal, user can check it by pressing “Func”+”9”. The sample code for read device ID as follow, //////////////////////////////////////////////////////////////// HWND hDeviceId = GetDlgItem(hWnd, IDC_DEVICEID);...
Need help?
Do you have a question about the PA500 and is the answer not in the manual?
Questions and answers