Argox PA-20 Programming Manual
Argox PA-20 Programming Manual

Argox PA-20 Programming Manual

Portable data terminal
Hide thumbs Also See for PA-20:

Advertisement

Portable Data Terminal
PA-20 / PA-2010
PA-21 / PA-2110
Programming Guide
Version: 1.00
Copyright © 2012 by ARGOX Information Co., Ltd.
http://www.argox.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PA-20 and is the answer not in the manual?

Questions and answers

Summary of Contents for Argox PA-20

  • Page 1 Portable Data Terminal PA-20 / PA-2010 PA-21 / PA-2110 Programming Guide Version: 1.00 Copyright © 2012 by ARGOX Information Co., Ltd. http://www.argox.com...
  • Page 2 Preface To satisfy the user‟s customized needs, the PA-20 / PA-2010 / PA-21 / PA-2110 provide users to generate programs for their actual demands. This allows users to collect data, execute function expression and store the processed data with the application programs designed by their own.
  • Page 3: Table Of Contents

    Table of Contents Program Developing ...................... 3 Development Environment ..................3 Folder Structure: ..................3 Folder introduction: ..................4 Functions in SDK folder description: ............5 Adding Source File: ..................5 Function Library ....................6 Standard Function Library ..................7 How to Build Your Program ..................
  • Page 4 TextBlock ......................84 Communication Ports................... 89 Remote ......................... 94 System ........................97 Memory ......................100 Vibrate ........................ 102 Other ........................103 Simulator (Only for PC Simulator) ..............105 Data Conversion....................106 APPENDIX 1: ......................108 Scan Module (CCD) Configuration Table ............108 APPENDIX 2:...
  • Page 5: Program Developing

    Program Developing Development Environment Folder Structure: When open the SDK folder in the CD provided with the PA-20 / PA-2010 / PA-21 / PA-2110, it will show the structure as the following: AID MAKER Scanner FW Upgrade Laser Document PC DLL...
  • Page 6: Folder Introduction

    It has a exe file, “DFUSender_PA2.exe”, and has three bat files “All Upgrade-COM1.bat”, “All Upgrade-COM2.bat”, and “All Upgrade-USB.bat”. If you want to upgrade fw, you have to set PA-20 / PA-2010 / PA-21 / PA-2110 in force mode or upgrade in supervisor menu and double click these bat file for download.
  • Page 7: Functions In Sdk Folder Description

    App.bin is the binary file ,compiler by RealView 2.2. You can download the binary file by PT-FileManager Source folder is used to store application files and the PA-20 / PA-2010 / PA-21 / PA-2110 function library used in the programs.
  • Page 8: Function Library

    Function Library provides variety of services, and accomplishes special functions according to specific demands. When using the PA-20 / PA-2010 / PA-21 / PA-2110 Function Library, please add the import command (#include “SDK.h”) into the user program file (*.c) and the function will be imported.
  • Page 9: Standard Function Library

    Standard Function Library The user application program in the data collector can perform the tasks to combine standard C language function library. The function library is enclosed in the developing environment (RealView Developer Suite). After set up the developing environment, you can find the include head file of standard C language function library in the directory \\ARM\RVCT\Data\2.2\349\include\windows.
  • Page 10 #include <stdlib.h> The statements listed above will make Compiler and Linker to import all the correlated functions to generate App.bin file. PT-20 Programming Guide...
  • Page 11: How To Build Your Program

    How to Build Your Program Edit Program: Developers may use the Application.c file under Source folder in the PA2-T01.00-000 Directory as the starting file. And you can use void Application_Main(void) as the start point to edit the program. And also you can freely create a new source file to proceed structural development.
  • Page 12: Update Your System

    Add or Delete Files: When adding or deleting the source files, you can do the adding and removing directly under the RealView Developer Suite. The files will be displayed both in Debug and Release file list. Compile, Link and Create: When finish application code development, you can compile and link application code as figure: After thses steps, you can upgrade your system.
  • Page 13: Upgrade System

    Upgrade folder) 2. Upgrade Procedure: In Force Mode: When reset PA-20 / PA-2010 / PA-21 / PA-2110, press combine key “1+3+PW+reset“ any time or press combine key “1+3+PW” in power off to into Force Mode. Then connect the Cradle to the PC and wait for communication.
  • Page 14 And input password “00000” ->Communication ->Upgrade . Then connect the Cradle to the PC and wait for communication. PT-20 Programming Guide...
  • Page 15: Execute System

    In PTFileManager: Execute PTFileManager and select Tool\F/W Update Select the Binary file complete the firmware update. 3. Execute System: Restart PA-20 / PA-2010 / PA-21 / PA-2110. PT-20 Programming Guide...
  • Page 16: Utility & Others

    This utility “ScanSetting” can help you to set scanner setting faster. After you make a scanner setting file, you have to save the file in PA-20 / PA-2010 / PA-21 / PA-2110, and use SDK function “ScannerSetFromFile” to set your scanner setting.
  • Page 17: Sdk Library

    SDK Library SDK Functions list Function Description Reader InitScanner1 Initialize respective scanner port. Decode Perform barcode decoding. SleepScanner1 Set scanner module sleep. HaltScanner1 Stop the scanner port from operating. TriggerStatus To check the scan key status. Scanner_Reset Set scanner setting to default. Scanner_Config_Start To start scanner setting procedure.
  • Page 18 BT_Close Bluetooth disconnect. BT_Read Read characters from Bluetooth module. BT_Write Write characters to Bluetooth module. BT_GetLocalInfo Get Bluetooth information. BT_SetLocalSet Set Bluetooth information. BT_Inquiry Inquiry other Bluetooth module forPA-2010 / PA-2110 to connect. BT_DisConnectAlert For bluetooth disconnect alert. File Manipulation __access Check for file existence.
  • Page 19 DiskD_format Format disk D. DiskC_totalsize Checking the total space in disk C. DiskD_totalsize Checking the total space in disk D. DiskC_usedsize Checking the used space in disk C. DiskD_usedsize Checking the used space in disk D. DiskC_freesize Checking the free space in disk C. DiskD_freesize Checking the free space in disk D.
  • Page 20 Search the designated field. The field‟s information include SearchMultiField_GF field string and field number.You can write many fields in this field buffer. After searching success, acquiring the appointed field in including this field‟s record. SeekRecord Move the index of searching to the appointed record. GetRecordNum Obtain the figure of all records in the file.
  • Page 21 variables according to specified formats. _scanf_color_DefaultStr Use _scanf_color_DefaultStr to set a default string in input and read character strings from the standard input file and covert the strings to values of C variables according to specified formats. Set scanner on/off when use “_scanf_color” function. _scanf_ctrl_ScannerStatus Set scanner sleep on/off when use “_scanf_color”...
  • Page 22 _putchar Display a character in color black on the LCD display. _putchar_color Display a character in user define color on the LCD display. _puts Display a string in color black on the LCD display. _puts_color Display a string in color black on the LCD display. show_image_bmp Put a rectangular bitmap to the LCD display.
  • Page 23 Remote SetRemoteBaud Setting the RemoteLink baud rate. GetRemoteBaud Getting the RemoteLink baud rate. SetRemoteInterface Setting the RemoteLink interface. GetRemoteInterface Getting the RemoteLink interface. RemoteLink Use RemoteLink to call the transmission function for user to upload or download files. RemoteLink_RealTime Use RemoteLink_RealTime can transfer file in any state. System SysSuspend Shut down the system.
  • Page 24 BackupDataFiletoPC Use BackupDataFiletoPCA to copy data file to any disc in PC. Sim_SetScannerType To setting scan module type. Data Conversion __itoa Use __itoa to convert an integer value to a null-terminated character string. __ltoa Use __ltoa to convert a long integer value to a null-terminated character string.
  • Page 25: Reader

    Reader InitScanner1 Purpose: Initialize respective scanner port. Syntax: void InitScanner1(void); Example call: InitScanner1( ); #include “SDK.h ” Includes: Description: Use InitScanner1 function to initialize scanner port. The scanner port won't work unless it is initialized. Returns: None Decode Purpose: Perform barcode decoding. Syntax:...
  • Page 26 Example call: InitScanner1( ); while(1) if (Decode()) SleepScanner1(TRUE); while(_getchar()==0); SleepScanner1(FALSE); #include “SDK.h ” Includes: Description: Use SleepScanner1 function to set scanner in sleep mode. You have not to initial scanner again, and it would be scan again. Returns: None HaltScanner1 Purpose:...
  • Page 27 Description: This function can reset scan module,if reset OK,this function will return 1,else will return 0. Returns: 0:Reset fail. 1:Reset OK. Scanner_Config_Start Purpose: To start scanner setting procedure. Syntax: void Scanner_Config_Start(void); Example call: Scanner_Config_Start(); #include “SDK.h ” Includes: Description: This function can starting scanner setting procedure. Returns:...
  • Page 28 Description: This function can send command to set scanner status. You can see “Appendix 2” to know about the command setting. Returns: 0:Send fail. 1:Send OK. Scan_QueryStatus Purpose: Query the scanner(CCD) current setting. Syntax: BOOL SCAN_QueryStatus(int Command1,int Command2,char *pReturn); Example call: char ssReturn = 0;...
  • Page 29 1: Load OK. Scanner_Version Purpose: Query the scan module version. Syntax: BOOL Scanner_Version(char* Returnbuf); Example call: If(Scanner_Version (Returnbuf)) _printf_color(COLOR_RED, “Query module version OK!”); #include “SDK.h ” Includes: Description: This function can query the scan module version. Returns: 0:Query module fail. 1: Query module OK.
  • Page 30: Buzzer

    Buzzer beeper_status Purpose: To see whether a beeper sequence is under going or not. Syntax: int beeper_status(void); Example call: while(beeper_status( )); #include “SDK.h ” Includes: Description: The beeper_status function checks if there is a beeper sequence in progress. Returns: 1 if beeper sequence still in progress, 0 otherwise off_beeper Purpose:...
  • Page 31 Purpose: Set the buzzer volume. Syntax: void SetBuzzerVol(int slVol); Example call: SetBuzzerVol(0);//Buzzer close. #include “SDK.h ” Includes: Description: The SetBuzzerVol function can set the buzzer volume. slVol Buzzer vloume close Medium High Returns: None. PT-20 Programming Guide...
  • Page 32: Calender

    Calender DayOfWeek Purpose: Get the day of the week information. Syntax: int DayOfWeek(void); Example call: day=DayOfWeek( ); #include “SDK.h ” Includes: Description: The DayOfWeek function returns the day of week information based on current date. Returns: The DayOfWeek function returns an integer indicating the day of week information.
  • Page 33 Syntax: int set_time(char *new_time); set_time(“20030401223035”); Example call: #include “SDK.h ” Includes: Description: The set_time function set a new system date and time specified in the argument new_time to the calendar chip. The character string new_time must have the following format, "YYYYMMDDhhmmss"...
  • Page 34: Bluetooth(For Pa-2010 / Pa-2110)

    Bluetooth(For PA-2010 / PA-2110) These functions only for PA-2010 / PA-2110, and our Bluetooth module only support SPP mode(Serial Port Profile). BT_Start Purpose: Bluetooth module power enable. Syntax: int BT_Start(void); Example call: BT_Start(); #include “SDK.h ” Includes: Description: This function can enable Bluetooth module power. After use this function, the left led will flash blue light.If you want to use other Bluetooth function, you must run this function first.
  • Page 35 BT_CONNECT : Bluetooth has connected, please run BT_Close. BT_OK : Bluetooth connect ok. BT_Close Purpose: Bluetooth disconnect. Syntax: int BT_Close(void); Example call: BT_Close(); #include “SDK.h ” Includes: Description: This function can disconnect Bluetooth. If you want to disconnect, you can use BT_Stop(Bluetooth module power off) or this function. Returns:...
  • Page 36 characters will be writed to other Bluetooth device, and “pslPutSize” will tell you how meny characters send to other Bluetooth device. Returns: BT_NOMODULE : The terminal is notPA-2010 / PA-2110. BT_NOSTART : Bluetooth module power disable, please run BT_Start. BT_DISCONNECT : Bluetooth not connect to other bluetooth device, please run BT_Open.
  • Page 37 char assPinCode[20]; //Set PIN code. }_BT_INFO; Returns: BT_NOMODULE : The terminal is notPA-2010 / PA-2110. BT_OK : Get information OK. BT_SetLocalSet Purpose: Set Bluetooth information. Syntax: int BT_SetLocalSet(_BT_INFO* stSet); Example call: _BT_INFO stInfo; BT_GetLocalInfo(&stInfo); stInfo. stInquiryTimeout = 10; stInfo. stInquirytMaxResponse = 5; BT_SetLocalSet(&stSet);...
  • Page 38 Returns: BT_NOMODULE : The terminal is notPA-2010 / PA-2110. BT_NOSTART : Bluetooth module power disable, please run BT_Start. BT_CONNECT : Bluetooth has connected, please run BT_Close. BT_ERROR : Parameter error, please check your parmeter. BT_TIMEOUT : Set fail, please Set again. BT_OK : Set OK.
  • Page 39: File Manipulation

    File Manipulation __access Purpose: Check for file existence. Syntax: int __access(char *filename); if(__access(“C:\\data\\store.dat”) _puts(“store.dat exist!!”); Example call: #include “SDK.h ” Includes: Description: Check if the file specified by filename. Returns: If the file specified by filename exist, access returns an integer value of 1, 0 otherwise.
  • Page 40 Purpose: Write a null terminated character string to the bottom (end-of-file position) of a DAT file. Syntax: int appendln(int fd, char *buffer); Example call: appendln(fd, data_buffer); #include “SDK.h ” Includes: Description: The appendln function writes a null terminated character string from the character array buffer to a DAT file whose file handle is fd.
  • Page 41 fErrorCode: 2:File specified by fd does not exist. 8:File not opened 10:No more free file space for file extension. close Purpose: Close a DAT file. Syntax: int close(int fd); If (close(fd)) _puts(“file closed!\n”); Example call: #include “SDK.h ” Includes: Description: Close a previously opened or created DAT file whose file handle is fd.
  • Page 42 9:The value of count is negative. 10:No more free file space for file extension. delete_topln Purpose: Remove a null terminated character string from the top (beginning-of-file position) of a DAT file. Syntax: int delete_topln(int fd); Example call: delete_topln (fd); #include “SDK.h ” Includes:...
  • Page 43 Purpose: Get file length information of a DAT file. Syntax: long filelength(int fd); Example call: datasize = filelength(fd); #include “SDK.h ” Includes: Description: The filelength function returns the size in number of bytes of the DAT file whose file handle is specified in the argument fd. Returns:...
  • Page 44 Description: The lseek function moves the file pointer of a DAT file whose file handle is specified in the argument fd to a new position within the file. The new position is specified with an offset byte address to a specific origin. The offset byte address is specified in the argument offset which is a long integer.
  • Page 45 and an error code is set to the global variable fErrorCode to indicate the error condition encountered. Possible error codes and their interpretation are listed below. fErrorCode: 1:filename is a NULL string. 6:Can't create file. Because the maximum number of files allowed in the system is exceeded.
  • Page 46 readln Read a line terminated by a null character “\0” from a DAT file. Purpose: Syntax: int readln(int fd, char *buffer, unsigned max_count); Example call: readln(fd, buffer, 50); #include “SDK.h ” Includes: Description: The readln function reads a line from the DAT file whose file handle is fd and stores the characters in the character array buffer.
  • Page 47 fErrorCode: 1:filename is a NULL string. 2:File specified by filename does not exist. _rename Purpose: Change file name of an existing file. Syntax: int _rename(char *old_filename, char *new_filename); if (_rename(“C:\\data\\store.dat”,” C:\\data\\text.dat”) Example call: _puts(“store.dat renamed”); #include “SDK.h ” Includes: Description: Change the file name of the file specified by old_filename to new_filename.
  • Page 48 fErrorCode: 2:File handle is NULL. 7:fd is not a file handle of a previously opened file. write Purpose: Write a specified number of bytes to a DAT file. Syntax: int write(int fd, char *buffer, unsigned count); Example call: write(fd, data_buffer,100); #include “SDK.h ”...
  • Page 49 to the file (includes the null character). In case of error, writeln returns an integer value of -1 and an error code is set to the global variable fErrorCode to indicate the error condition encountered. Possible error codes and their interpretation are listed below. fErrorCode:...
  • Page 50 Example call: DiskD_totalsize ( ); #include “SDK.h ” Includes: Description: The DicskD_totalsize function returns the total space in disk D. Returns: 0xffffffff : Disk D unformatted. Others : The total space in disk D.(Bytes) fErrorCode: None DiskC_usedsize Purpose: Checking the used space in disk C. Syntax:...
  • Page 51 Description: The DicskD_freesize function returns the free space in disk D. Returns: 0xffffffff : Disk C unformatted. Others : The free space in disk D.(Bytes) fErrorCode: None getDirNum Purpose: Get the folder quantity in designate path. Syntax: int getDirNum(char *pssPath); Example call:...
  • Page 52 Lookup”. Returns: -1 : path error. -2 : disk unformat. upward 0 : When pssBuffer = NULL, it will return buffer size. When pssBuffer != NULL, it will return folder quantity. fErrorCode: None getFileList Purpose: Get the file information in designate path. Syntax:...
  • Page 53 _fcloseAll Purpose: Use _fcloseAll to close all files opened for buffered input/output with _fopen or tmpfile. Syntax: void _fcloseAll(void); Example call: _fcloseAll(); #include “SDK.h” Includes: Description: The _fcloseAll function closes all files that have been opened by _fopen or tmpfile for buffered I/O. Buffers associated with files opened for writing are written out to the corresponding file before closing.
  • Page 54 Creates a file and opens it for both reading and writing. If file exists, current contents are destroyed. Returns: If the file is opened successfully, _fopen returns a pointer to the file. Actually, this is a pointer to a structure of type _TFILE, which is defined in the header file.
  • Page 55 non-zero value. _fwrite Purpose: Use _fwrite to write a specified number of data itmes, each of a given size, from a buffer to the current position in a file opened for buffered output. The current position is updated after the write. Syntax:...
  • Page 56: Dbms

    DBMS Ini_Search Use “Ini_Search” can initiate the file search function in disk. Purpose: Syntax: int Ini_Search(_TFILE* filehd,_DBMS* F_Search, unsigned char *pusFielddlt, int record_type, int record_length, int total_field_no, int total_record_no); Example call: Example 1: Variable field length _DBMS fsearch; _TFILE *filepoint; unsigned char ausFielddlt[2]=”,”;...
  • Page 57 unsigned char *pusFielddlt This argument has two kinds of meanings. When record _ Type is 0, search for regular length. This function needs to insert the unsigned char array; the array represents the length of every field. When record _ Type is1, search for variable length, this function need to insert one character to represent separate symbol.
  • Page 58 filepoint = _fopen(“c:\\data\\data.txt”,”r+”); Ini_Search(filepoint, &fsearch, ausFielddlt, NULL, 0, 1, 0, 5, 0); Example 2: Regular field length _DBMS fsearch; _TFILE *filepoint; unsigned char field_size[5]={6,5,4,5,6}; unsigned char keyfield[2] = {0, 2}; int keyfieldNum = 2; filepoint = _fopen(“c:\\data\\data.txt”,”a+”); Ini_Search(filepoint, &fsearch, field_size, keyfield , keyfieldNum, 0, 26, 5, #include “DBMS.h ”...
  • Page 59 unsigned char *pusFielddlt This argument has two kinds of meanings. When record _ Type is 0, search for regular length. This function needs to insert the unsigned char array; the array represents the length of every field. When record _ Type is1, search for variable length, this function need to insert one character to represent separate symbol.
  • Page 60 Syntax: int Close_Search(_DBMS* F_Search); Example call: Close_Search(&F_Search); #include “DBMS.h” Includes: Description: When want to finish the file searching state, you can use this function. Returns: 0: Close defeat. 1: Close success. SearchField Purpose: SearchField can search the appointed field that begin from the appointed record and compare with importing string.
  • Page 61 recordno, char* R_Buffer, int flag); char str[8]=”abcdefg”,str_buffer[60]; Example call: SearchField_GR(&fsearch, str,0,0, str_buffer,FORWARD); #include “DBMS.h” Includes: Description: This function can search and contrast the data of appointed field. After success, reading the record which includes this field. Several describe the argument as follows: argument description The file‟s searching structure that has been...
  • Page 62 Description: Search the correctly appointed field. After search success, acquiring another appointed field which including record of this field. Several describe the argument as follows: argument description The file‟s searching structure that has been _DBMS* F_Search initialized. char* field String data wanted to match. int search_fieldno Field wanted to search.
  • Page 63 argument description The file‟s searching structure that has been _DBMS* F_Search initialized. char* multi_field String data wanted to match. The string form is “field string 0, field number 0; field string 1, field number 1;...”. Each field string and field number use separate symbol ”,”, behind the field number use separate symbol ”;”, last field number don‟t use any separate symbol.
  • Page 64 AppendRecord Purpose: Use this function can increase a new record on the file end. Syntax: int AppendRecord(_DBMS* F_Search,char* record); char str_record[25]=”A1357924680,PA-20,3500”; Example call: AppendRecord(&fsearch, str_record); #include “DBMS.h” Includes: “AppendRecord” can increase a new record on the file end, the data of Description:...
  • Page 65 Other value: Write into the amount of data. WriteRecord Purpose: Using this function can copy the existed record. Syntax: int WriteRecord(_DBMS* F_Search, int recordno, char* record); char str_record[20]=”A123456,PA-20,2330”; Example call: WriteRecord(&fsearch,0, str_record);// Revise the first record to char str_record。 #include “DBMS.h” Includes:...
  • Page 66 Returns: When char * buffer = NULL, functions will pass the data size back. Read defeat: Pass back - 1. When char * buffer ≠ NULL. Read succeed: Pass 1 back; Read defeat: Pass back - 1. ReadRecord Purpose: Use this function to read the data of appointed record. Syntax:...
  • Page 67: Led

    set_led Purpose: To set the LED indicators Syntax: void set_led(int led, int mode, int duration); Example call: set_led(LED_RED, LED_FLASH, 30); #include “SDK.h ” Includes: Description: description LED_GREEN LED moving display green light. LED_RED LED moving display red light. LED_ORANGE LED moving display orange light. mode description LED_OFF...
  • Page 68: Keypad

    Keypad clr_kb Purpose: To clear the keyboard buffer. Syntax: void clr_kb(void); Example call: clr_kb( ); #include “SDK.h ” Includes: Description: The clr_kb function clears the keyboard buffer. This function is automatically called by the system program upon power up. Returns: none dis_alpha Purpose:...
  • Page 69 Syntax: void set_alpha_mode_state(int status); Example call: set_alpha_mode_state(ALPHA_123); #include “SDK.h ” Includes: Description: This function can set alphabet mode. Returns: none get_alpha_mode_state Purpose: Get the status of the alphabet mode status. Syntax: int get_alpha_mode_state(void); Example call: get_alpha_mode_state(); #include “SDK.h ” Includes: Description:...
  • Page 70 Returns: None get_keypad_BL_Timer Purpose: Get keypad backlight timer. Syntax: int get_keypad_BL_Timer(void); Example call: int slkeypadimer; slkeypadimer = get_keypad_BL_Timer(); #include “SDK.h ” Includes: Description: This function can get keypad backlight timer. Returns: 0: Keypad backlight always on Other: The timer for keypad backlight(sec.). kbhit Purpose:...
  • Page 71 #include “SDK.h ” Includes: Description: The function returns an integer indicates the key click staus.The default is enabled. Returns: 1, if key click sound is enabled. 0, if key click sound is disabled. SetKeyClick Purpose: To enable / disable the key click sound. Syntax:...
  • Page 72 #include “SDK.h ” Includes: Description: You can check the FN-Key function that is default setting or custom setting. smKeyNum: 0  F1, 1  F2, 2  F3, 3  F4, 4  F5, 5  F6 Returns: 1 : Custom Setting。 0 : Default Setting。...
  • Page 73 Returns: FALSE:set fail TRUE:set success GetScanKeyPwOn Purpose: Get state for power on by scan key. Syntax: BOOL GetScanKeyPwOn(void); Example call: Int state; state = GetScanKeyPwOn(); #include “SDK.h ” Includes: Description: This function can get scan key power on state. Returns: FALSE:scan key not power on.
  • Page 74 successfully read, converted, and saved in variables. A return value equal to EOF means that an end-of-file was encountered during the read operation. _scanf_color_DefaultStr Purpose: Use _scanf_color_DefaultStr to set a default string in input and read character strings from the standard input file and covert the strings to values of C variables according to specified formats.
  • Page 75 Syntax: void _scanf_ctrl_ScannerStatus(BOOL bStatus); Example call: _scanf_ctrl_ScannerStatus(TRUE); #include “SDK.h ” Includes: When use “_scanf_color” function, this function can set scanner status. Description: TRUE : Scanner on. FALSE : Scanner off. Returns: none _scanf_ctrl_ScannerSleep Set scanner sleep on/off when use “_scanf_color” function. Purpose:...
  • Page 76 #include “SDK.h ” Includes: When use “_scanf_color” function, this function can set auto press ENT Description: key after scanner read. TRUE : Auto press ENT on. FALSE : Auto press ENT off. Returns: none _scanf_ctrl_AlphaKey Set Alpha key function on/off when use “_scanf_color” function. Purpose:...
  • Page 77 0 : Input character nomoral display. others : Input character display define word. Returns: none _scanf_ctrl_KeypadLock Set keypad lock on/off when use “_scanf_color” function. Purpose: Syntax: void _scanf_ctrl_KeypadLock(BOOL bLock); Example call: _scanf_ctrl_KeypadLock(FALSE); #include “SDK.h ” Includes: When use “_scanf_color” function, this function can set keypad input Description:...
  • Page 78: Lcd

    The following functions clr_eol, clr_rect, clr_scr, fill_rect, fill_rect_color, GetCursor, SetCursor, gotoxy, wherex, wherexy, wherey, _printf_color, _putchar, _puts, _puts_color and show_image_bmp only effect the current TextBlock. The parameters of those function will base on TextBlock‟s size and position. clr_eol Purpose: Clear from where the cursor is to the end of the line. The cursor position is not affected after the operation.
  • Page 79 system. Returns: None fill_rect Purpose: Fill a white rectangular area on the LCD display. Syntax: void fill_rect(int left, int top, int width, int height); Example call: fill_rect (10,5,30,10); #include “SDK.h ” Includes: Description: The fill_rect function fills a rectangular area white on the LCD display whose top left position and size are specified by left, top, width, and height.
  • Page 80 Returns: The GetCursor function returns an integer of 1 if the cursor is visible (turned on), 0 if not. SetCursor Purpose: Turn on or off the cursor of the LCD display. Syntax: void SetCursor(int status); Example call: SetCursor (0);//Cursor off #include “SDK.h ”...
  • Page 81 Example call: wherexy(&x_position,&y_position); #include “SDK.h ” Includes: Description: The wherexy function copies the value of x-coordinate and y-coordinate of the cursor location to the variables whose address is specified in the arguments column and row. Returns: None wherey Purpose: Get y-coordinate of the cursor location. Syntax:...
  • Page 82 #include “SDK.h ” Includes: Description: The lcd_backlit_Getlv gets LCD backlight level. Returns: LCD backlight level for 1~5. lcd_backlit_GetTimer Purpose: Get LCD backlight timer. Syntax: int lcd_backlit_GetTimer(void); Example call: lcd_backlit_GetTimer( );//Get LCD backlight timer. #include “SDK.h ” Includes: Description: The lcd_backlit_GetTimer gets LCD backlight timer. Returns:...
  • Page 83 Syntax: int _putchar_color(int color, char c); _putchar_color(COLOR_BLACK, „A‟); Example call: #include “SDK.h ” Includes: Description: The putchar function sends the character specified in the argument c to the LCD display at the current cursor position and moves the cursor accordingly. Returns:...
  • Page 84 Notice: If you want to show a two bits file of BMP, you can change the format by using SDKUtility, and write into the buffer. After that, it will show on PA-20 /PA-2010 / PA-21 / PA-2110‟s LCD. PT-20 Programming Guide...
  • Page 85: Userfont

    UserFont DispFont_SetFont Purpose: Set user font from font file. Syntax: BOOL DispFont_SetFont(S32 slSelFont, const char *filename) Example call: DispFont_SetFont(2,"D:\\Fonts\\Font16.cft"); #include “SDK.h ” Includes: Description: slSelFont User Font 2~9 filename User font file Returns: TRUE : success FALSE : fail DispFont_GetFontInfo Purpose:...
  • Page 86: Textblock

    TextBlock TextBlock is a floating window printing rectangle area on screen. TextBlock defines it‟s activated area anywhere within LCD screen display. A out of display area definition is not allowed. Each TextBlock has individual attribute definition for position, size, font , background color or bmp.
  • Page 87 Description: The DefineTextBlock function defines font,background graph,size and position. There are total 15 Windows. slBlockNo TextBlock number(1~15). slSelFont Defined Font: 0~1 system font and 2~9 user font. slBGType TYPE_COLOR -using background color. TYPE_IMAGE -using background bmp. TYPE_ORIGINAL –using default background. ulBGData pointer of background color or bmp.
  • Page 88 Example call: ResetTextBlock(1); #include “SDK.h ” Includes: Description: When set slngle layer mode, ResetTextBlock will disable the specific TextBlock and set the active TextBlock to 0. If an opened TextBlock has screen save, this function will restore previous screen from buffer in TextBlock occupied area.
  • Page 89 Purpose: Get TextBlock current position. Syntax: POINT GetTextBlockCur(S32 slBlockNo); Example call: pt = GetTextBlockCur(3); #include “SDK.h ” Includes: Description: This function can get position in specific TextBlock. slBlockNo TextBlock number(0~15). Returns: Function success: return the current position. Function fail: return (-1,-1). SetTextBlockCur Purpose:...
  • Page 90 #include “SDK.h ” Includes: Description: This function can help you to set background color. After use this function, all TextBlock will be reset. TextBlock_SetBGImage Purpose: Set default background image for bmp file. Syntax: BOOL TextBlock_SetBGImage(S8* pssPath); Example call: TextBlock_SetBGImage(“D:\\Font\\BGImage.bmp”); #include “SDK.h ” Includes:...
  • Page 91: Communication Ports

    Communication Ports clear_com Purpose: Clear receive buffer Syntax: void clear_com(int port); Example call: clear_com(1); #include “SDK.h ” Includes: Description: This routine is used to clear all data stored in the receive buffer. This can be used to avoid mis-interpretation when overrun or other error occurred. Use the argument “port”...
  • Page 92 Description: This routine is used to check if prior transmission is still in process or not. Use the argument “port” as the connect port which is chosen to open . You can choose 1(RS232). Returns: 0, prior transmission still in course 1, transmission completed -1, the transmitting port choices error com_overrun...
  • Page 93 transmitted one by one until the specified number of character is sent. Use the argument “port” as the connect port which is chosen to open. You can choose 1(RS232). The argument “count” is the number of words of sending data. If you select RS-232 and set hardware flow control(CTS/RTS), this function will wait while data be transmitted.
  • Page 94 i = read_com(1,c); if (i) _printf(“char %c received from COM1”,*c); #include “SDK.h ” Includes: Description: This routine is used to read one byte from the receive buffer and then remove it from the buffer. However, if the buffer is empty, no action is taken and 0 is returned.
  • Page 95 USB_Read Purpose: Read specific number of bytes from USB port. Syntax: int USBRead(unsigned char *rbuf, unsigned int rLength); Example call: int k; unsigned char ausBuf[12]; k = USBRead(ausBuf, 10); _printf("Read %d characters => %s", k, ausBuf); #include “SDK.h ” Includes: Description:...
  • Page 96: Remote

    Remote SetRemoteBaud Purpose: Setting the RemoteLink baud rate. Syntax: void SetRemoteBaud(int slBaud); Example call: SetRemoteBaud (0); #include “SDK.h ” Includes: Description: This function can set RemoteLink baud rate(when use com port), the baud rate setting as follows: slBaud Baud rate(bps) 115200 57600 38400...
  • Page 97 Case 5: _printf_color(COLOR_RED, “RemoteLink baud rate=4800”); Break; #include “SDK.h ” Includes: Description: This function can get RemoteLink baud rate(when use com port). Returns: 0:115200 bps 1:57600 bps 2:38400 bps 3:19200 bps 4:9600 bps 5:4800 bps SetRemoteInterface Purpose: Setting the RemoteLink interface. Syntax:...
  • Page 98 Returns: 0:RS-232 1:USB RemoteLink Purpose: Use RemoteLink to call the transmission function for user to upload or download files. Syntax: void RemoteLink(void); Example call: RemoteLink( ); #include “SDK.h ” Includes: Description: The RemoteLink function provides the transmission environment to link with PT-FilaManager and make file uploading or downloading.
  • Page 99: System

    System SysSuspend Purpose: Shut down the system. Syntax: void SysSuspend(void); Example call: SysSuspend( ); #include “SDK.h ” Includes: Description: This function will shut down the system.When power on, the system will resume or restart itself, depending on the system setting. Returns:...
  • Page 100 FALSE: Statusbar no display SN_Get Purpose: To get the SN of PT10/12. Syntax: void SN_Get(char *pssSNBuffer); Example call: SN_Get(SNBuffer); #include “SDK.h ” Includes: Description: The function cab get the SN of PA-20 /PA-2010 / PA-21 / PA-2110. The PT-20 Programming Guide...
  • Page 101 string buffer size must longer than 8 bytes. Returns: None BIOS_SetDefault Purpose: Set BIOS setting default. Syntax: void BIOS_SetDefault(void); Example call: BIOS_SetDefault(); #include “SDK.h “ Includes: Description: This function can set BIOS setting to default setting. It takes several seconds. Returns:...
  • Page 102: Memory

    Memory Tfree Purpose: Use the Tfree to release an allocated storage block to the pool of free memory. Syntax: void Tfree(void *mem_address); Example call: Tfree(buffer); #include “SDK.h” Includes: Description: The Tfree function returns to the pool of free memory a blockof memory that was allocated earlier by Tmalloc.
  • Page 103 Purpose: Checking the used heap size. Syntax: int UsedHeapSize(void); Example call: usedsize = UsedHeapSize(); #include “SDK.h ” Includes: Description: The UsedHeapSize function can get the used heap size. Returns: The used heap size in units of Kbytes. FreeHeapSize Purpose: Checking the free heap size. Syntax:...
  • Page 104: Vibrate

    Vibrate on_vibrator Purpose: Use on_vibrator to set vibrator on. Syntax: void on_vibrator(void); Example call: on_vibrator( ); #include “SDK.h ” Includes: Description: Use on_vibrator function can enable vibrator. On timer is set by set_vibrator_timer function. Returns: None. off_vibrator Purpose: Use off_vibrator to set vibrator off. Syntax:...
  • Page 105: Other

    Other prc_menu_color Purpose: Create a menu-driven interface. Syntax: void prc_menu_color(MENU_COLOR *menu); Example call: void FuncMenu_01(void) /*to do :add your own program code here*/ void FuncMenu_02(void) /*to do :add your own program code here*/ void FuncMenu_03(void) /*to do :add your own program code here*/ MENU_ENTRY_COLOR Menu_01 = {0,1,"1.Test Menu 01",&FuncMenu_01,0};...
  • Page 106 call the prc_menu function to build a hierarchy menu-driven user interface. Returns: None PT-20 Programming Guide...
  • Page 107: Simulator (Only For Pc Simulator)

    Simulator (Only for PC Simulator) CopyFileToTerminal Purpose: Use BackupDataFiletoPC to copy data file to C:\Data directory in PC. Syntax: void CopyFileToTerminal(char *pssPCFileName, char *pssPDTFileName); Example call: CopyFileToTerminal("..\\Lookup\\MenuLook.dat", "D:\\Lookup\\MenuLook.dat"); #include “SDK.h” Includes: Description: The CopyFileToTerminal function copies the PC file path specified by pssPCFileName pointer to the simulator path specified by pssPDTFileName pointer.
  • Page 108: Data Conversion

    Data Conversion __itoa Purpose: Use __itoa to convert an integer value to a null-terminated character string. Syntax: char * __itoa (int value, char *string, int radix); __itoa(32, buffer, 16); /* buffer will contain “20” */ Example call: #include “SDK.h” Includes: Description:...
  • Page 109 When radix is 10 and the value is negative, the converted string will start with a minus sign. Returns: The __ltoa function returns the pointer to the converted string (i.e., it returns the argument string). __ultoa Purpose: Use __ultoa to convert an unsigned long integer value to a character string. Syntax:...
  • Page 110: Scan Module (Ccd) Configuration Table

    APPENDIX 1: Scan Module (CCD) Configuration Table Command1 Command2 Value 0:On * Indication Power on alert 1:None 2:Off 0: Disable LED indication 1: Enable * 0: Disable Buzzer indication 1: Enable * 0: Before code data * Transmission Code ID position 1: After code data 0: Disable * Code ID transmission...
  • Page 111 Preamble characters 0x00 ~ 0xff ASCII code settings 22 characters. Postamble characters 0x00 ~ 0xff ASCII code settings 22 characters. 0: Disable * Code 11 Read 1: Enable 0: Disable * Check-sum verification 1: One digit 2: Two digits 0: Disable * Check-sum transmission 1: Enable 0 ~ 64...
  • Page 112 <*> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Standard * Format 1: Full ASCII 0: Disable * Start/stop transmission 1: Enable 0: Disable * Code 93 Read 1: Enable 0: Disable Check-sum verification 1: Enable * 0: Disable * Check-sum transmission 1: Enable...
  • Page 113 <#> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Standard * Format 1: UCC.EAN 128 <#> UCC/EAN 128 ID setting 0x00 ~ 0xff ASCII code(1 bytes) 0x1D * Concatenation code 0x00 ~ 0xff ASCII code(1 bytes) 0: Disable * Codabar Read...
  • Page 114 0 ~ 15 Truncate ending <FF> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: None * Supplement digits 1: 2 digits 2: 5 digits 3: 2, 5 digits 4: UCC/EAN 128 5: 2, UCC/EAN 128 6: 5, UCC/EAN 128 7: All 0: None * Truncation/expansion...
  • Page 115 ISBN/ISSN conversion 1: Enable 0:Disable * Industrial 2 of 5 Read 1:Enable 0 ~ 64 Max. code length 0 ~ 64 Min. code length 0 ~ 15 Truncate leading 0 ~ 15 Truncate ending <i> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Disable Interleaved 2 of...
  • Page 116 Max. code length 0 ~ 64 Min. code length 0 ~ 15 Truncate leading 0 ~ 15 Truncate ending <i> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Disable * MSI Plessey Read 1: Enable 0: Disable Check-sum verification 1: Mod 10 * 2: Mod 10/10...
  • Page 117 Min. code length 0 ~ 15 Truncate leading 0 ~ 15 Truncate ending <@> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Disable * Telepen Read 1: Enable 0: Disable * Check-sum verification 1: Enable 0: Disable * Check-sum transmission 1: Enable 0 ~ 64...
  • Page 118 0: None * Supplement digits 1: 2 digits 2. 5 digtis 3: 2, 5 digits 4: UCC/EAN 128 5: 2, UCC/EAN 128 6: 5, UCC/EAN 128 7: All 0: None Truncate/expansion 1: Truncate leading zero * 2: Expand to EAN 13 0: Disable UPCE Read...
  • Page 119 0: Disable * Matrix 25 Read 1: Enable 0: Disable * Check-sum verification 1: Enable 0: Disable * Check-sum transmission 1: Enable 0 ~ 64 Max. code length 0 ~ 64 Min. code length 0 ~ 15 Truncate leading 0 ~ 15 Truncate ending <B>...
  • Page 120 bytes) 0: Disable * UCC/EAN 128 emulation 1: Enable 0: Disable * RSS Limited Read 1: Enable 0 ~ 15 Truncate leading 0 ~ 15 Truncate ending <RL> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Disable * UCC/EAN 128 emulation 1: Enable 0: Disable *...
  • Page 121 0 ~ 15 Truncate ending <p> Code ID setting 0x00 ~ 0xff ASCII code(1 or 2 bytes) 0: Disable * Leading “A” 1: Enable PT-20 Programming Guide...
  • Page 122: Scan Module (Laser) Configuration Table

    APPENDIX 2: Scan Module (Laser) Configuration Table Command1 Command2 Value 0: Disable Indication LED indication 1: Enable * 0: Disable Buzzer indication 1: Enable * 0: Before code data * Transmission Code ID position 1: After code data 0: Disable * Code ID transmission 1: Enable 0: Disable *...
  • Page 123 length #4 See Note1 Configurable code (4 characters) length #5 See Note1 Configurable code (4 characters) length #6 See Note1 Configurable code (4 characters) length #7 17 : 1~30 See Note2 Scan Timeout (Sec) 0~255 (0: Disable) Idle Timeout (Sec) See Note2 0x00 ~ 0xff ASCII code (1-10 String setting...
  • Page 124 bytes) 0: Disable * Full ASCII 1: Enable 0: Disable * Transmit Start/Stop 1: Enable Characters 0: Disable * Italian Pharmacode 1: Enable 0: Disable Italian Pharmacode 1: Enable * Only 0: Disable Code 93 Read 1: Enable * 0: Disable* Code ID setting 0x20 ~ 0xff ASCII code(1 bytes)
  • Page 125 0: Disable * Codabar Read 1: Enable 0: Disable * Check Digit 1: Enable 0: Disable * Transmit Check Digit 1: Enable 0: Disable* Code ID setting 0x20 ~ 0xff ASCII code(1 bytes) 0: Disable * Transmit Start/Stop 1: Enable Characters 0: Disable * Dual Field...
  • Page 126 0: Disable * ISMN Supplement 1: Enable Required 0:Disable * Industrial 2 of Read 1:Enable 0: Disable* Code ID setting 0x20 ~ 0xff ASCII code(1 bytes) 0: Disable Interleaved 2 Read 1: Enable * of 5 0: Disable * Check Digit 1: Enable 0: Disable * Transmit Check Digit...
  • Page 127 bytes) 0: Disable * Alpha Telepen 1: Enable 0: Disable UPCA Read 1: Enable * 0: Disable Transmit Check Digit 1: Enable * 0: Disable* Code ID setting 0x20 ~ 0xff ASCII code(1 bytes) 0: Disable * Convert to EAN-13 1: Enable 0: Disable * Coupon...
  • Page 128 Code ID setting 0x20 ~ 0xff ASCII code(1 bytes) 0: Disable * UPC/EAN Supplements Required 1: Enable General 0: Disable * Two Digit Supplements 1: Enable 0: Disable * Five Digit Supplements 1: Enable 0: Disable * Two Digit Redundancy 1: Enable 0: Disable * Five Digit Redundancy...
  • Page 129 Note1: There are seven bar code lock lengths available. Specific code type can be assigned to a lock length. Code type: CODE11 CODE39 CODE93 CODE128 CODABAR INDUSTRIAL_25 INTERLEAVED_25 6C MSI_PLESSEY UK_PLESSEY TELEPEN MATRIX_25 TRIOPTIC Length: 0~80 (0: Disable) Default setting: “0000”...
  • Page 130 Note2: ScanTimeout: The maximum time, in seconds, during which the laser remains on without decoding any barcode. IdleTimeout: The maximum time, in seconds, during which the scanner remains idle without any action. Note3: When this setting is enable the UCC / EAN 128 barcode can not be read. Note4: IATA 2 of 5 only support 13, 15 Digit.

This manual is also suitable for:

Pa-21Pa-2110Pa-2010

Table of Contents