Portable Data Terminal PA-20 / PA-2010 PA-21 / PA-2110 Programming Guide Version: 1.07 Copyright © 2012 by ARGOX Informatio
PT-20 Programming Guide 8 #include <stdlib.h> The statements listed above will make Compiler and Linker to import all the correlated functi
PT-20 Programming Guide 98 Description: This function can get power on status for resume or restart. Returns: 0:Resume 1:Restart SetAutoPWOff Purpos
PT-20 Programming Guide 99 Purpose: To get the SN of PT10/12. Syntax: void SN_Get(char *pssSNBuffer); Example call: SN_Get(SNBuffer); Includes: #inc
PT-20 Programming Guide 100 Memory Tfree Purpose: Use the Tfree to release an allocated storage block to the pool of free memory. Syntax: void Tfree
PT-20 Programming Guide 101 Purpose: Checking the used heap size. Syntax: int UsedHeapSize(void); Example call: usedsize = UsedHeapSize(); Includes:
PT-20 Programming Guide 102 Vibrate on_vibrator Purpose: Use on_vibrator to set vibrator on. Syntax: void on_vibrator(void); Example call: on_vibrat
PT-20 Programming Guide 103 Other prc_menu_color Purpose: Create a menu-driven interface. Syntax: void prc_menu_color(MENU_COLOR *menu); Example cal
PT-20 Programming Guide 104 call the prc_menu function to build a hierarchy menu-driven user interface. Returns: None prc_menu_Set_SelectWithEnt Pu
PT-20 Programming Guide 105 Simulator (Only for PC Simulator) CopyFileToTerminal Purpose: Use BackupDataFiletoPC to copy data file to C:\Data direct
PT-20 Programming Guide 106 Data Conversion __itoa Purpose: Use __itoa to convert an integer value to a null-terminated character string. Syntax: ch
PT-20 Programming Guide 107 When radix is 10 and the value is negative, the converted string will start with a minus sign. Returns: The __ltoa funct
PT-20 Programming Guide 9 How to Build Your Program 1. Edit Program: Developers may use the Application.c file under Source folder in the PA2-T
PT-20 Programming Guide 108 APPENDIX 1: Scan Module (CCD) Configuration Table Command1 Command2 Value 5 Indication 1 Power on alert 0:On * 1:None 2:
PT-20 Programming Guide 109 3 Preamble characters settings 0 * 0x00 ~ 0xff ASCII code 22 characters. 4 Postamble characters settings 0 * 0x00 ~ 0xff
PT-20 Programming Guide 110 8 Code ID setting <*> 0x00 ~ 0xff ASCII code(1 or 2 bytes) 10 Format 0: Standard * 1: Full ASCII 13 Start/stop tra
PT-20 Programming Guide 111 8 Code ID setting <#> 0x00 ~ 0xff ASCII code(1 or 2 bytes) 10 Format 0: Standard * 1: UCC.EAN 128 12 UCC/EAN 128 I
PT-20 Programming Guide 112 7 Truncate ending 0 ~ 15 0 * 8 Code ID setting <FF> 0x00 ~ 0xff ASCII code(1 or 2 bytes) 10 Supplement digits 0: N
PT-20 Programming Guide 113 ISBN/ISSN conversion 1: Enable 17 Industrial 2 of 5 1 Read 0:Disable * 1:Enable 4 Max. code length 0 ~ 64 0 * 5 Min. cod
PT-20 Programming Guide 114 Max. code length 0 * 5 Min. code length 0 ~ 64 0 * 6 Truncate leading 0 ~ 15 0 * 7 Truncate ending 0 ~ 15 0 * 8 Code ID
PT-20 Programming Guide 115 Min. code length 0 * 6 Truncate leading 0 ~ 15 0 * 7 Truncate ending 0 ~ 15 0 * 8 Code ID setting <@> 0x00 ~ 0xff
PT-20 Programming Guide 116 10 Supplement digits 0: None * 1: 2 digits 2. 5 digtis 3: 2, 5 digits 4: UCC/EAN 128 5: 2, UCC/EAN 128 6: 5, UCC/EAN 128
PT-20 Programming Guide 117 25 Matrix 25 1 Read 0: Disable * 1: Enable 2 Check-sum verification 0: Disable * 1: Enable 3 Check-sum transmission 0: D
PT-20 Programming Guide 10 Add or Delete Files: When adding or deleting the source files, you can do the adding and removing directly under the
PT-20 Programming Guide 118 bytes) 11 UCC/EAN 128 emulation 0: Disable * 1: Enable 30 RSS Limited 1 Read 0: Disable * 1: Enable 6 Truncate leading 0
PT-20 Programming Guide 119 7 Truncate ending 0 ~ 15 0 * 8 Code ID setting <p> 0x00 ~ 0xff ASCII code(1 or 2 bytes) 10 Leading “A” 0: Disable
PT-20 Programming Guide 120 APPENDIX 2: Scan Module (Laser) Configuration Table Command1 Command2 Value 5 Indication 2 LED indication 0: Disable 1:
PT-20 Programming Guide 121 length #4 14: Configurable code length #5 See Note1 (4 characters) 15: Configurable code length #6 See Note1 (4
PT-20 Programming Guide 122 bytes) 10 Full ASCII 0: Disable * 1: Enable 13 Transmit Start/Stop Characters 0: Disable * 1: Enable 14 Italian Pharmaco
PT-20 Programming Guide 123 14 Codabar 1 Read 0: Disable * 1: Enable 2 Check Digit 0: Disable * 1: Enable 3 Transmit Check Digit 0: Disable * 1: Ena
PT-20 Programming Guide 124 15 ISMN Supplement Required 0: Disable * 1: Enable 17 Industrial 2 of 5 1 Read 0:Disable * 1:Enable 8 Code ID setting 0:
PT-20 Programming Guide 125 bytes) 10 Alpha Telepen 0: Disable * 1: Enable 23 UPCA 1 Read 0: Disable 1: Enable * 3 Transmit Check Digit 0: Disable 1
PT-20 Programming Guide 126 Code ID setting 0x20 ~ 0xff ASCII code(1 bytes) 35 UPC/EAN General 1 Supplements Required 0: Disable * 1: Enable 2 Two D
PT-20 Programming Guide 127 Note1: There are seven bar code lock lengths available. Specific code type can be assigned to a lock length. Code type
PT-20 Programming Guide 11 Upgrade System 1. System Requirement: Software: PT-FileManager Hardware: PA-20 / PA-2010 / PA-21 / PA-2110 and PC.
PT-20 Programming Guide 128 Note2: ScanTimeout: The maximum time, in seconds, during which the laser remains on without decoding any barcode. Idl
PT-20 Programming Guide 12 And input password “00000” ->Communication ->Upgrade . Then connect the Cradle to the PC and wait for comm
PT-20 Programming Guide 13 In PTFileManager: Execute PTFileManager and select Tool\F/W Update . Select the Binary file and complete the fir
PT-20 Programming Guide 14 Utility & Others 1. AID MAKER Select PA-20 / PA-2010 / PA-21 / PA-2110 in communication mode. Double click “Age
PT-20 Programming Guide 15 SDK Library SDK Functions list Function Description Reader InitScanner1 Initialize respective scanner port. Decode Perfo
PT-20 Programming Guide 16 BT_Close Bluetooth disconnect. BT_Read Read characters from Bluetooth module. BT_Write Write characters to Bluetooth modu
PT-20 Programming Guide 17 DiskD_format Format disk D. DiskC_totalsize Checking the total space in disk C. DiskD_totalsize Checking the total space
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. T
PT-20 Programming Guide 18 SearchMultiField_GF Search the designated field. The field’s information include field string and field number.You can wr
PT-20 Programming Guide 19 variables according to specified formats. _scanf_color_DefaultStr Use _scanf_color_DefaultStr to set a default string
PT-20 Programming Guide 20 _putchar Display a character in color black on the LCD display. _putchar_color Display a character in user define color o
PT-20 Programming Guide 21 Remote SetRemoteBaud Setting the RemoteLink baud rate. GetRemoteBaud Getting the RemoteLink baud rate. SetRemoteInterfac
PT-20 Programming Guide 22 number key to select menu. Simulator (Only for PC Simulator) CopyFileToTerminal Use BackupDataFiletoPC to copy data file
PT-20 Programming Guide 23 Reader InitScanner1 Purpose: Initialize respective scanner port. Syntax: void InitScanner1(void); Example call: InitScann
PT-20 Programming Guide 24 Example call: InitScanner1( ); while(1) { if (Decode()) SleepScanner1(TRUE); while(_getchar()==0); SleepScanner
PT-20 Programming Guide 25 Description: This function can reset scan module,if reset OK,this function will return 1,else will return 0. Returns: 0:R
PT-20 Programming Guide 26 Description: This function can send command to set scanner status. You can see “Appendix 2” to know about the command set
PT-20 Programming Guide 27 1: Load OK. Scanner_Version Purpose: Query the scan module version. Syntax: BOOL Scanner_Version(char* Returnbuf); Exampl
PT-20 Programming Guide 1 Table of Contents Program Developing ...
PT-20 Programming Guide 28 Buzzer beeper_status Purpose: To see whether a beeper sequence is under going or not. Syntax: int beeper_status(void); Ex
PT-20 Programming Guide 29 Purpose: Set the buzzer volume. Syntax: void SetBuzzerVol(int slVol); Example call: SetBuzzerVol(0);//Buzzer close. Inclu
PT-20 Programming Guide 30 Calender DayOfWeek Purpose: Get the day of the week information. Syntax: int DayOfWeek(void); Example call: day=DayOfWeek
PT-20 Programming Guide 31 Syntax: int set_time(char *new_time); Example call: set_time(“20030401223035”); Includes: #include “SDK.h ” Description:
PT-20 Programming Guide 32 Bluetooth(For PA-2010 / PA-2110) These functions only for PA-2010 / PA-2110, and our Bluetooth module only support SPP mo
PT-20 Programming Guide 33 BT_CONNECT : Bluetooth has connected, please run BT_Close. BT_OK : Bluetooth connect ok. BT_Close Purpose: Bluetooth disc
PT-20 Programming Guide 34 characters will be writed to other Bluetooth device, and “pslPutSize” will tell you how meny characters send to other Blu
PT-20 Programming Guide 35 char assPinCode[20]; //Set PIN code. }_BT_INFO; Returns: BT_NOMODULE : The terminal is notPA-2010 / PA-2110. BT_OK : Get
PT-20 Programming Guide 36 Returns: BT_NOMODULE : The terminal is notPA-2010 / PA-2110. BT_NOSTART : Bluetooth module power disable, please run BT_S
PT-20 Programming Guide 37 File Manipulation __access Purpose: Check for file existence. Syntax: int __access(char *filename); Example call: if(__ac
PT-20 Programming Guide 2 TextBlock ... 84
PT-20 Programming Guide 38 Purpose: Write a null terminated character string to the bottom (end-of-file position) of a DAT file. Syntax: int appendl
PT-20 Programming Guide 39 fErrorCode: 2:File specified by fd does not exist. 8:File not opened 10:No more free file space for file extension. close
PT-20 Programming Guide 40 9:The value of count is negative. 10:No more free file space for file extension. delete_topln Purpose: Remove a null term
PT-20 Programming Guide 41 Purpose: Get file length information of a DAT file. Syntax: long filelength(int fd); Example call: datasize = filelength(
PT-20 Programming Guide 42 Description: The lseek function moves the file pointer of a DAT file whose file handle is specified in the argument fd to
PT-20 Programming Guide 43 and an error code is set to the global variable fErrorCode to indicate the error condition encountered. Possible error co
PT-20 Programming Guide 44 readln Purpose: Read a line terminated by a null character “\0” from a DAT file. Syntax: int readln(int fd, char *buffer,
PT-20 Programming Guide 45 fErrorCode: 1:filename is a NULL string. 2:File specified by filename does not exist. _rename Purpose: Change file name o
PT-20 Programming Guide 46 fErrorCode: 2:File handle is NULL. 7:fd is not a file handle of a previously opened file. write Purpose: Write a specifie
PT-20 Programming Guide 47 to the file (includes the null character). In case of error, writeln returns an integer value of -1 and an error code is
PT-20 Programming Guide 3 Program Developing Development Environment Folder Structure: When open the SDK folder in the CD provided with the PA-20
PT-20 Programming Guide 48 Example call: DiskD_totalsize ( ); Includes: #include “SDK.h ” Description: The DicskD_totalsize function returns the tot
PT-20 Programming Guide 49 Description: The DicskD_freesize function returns the free space in disk D. Returns: 0xffffffff : Disk C unformatted.
PT-20 Programming Guide 50 Lookup”. Returns: -1 : path error. -2 : disk unformat. upward 0 : When pssBuffer = NULL, it will return buffer size. Wh
PT-20 Programming Guide 51 _fcloseAll Purpose: Use _fcloseAll to close all files opened for buffered input/output with _fopen or tmpfile. Syntax: vo
PT-20 Programming Guide 52 w+ Creates a file and opens it for both reading and writing. If file exists, current contents are destroyed. Returns: If
PT-20 Programming Guide 53 non-zero value. _fwrite Purpose: Use _fwrite to write a specified number of data itmes, each of a given size, from a buff
PT-20 Programming Guide 54 DBMS Ini_Search Purpose: Use “Ini_Search” can initiate the file search function in disk. Syntax: int Ini_Search(_TFILE* f
PT-20 Programming Guide 55 unsigned char *pusFielddlt This argument has two kinds of meanings. When record _ Type is 0, search for regular length.
PT-20 Programming Guide 56 filepoint = _fopen(“c:\\data\\data.txt”,”r+”); Ini_Search(filepoint, &fsearch, ausFielddlt, NULL, 0, 1, 0, 5, 0); Exa
PT-20 Programming Guide 57 unsigned char *pusFielddlt This argument has two kinds of meanings. When record _ Type is 0, search for regular length.
PT-20 Programming Guide 4 Folder introduction: Upgrade: For Fw upgrade, it has two sub folders, “Ugrade BIN file” and “Upgrade BAT file”. Ugr
PT-20 Programming Guide 58 Syntax: int Close_Search(_DBMS* F_Search); Example call: Close_Search(&F_Search); Includes: #include “DBMS.h” Descrip
PT-20 Programming Guide 59 recordno, char* R_Buffer, int flag); Example call: char str[8]=”abcdefg”,str_buffer[60]; SearchField_GR(&fsearch, str
PT-20 Programming Guide 60 Description: Search the correctly appointed field. After search success, acquiring another appointed field which includin
PT-20 Programming Guide 61 argument description _DBMS* F_Search The file’s searching structure that has been initialized. char* multi_field Stri
PT-20 Programming Guide 62 Syntax: int GetRecordNum(_DBMS* F_Search); Example call: int record_num; record_num= GetRecordNum(&fsearch); Includes
PT-20 Programming Guide 63 Other value: the quantity of the data. WriteField Purpose: Use this function can revise the designated record in the ex
PT-20 Programming Guide 64 Returns: When char * buffer = NULL, functions will pass the data size back. Read defeat: Pass back - 1. When char * buf
PT-20 Programming Guide 65 LED set_led Purpose: To set the LED indicators Syntax: void set_led(int led, int mode, int duration); Example call: set_l
PT-20 Programming Guide 66 Keypad clr_kb Purpose: To clear the keyboard buffer. Syntax: void clr_kb(void); Example call: clr_kb( ); Includes: #inclu
PT-20 Programming Guide 67 Syntax: void set_alpha_mode_state(int status); Example call: set_alpha_mode_state(ALPHA_123); Includes: #include “SDK.h ”
PT-20 Programming Guide 5 For terminal develop environment. Upgrade SDK Tool: For upgrade App.bin in Force Mode. AID Maker: For set PA-20 / PA-
PT-20 Programming Guide 68 Returns: None get_keypad_BL_Timer Purpose: Get keypad backlight timer. Syntax: int get_keypad_BL_Timer(void); Example
PT-20 Programming Guide 69 Includes: #include “SDK.h ” Description: The function returns an integer indicates the key click staus.The default is ena
PT-20 Programming Guide 70 Includes: #include “SDK.h ” Description: You can check the FN-Key function that is default setting or custom setting. s
PT-20 Programming Guide 71 Returns: FALSE:set fail TRUE:set success GetScanKeyPwOn Purpose: Get state for power on by scan key. Syntax: BOOL GetScan
PT-20 Programming Guide 72 successfully read, converted, and saved in variables. A return value equal to EOF means that an end-of-file was encounter
PT-20 Programming Guide 73 Syntax: void _scanf_ctrl_ScannerStatus(BOOL bStatus); Example call: _scanf_ctrl_ScannerStatus(TRUE); Includes: #include “
PT-20 Programming Guide 74 Includes: #include “SDK.h ” Description: When use “_scanf_color” function, this function can set auto press ENT key after
PT-20 Programming Guide 75 0 : Input character nomoral display. others : Input character display define word. Returns: none _scanf_ctrl_KeypadLock
PT-20 Programming Guide 76 LCD The following functions clr_eol, clr_rect, clr_scr, fill_rect, fill_rect_color, Get_Cursor, Set_Cursor, gotoxy, where
PT-20 Programming Guide 77 system. Returns: None fill_rect Purpose: Fill a white rectangular area on the LCD display. Syntax: void fill_rect(int lef
PT-20 Programming Guide 6 Function Library PA-20 / PA-2010 / PA-21 / PA-2110 Function Library supports user application program to perform the da
PT-20 Programming Guide 78 Returns: The Get_Cursor function returns an integer of 1 if the cursor is visible (turned on), 0 if not. Set_Cursor Purpo
PT-20 Programming Guide 79 Example call: wherexy(&x_position,&y_position); Includes: #include “SDK.h ” Description: The wherexy function cop
PT-20 Programming Guide 80 Includes: #include “SDK.h ” Description: The lcd_backlit_Getlv gets LCD backlight level. Returns: LCD backlight level for
PT-20 Programming Guide 81 Syntax: int _putchar_color(int color, char c); Example call: _putchar_color(COLOR_BLACK, ‘A’); Includes: #include “SDK.h
PT-20 Programming Guide 82 Description: The showet_image function displays a rectangular bitmap specified by pat to the LCD display. The rectangular
PT-20 Programming Guide 83 UserFont DispFont_SetFont Purpose: Set user font from font file. Syntax: BOOL DispFont_SetFont(S32 slSelFont, const char
PT-20 Programming Guide 84 TextBlock TextBlock is a floating window printing rectangle area on screen. TextBlock defines it’s activated area anywher
PT-20 Programming Guide 85 Description: The DefineTextBlock function defines font,background graph,size and position. There are total 15 Windows. sl
PT-20 Programming Guide 86 Example call: ResetTextBlock(1); Includes: #include “SDK.h ” Description: When set slngle layer mode, ResetTextBlock will
PT-20 Programming Guide 87 Purpose: Get TextBlock current position. Syntax: POINT GetTextBlockCur(S32 slBlockNo); Example call: pt = GetTextBlockCur
PT-20 Programming Guide 7 Standard Function Library The user application program in the data collector can perform the tasks to combine standard C
PT-20 Programming Guide 88 Includes: #include “SDK.h ” Description: This function can help you to set background color. After use this function, all
PT-20 Programming Guide 89 Communication Ports clear_com Purpose: Clear receive buffer Syntax: void clear_com(int port); Example call: clear_com(1);
PT-20 Programming Guide 90 Description: This routine is used to check if prior transmission is still in process or not. Use the argument “port” as t
PT-20 Programming Guide 91 transmitted one by one until the specified number of character is sent. Use the argument “port” as the connect port which
PT-20 Programming Guide 92 i = read_com(1,c); if (i) _printf(“char %c received from COM1”,*c); Includes: #include “SDK.h ” Description: This routine
PT-20 Programming Guide 93 USB_Read Purpose: Read specific number of bytes from USB port. Syntax: int USBRead(unsigned char *rbuf, unsigned int rLen
PT-20 Programming Guide 94 Remote SetRemoteBaud Purpose: Setting the RemoteLink baud rate. Syntax: void SetRemoteBaud(int slBaud); Example call: Set
PT-20 Programming Guide 95 Case 5: _printf_color(COLOR_RED, “RemoteLink baud rate=4800”); Break; } Includes: #include “SDK.h ” Descriptio
PT-20 Programming Guide 96 Returns: 0:RS-232 1:USB RemoteLink Purpose: Use RemoteLink to call the transmission function for user to upload or downlo
PT-20 Programming Guide 97 System Two time variables are declared by the system, which can be used for counting time. As they are updated by system
Komentarze do niniejszej Instrukcji