Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 1 of 5

PA600 Programming Manual, pages 1 to 9

Pages 1 to 9 of 41

The original document is the PDF (301 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 PA600

Page 1 read from a scan by OCR; it may hold reading errors

unitech

PA600 Programming Manual

V 1.6 1/11/2008

Page 2

-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

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.

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

-3

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

Page 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 -4

Page 5

7.

BlueTooth relative API - BTAPI.DLL .............................................................................. 39 7.1. 7.2.

-5

Enable/Disable Bluetooth Power status...................................................................................................39 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.

Page 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: SE950 Laser Engine

Advanced Decoder Chip

COM1

CPU

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.

-6

Page 7

1.2 COM definition for PA600 COM 0 COM 1 COM 2 COM 3 COM 4 COM 5 COM 6 COM 7 COM 8 COM 9

-7

USB to serial Reserve Bluetooth IrDAComm Scanner (Hamster) BTModem USB client Reserve Reserve RawIR

Page 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 SERR_INVALID_MSGID SERR_OPEN_SCANNER SERR_CHECKSUM SERR_DATALOST SERR_BUFFEROVERFLOW

Invalid window handle. msgID cannot be 0. Open or initial scanner port failed. Checksum error in received packet. New scan data is lost because data buffer is not empty. 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"

-8

Page 9

-9