Unitech PA600 Programming Manual

Unitech PA600 Programming Manual

Unitech pa600: software guide
Hide thumbs Also See for PA600:
Table of Contents

Advertisement

PA600
Programming Manual
V 1.6 1/11/2008

Advertisement

Table of Contents
loading

Summary of Contents for Unitech PA600

  • Page 1 PA600 Programming Manual V 1.6 1/11/2008...
  • Page 2: Table Of Contents

    INTRODUCTION... 6 How to download data from scanner ... 6 COM definition for PA600... 7 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.
  • Page 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.
  • Page 4 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 SYSIOAPI.DLL ...
  • Page 5 BlueTooth relative API - BTAPI.DLL ... 39 7.1. Enable/Disable Bluetooth Power status...39 7.2. Get BT Power Status ...39 DYNAMIC LOAD DLL... 40 USEFUL FUNCTION CALL - WITHOUT INCLUDE SYSIOAPI.DLL... 41 9.1. Warm-boot, Cold-boot and power off... 41 9.2. GET DEVICE ID ... 41 UPDATE NOTES ...
  • Page 6: Introduction

    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...
  • Page 7: Com Definition For Pa600

    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...
  • Page 8: Usi.dll – Unitech Scanner Interface Dll

    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.
  • Page 10: Unregister The Application From The Usi.dll

    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.
  • Page 11: Get Scan Data

    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.
  • Page 12: Get Length Of Scanned Data

    BCT_LABEL_CODE BCT_PLESSEY_CODE BCT_TOSHIBA_CODE Return: 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 USI_GetDataLength();...
  • Page 13: Clear Scan Data System Buffer

    (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);...
  • Page 14: Save Scanner Setting Into Specified File

    (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);...
  • Page 15: Check If Scan2Key.exe Program Is Running Or Not

    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();...
  • Page 16: Send Scanner Command To Decoding Chip

    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);...
  • Page 17: Send Scanner Command Set To Decoding Chip

    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.
  • Page 18: Get Scanner Command Set String From Decoding Chip

    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: adjusted automatically...
  • Page 19: Get Image (Available For 2D Model)

    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: Return: HBITMAP 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);...
  • Page 20: Set Terminator

    2.37. Set terminator Function Description: Sets terminator. Function call: BOOL USI_SetTerminator(int terminator); Parameter: (input) terminator: 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: blen:...
  • Page 21: Set Good Read Sound Mode And Sound Name

    2.42. 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: buffer: Return: It returns true when successful, false if mode is n/a. : GRE_PLAYSOUND GRE_BEEP GRE_NONE...
  • Page 22: Control Command For 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 23 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 24 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 25 Msi_p_enable Esc,0,4,5c,m,S1,BCC Msi_pleasey_cd Esc,0,4,5d,m,S1,BCC Msi_p_cdmode Esc,0,4,5e,m,S1,BCC Msi_pleasey_min Esc,0,4,5f,m,S1,BCC Msi_pleasey_max Esc,0,4,60,m,S1,BCC Code93 Esc,0,4,61,m,S1,BCC Code93_min Esc,0,4,62,m,S1,BCC Code93_max Esc,0,4,63,m,S1,BCC Code11 Esc,0,4,64,m,S1,BCC Code11_enable Esc,0,4,65,m,S1,BCC Code11_cdnumber Esc,0,4,66,m,S1,BCC Code11_cdsend Esc,0,4,67,m,S1,BCC Code11_min Esc,0,4,68,m,S1,BCC Code11_max Esc,0,4,69,m,S1,BCC Codabar_set Esc,0,4,6a,m,S1,BCC Codabar_enable Esc,0,4,6b,m,S1,BCC Codabar_ss Esc,0,4,6c,m,S1,BCC Codabar_cd Esc,0,4,6d,m,S1,BCC Codabar_CLSI Esc,0,4,6e,m,S1,BCC Codabar_min Esc,0,4,6f,m,S1,BCC Codabar_max Esc,0,4,70,m,S1,BCC Label_code...
  • Page 26 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).
  • Page 27: Enable Decoder

    4. Scanner3.DLL – Backward compatible API for PT930/PT930S’s Scanner3.dll Note : For PA600, 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 8 for programming guide.
  • Page 28: Read Barcode Data

    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...
  • Page 29: Disable Decoder

    5. ScanKey3.DLL – Backward compatible API for PT930/PT930S’s ScanKey3.dll Note : For PA600, 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 8 for programming guide.
  • Page 30: Sysioapi.dll

    API functions are provided through DLL to assist programmer to write application for PA600. 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), please refer to Chapter 8 for programming guide.
  • Page 31: Check Function Key Status

    6.1.5. Check Function Key status Function Description: This function is used to check if function key is enabled or not. Function call: BOOL GetFnKeyStatus(void) Return code: TRUE = Function key is enabled. FALSE = Function key is disabled. 6.1.6. Enable/Disable Function Key Function Description: This function is used to enable/disable function key.
  • Page 32: Get Scanner Status

    6.2.4. Get Scanner Status Function Description: This function returns the status of scan engine, or trigger key. Function call: BOOL GetScannerStatus(void) Return code: TRUE = scan engine is on, or trigger key is pressed. FALSE = scan engine is off, or trigger key is released.
  • Page 33: Check Trigger Key Is Pressing

    = CreateEvent(NULL, TRUE, FALSE, kKeybdAlphaKeyEventName); while (1) 6.3. LED related function Function Description: There are two LEDs above the screen of PA600, red and green LEDs. Only the green LED can be controlled by programmer. Function call: void GoodReadLEDOn(BOOL fON)
  • Page 34: Lcd/Backlight Related Function

    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)
  • Page 35: Screen Backlight Brightness Control

    6.4.5. Screen Backlight Brightness Control Function Description: This function adjusts screen backlight brightness. Function call: void BrightnessUp(BOOL fup) Parameters(Input) Fup: BOOL: Return code: 6.4.6. Enable/Disable LCD screen Function Description: Turn on / off LCD screen Function call: void PowerOnColorLCD(BOOL fON) Parameters(Input) fON: BOOL: Return...
  • Page 36: Sd Slot Related Functions

    6.5. SD slot related functions 6.5.1. Inquire SD slot status Function Description: This function returns SD slot enable/disable status. Function call: BOOL Return BOOL: 6.5.2. Enable/Disable SD slot Function Description: This function enables/disables SD slot. Function call: void EnableSDSlot(BOOL bEnable) Parameters(Input) bEnable : 6.6.
  • Page 37: Wifi Module Related Functions

    6.7. WiFi module related functions 6.7.1. Inquire WiFi module status Function Description: This function returns WiFi module enable/disable status. Function call: BOOL GetWLANStatus() Return BOOL: 6.7.2. Enable/Disable WiFi module status Function Description: This function enables/disables WiFi module. Function call: void WLANPowerEnable( BOOL fOn) Parameters(Input) fOn: TRUE = module is enabled.
  • Page 38: Bluetooth Related Api

    6.8. Bluetooth related API Note : Not like Unitech’s PA9xx series, Bluetooth related APIs are implemented on SysIOAPI.DLL. It is suggested to use those API from SysIOAPI. But, we still keep the same function call on BTAPI.DLL for backward compatible issue.
  • Page 39: Bluetooth Relative Api - Btapi.dll

    7. BlueTooth relative API - BTAPI.DLL This DLL provide BlueTooth relative API. Two files are essential and provided in SDK, BTAPI.LIB and BTAPI.H. Enable/Disable Bluetooth Power status 7.1. Function Description: Enable Bluetooth Module Power ON/OFF Function call: void BT_PowerEnable ( BOOL bEnable ) Parameter (Input) bON: BOOL: Return code:...
  • Page 40: Dynamic Load Dll

    8. 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;...
  • Page 41: Useful Function Call - Without Include Sysioapi.dll

    VK_OFF, bScan, KEYEVENTF_SILENT, dwExtraInfo ); keybd_event( VK_OFF, bScan, KEYEVENTF_KEYUP, dwExtraInfo ); 9.2. Get Device ID In PA600, 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);...

Table of Contents