PT20 SDK Programming Guide
PT20 SDK Programming Guide
PT-20 / PT-20B
Programming Guide
Version: 1.04A
Preface
To satisfy the users customized needs, the PT-20 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.
Developers can use ARM Assembly or C code to create the program flow. And developers can
also link standard ANSI C function library to meet the demands through executing the
functions of input, output, expression and storage using the functions provided by PT-20.
Later in this manual, youll learn how to write, compile and link program, and also how to
download renewed codes and test functions via simulation. Finally, this manual will also
conclude the function illustration of PT-20 for your reference.
Table of Contents
Program Developing ........................................................................................3
Development Environment .......................................................................3
1.1
SDK Directory......................................................................3
1.2
Development Tool Kit ..........................................................5
Function Library ........................................................................................8
Standard Function Library.........................................................................9
How to Build Your Program..................................................................... 11
1.3
Edit Program: .................................................................... 11
1.4
Under RealView: ............................................................... 11
1.5
Update Firmware:..............................................................12
1.6
Development Notice: .........................................................12
Upgrade Application................................................................................13
1.7
System Requirement:........................................................13
1.8
Upgrade Procedure: ..........................................................13
1.9
Execute User Program: .....................................................14
Utility & Others........................................................................................15
1.10
AID MAKER.......................................................................15
1.11
Scanner FW Upgrade........................................................15
1.12
Font ...................................................................................15
1.13
ScanSetting .......................................................................15
SDK Library ...................................................................................................16
SDK Functions list ..................................................................................16
Reader ....................................................................................................23
Buzzer ....................................................................................................27
Calender .................................................................................................29
Bluetooth(Only for PT-20B).....................................................................31
File Manipulation.....................................................................................36
DBMS .....................................................................................................53
LED.........................................................................................................62
Keypad....................................................................................................63
LCD ........................................................................................................72
UserFont .................................................................................................79
TextBlock ................................................................................................80
Communication Ports .............................................................................84
PT-20 Programming Guide
Remote ...................................................................................................89
System....................................................................................................92
Memory...................................................................................................95
Vibrate ....................................................................................................97
Other.......................................................................................................98
Simulator (Only for PC Simulator)...........................................................99
Data Conversion ...................................................................................100
APPENDIX 1 ............................................................................................102
Scan Command Table...........................................................................102
Program Developing
Development Environment
1.1 SDK Directory
Folder Structure:
When open the SDK folder in the CD provided with the PT-20, it will show the structure
as the following:
In RealView CodeWarrior, you can open the RealView project PT20-SDK.mcp by double
click as figure:
After finish application code development, you can compile and link application code as
figure:
Then, turn off PT-20, and press 1+3+0 keys, when press these keys, turn on PT-20, and
you will go into Supervisor Menu
->Communication
->AP Install
and
Function Library
PT-20 Function Library supports user application program to perform the data
collection jobs. PT-20 Function Library provides variety of services, and
accomplishes special functions according to specific demands.
When using the PT-20 Function Library, please add the import command (#include
SDK.h) into the user program file (*.c) and the function will be imported. In this case,
the PT-20 Function Library file PT20Library.a is needed.
The PT-20 Function Library file PT20Library.a is updated occasionally. For most
update version, please ask helps from your vendor or the manufacturer.
PT-20 Function Library file PT20Library.a is needed during compiling and linking for
generating AP.bin.
The update library release is SDK.h. Please refer SDK Library section.
#include <stdlib.h>
The statements listed above will make Compiler and Linker to import all the
correlated functions to generate AP.bin file.
10
11
(Figure 1)
12
Upgrade Application
1.7 System Requirement:
Software: Argolink
Hardware: PT-20 and PC.
Firmware: Binary file generated by RealView compiler (AP.bin)
->Communication
->AP
13
Install
PTFileManager communication.
Execute PTFileManager and select Tool\F/W Update
14
1.12 Font
This utility SDK Tool in Font folder can do somethings as follows
When you need a BMP picture to display, you can make a BMP text by our SDK
Tool. This text file is your BMP file image array, you can copy this array in your code
and compiler that.
When you need a font array in your source code, you can make the font array by
SDK Tool to make font text.
When you need a font file for your application, you can make the font file by SDK
Tool, the font generator can help you to make a font file.
1.13 ScanSetting
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 PT-20, and use SDK function
ScannerSetFromFile to set your scanner setting.
15
SDK Library
SDK Functions list
Function
Description
Reader
InitScanner1
Decode
HaltScanner1
TriggerStatus
Scanner_Reset
Scanner_Config_Start
Scanner_Config_End
Scan_SendCommand
Scan_QueryStatus
ScannerSetFromFile
Scanner_Version
Buzzer
beeper_status
off_beeper
on_beeper
SetBuzzerVol
Calender
DayOfWeek
get_time
set_time
BT_Stop
BT_Open
Bluetooth connect.
BT_Close
Bluetooth disconnect.
BT_Read
BT_Write
BT_GetLocalInfo
BT_SetLocalSet
16
BT_Inquiry
File Manipulation
__access
append
appendln
chsize
close
delete_top
delete_topln
eof
filelength
filelist
lseek
open
Open a DAT file and get the file handle of the file for further
processing.
read
read_error_code
readln
_remove
Delete file.
_rename
tell
write
writeln
DiskC_format
Format disk C.
DiskD_format
Format disk D.
DiskC_totalsize
DiskD_totalsize
DiskC_usedsize
DiskD_usedsize
DiskC_freesize
DiskD_freesize
17
getDirNum
getFileNum
getDirList
getFileList
_fclose
_fcloseAll
_filelength
_fopen
_fopenLookup
_fread
_fseek
_fwrite
DBMS
Ini_Search
Close_Search
SearchField
SearchField_GR
SearchField_GF
SearchMutiField_GF
SeekRecord
GetRecordNum
DeleteRecord
18
DeleteLastRecord
AppendRecord
WriteField
WriteRecord
ReadField
ReadRecord
LED
set_led
Keypad
clr_kb
dis_alpha
en_alpha
get_alpha_enable_state
set_alpha_mode_state
get_alpha_mode_state
set_keypad_BL
get_keypad_BL
set_keypad_BL_Timer
get_keypad_BL_Timer
_getchar
GetKeyClick
SetKeyClick
Def_PKey
_scanf_color
_scanf_color_DefaultStr
_scanf_ctrl_ScannerStatus
_scanf_ctrl_Vibrate
_scanf_ctrl_ScanWithENT
_scanf_ctrl_AlphaKey
_scanf_ctrl_AlphaKey_Mode
19
_scanf_ctrl_password
_scanf_ctrl_KeypadLock
FNKey_Reset
FNKey_GetState
FNKey_SetUserDef
LCD
clr_eol
Clear from where the cursor is to the end of the line. The
cursor position is not affected after the operation.
clr_rect
clr_scr
fill_rect
fill_rect_color
GetCursor
SetCursor
gotoxy
wherex
wherexy
wherey
lcd_backlit_Setlv
lcd_backlit_SetTimer
lcd_backlit_Getlv
lcd_backlit_GetTimer
_printf_color
_putchar
_putchar_color
_puts
_puts_color
show_image_bmp
UserFont
DispFont_SetFont
DispFont_SetPFont
DispFont_GetFontInfo
TextBlock
DefineTextBlock
20
SetTextBlock
ResetTextBlock
PrintTextBlock
GetTextBlockCur
SetTextBlockCur
ShowTextBlockCursor
TextBlock_SetBGColor
TextBlock_SetBGImage
Communication Ports
clear_com
close_com
com_cts
com_eot
com_overrun
com_rts
nwrite_com
open_com
read_com
write_com
USB_Open
USB_Close
USB_Read
USB_Write
Remote
SetRemoteBaud
GetRemoteBaud
SetRemoteInterface
GetRemoteInterface
RemoteLink
RemoteLink_RealTime
System
SysSuspend
SysDelay
SetPowerOnState
GetPowerOnState
21
SetAutoPWOff
GetAutoPWOff
SetStatusBAR
GetStatausBAR
SN_Get
BIOS_SetDefault
Check_AID
Memory
Tfree
Tmalloc
TotalHeapSize
UsedHeapSize
FreeHeapSize
Vibrate
on_vibrator
off_vibrator
set_vibrator_timer
get_vibrator_timer
Other
prc_menu_color
BackupDataFiletoPC
Data Conversion
__itoa
__ltoa
__ultoa
22
Reader
InitScanner1
Purpose
Syntax
Example call
Includes
Description
Returns
None
Decode
Purpose
Syntax
Example call
Includes
Description
Pream
name
ble
ID*
Code
Barcode
Lengt
data
ID*
Posta
Termi
mble
nator
h
The ID position depends on Code ID position setting.
Returns
0 : Fail
Other value : Barcode length
HaltScanner1
Purpose
Syntax
23
Example call
Includes
Description
HaltScanner1( );
#include SDK.h
Use HaltScanner1 function to stop scanner port from operating. To
restart a halted scanner port, the initialization function, InitScanner1,
must be called. It is recommended that the scanner port should be
stopped if the barcode decoding is not required for a long period of time.
Returns
none
TriggerStatus
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function can check the scan key status, if pressed scan key, this
function will return 1, else will return 0.
Returns
Scanner_Reset
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
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
Syntax
Example call
Includes
Description
Returns
Scanner_Config_End
Purpose
Syntax
Example call
24
Includes
Description
Returns
#include SDK.h
This function can ending scanner setting procedure.
None
Scan_SendCommand
Purpose
Syntax
Example call
char ssValue = 0;
If(SCAN_SendCommand(6,7,&ssValue))
_printf_color(COLOR_RED, Setup complete!);
Includes
Description
#include SDK.h
This function can send command to set scanner status.
You can see Appendix 1 to know about the command setting.
Returns
0:Send fail.
1:Send OK.
Scan_QueryStatus
Purpose
Syntax
Example call
char ssReturn = 0;
if(SCAN_QueryStatus (6,7, &ssReturn))
_printf_color(COLOR_RED, Query OK!);
Includes
Description
#include SDK.h
This function can query scanner setting.
You can see Appendix 1 to know about the command setting.
Returns
0:Query fail.
1: Query OK.
ScannerSetFromFile
Purpose
Set scanner setting by scanner setting file. This file is made by utility
ScanSetting.
Syntax
Example call
Includes
Description
#include SDK.h
You can set scanner from scanner setting file by this function. This
function can help you set scanner setting easier.
Returns
0:Load fail.
1: Load OK.
25
Scanner_Version
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
This function can query the scan module version.
0:Query module fail.
1: Query module OK.
26
Buzzer
beeper_status
Purpose
Syntax
int beeper_status(void);
Example call
while(beeper_status( ));
Includes
Description
#include SDK.h
The beeper_status function checks if there is a beeper sequence in
progress.
Returns
off_beeper
Purpose
Syntax
Example call
Includes
Description
Returns
none
on_beeper
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
A beep frequency is an integer used to specify the frequency (tone) when
the beeper activates. The actual frequency that the beeper activates is
not the value specified to the beep frequency. It is calculated by the
following formula.
Beep Frequency = 76000 / Actual Frequency Desired
For instance, to get a frequency of 2000Hz, the value of beep frequency
should be 38. If no sound is desired (pause), the beep frequency should
beset to 0. A beep with frequency 0 does not terminate the beeper
sequence. Suitable frequency for the beeper ranges from 1 to 2700Hz,
where peak
at 2000Hz.
Returns
SetBuzzerVol
27
Purpose
Syntax
Example call
Includes
Description
Returns
Buzzer vloume
close
Low
Medium
High
None.
28
Calender
DayOfWeek
Purpose
Syntax
Example call
Includes
Description
Returns
get_time
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The get_time function reads current date and time from the calendar
chip and copies them to a character array specified in the argument
cur_time. The character array cur_time allocated must have a
minimum of 15 bytes to accommodate the date, time, and the string
terminator. The format of the system date and time is listed below.
"YYYYMMDDhhmmss"
YYYY
Returns
year, 4 digits
MM
month, 2 digits
DD
day, 2 digits
hh
hour, 2 digits
mm
minute, 2 digits
ss
second, 2 digits
set_time
Purpose
29
Syntax
Example call
set_time(20030401223035);
Includes
Description
#include SDK.h
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"
YYYY
year, 4 digits
MM
DD
hh
mm
ss
30
Returns
BT_Stop
Purpose
Syntax
Example call
Includes
Description
Returns
BT_Open
Purpose
Bluetooth connect.
Syntax
int BT_Open(void);
Example call
Includes
Description
BT_Open();
#include SDK.h
This function can connect to other Bluetooth device.Befor use this
function, you have to set the target Bluetooth MAC address by using
BT_SetLocalSet function.
Returns
31
Bluetooth disconnect.
int BT_Close(void);
BT_Close();
#include SDK.h
This function can disconnect Bluetooth. If you want to disconnect, you
can use BT_Stop(Bluetooth module power off) or this function.
Returns
BT_Read
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
If Bluetooth is connected, this function can read characters from
Bluetooth module.The parameter slReadSize can set how many
characters you will read, and the parameter pslGetSize will tell you how
many characters you read.
Returns
BT_Write
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
If Bluetooth is connected, this function can wriet characters to other
Bluetooth device.The parameter slWriteSize tell the function how many
32
BT_GetLocalInfo
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function will return the PT-20B Bluetooth information in structure.
The structure describe as follows:
typedef struct __BT_INFO
{
char assLocalAddress[16]; //PT-20B Bluetooth MAC
address.(Cannot change.)
char assLocalName[20];
BOOL bLocalSecurity;
BOOL bLocalEncryption;
int stInquiryTimeout;
char assPinCode[20];
}_BT_INFO;
Returns
33
BT_SetLocalSet
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function can help you to set our Bluetooth module parameters.
The structure describe as follows:
typedef struct __BT_INFO
{
char assLocalAddress[16]; //PT-20B Bluetooth MAC
address.(Cannot change.)
char assLocalName[20];
BOOL bLocalSecurity;
BOOL bLocalEncryption;
int stInquiryTimeout;
char assPinCode[20];
}_BT_INFO;
Returns
BT_Inquiry
34
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function can search other Bluetooth device for PT-20B to connect,
the struct stBT_DevInfo will return how many device are found and
these devices MAC address. The parameter bGetDevName will tell the
BT_Inquiry function that will return device name or not.If bGetDevName
is TRUE, then BT_Inquiry will return device name in struct
stBT_DevInfo.
Returns
35
File Manipulation
__access
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
append
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
appendln
36
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
chsize
Purpose
Syntax
Example call
Includes
Description
Returns
37
fErrorCode
close
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
delete_top
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
38
Syntax
Example call
Includes
Description
Returns
fErrorCode
eof
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
filelength
39
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
filelist
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
None
lseek
Purpose
Syntax
Example call
Includes
#include SDK.h
40
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. There are 3
possible values for the argument origin.
The values and their interpretations are listed below.
Returns
Value of origin
Interpretation
beginning of file
-1
end of file
When successful, lseek returns the new byte offset address of the
file pointer from the beginning of file. In case of error, lseek
returns a long value of -1L 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
open
Purpose
Open a DAT file and get the file handle of the file for further
processing.
Syntax
Example call
Includes
Description
#include SDK.h
The open function opens a DAT file specified by filename and
gets the file handle of the file. A file handle is a positive integer
(excludes 0) used to identify the file for subsequent file
manipulations on the file. If the file specified by filename does
not exist, it will be created first. If filename exceeds 8 characters,
it will be truncated to 8 characters long. After the file is opened,
the file pointer points to the beginning
of file.
Returns
If open successfully opens the file, it returns the file handle of the
file being opened. In case of error, open will return an integer value of -1
41
read
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The read function copies the number of bytes specified in the
argument count from the DAT file whose file handle is fd to the
array of characters buffer. Reading starts at the current position of
the file pointer, which is incremented accordingly when the
operation is completed.
Returns
The read function returns the number of bytes actually read from
the file. In case of error, read 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
read_error_code
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
None
42
readln
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
_remove
Purpose
Syntax
Example call
Includes
Description
Delete file.
int _remove(char *filename);
if (_remove(C:\\data\\store.dat) _puts(store.dat deleted);
#include SDK.h
Delete the file specified by filename. If filename exceeds 8
characters, it will be truncated to 8 characters long. If the file to be
deleted is a DBF file, the DBF file and all the index (key)
files associated to it will be deleted altogether.
Returns
43
fErrorCode
_rename
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
Change the file name of the file specified by old_filename to
new_filename. But the route does not change.
Returns
fErrorCode
tell
Purpose
Syntax
Example call
Includes
Description
Returns
The long integer value returned by tell is the current file pointer
position in file. In case of error, tell returns a long 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.
44
fErrorCode
write
Purpose
Syntax
Example call
Includes
Description
Returns
fErrorCode
writeln
Purpose
Syntax
Example call
Includes
Description
Returns
45
DiskC_format
Purpose
Syntax
Format disk C.
int DiskC_format(void);
Example call
DiskC_format ( );
Includes
#include SDK.h
Description
Returns
fErrorCode
None
DiskD_format
Purpose
Syntax
Format disk D.
int DiskD_format (void);
Example call
DiskD_format ( );
Includes
#include SDK.h
Description
Returns
fErrorCode
None
DiskC_totalsize
Purpose
Syntax
Example call
Includes
Description
Returns
DiskC_totalsize ( );
#include SDK.h
The DicskC_totalsize function returns the used space in disk C.
0xffffffff : Disk C unformatted.
Others : The total space in disk C.(Bytes)
fErrorCode
None
DiskD_totalsize
Purpose
Syntax
46
Example call
Includes
Description
Returns
DiskD_totalsize ( );
#include SDK.h
The DicskD_totalsize function returns the total space in disk D.
0xffffffff : Disk D unformatted.
Others : The total space in disk D.(Bytes)
fErrorCode
None
DiskC_usedsize
Purpose
Syntax
Example call
Includes
Description
Returns
DiskC_usedsize ( );
#include SDK.h
The DicskC_usedsize function returns the used space in disk C.
0xffffffff : Disk C unformatted.
Others : The used space in disk C.(Bytes)
fErrorCode
None
DiskD_usedsize
Purpose
Syntax
Example call
Includes
Description
Returns
DiskD_usedsize ( );
#include SDK.h
The DicskD_usedsize function returns the used space in disk D.
0xffffffff : Disk D unformatted.
Others : The used space in disk D.(Bytes)
fErrorCode
None
DicskC_freesize
Purpose
Syntax
Example call
DiskC_freesize( );
Includes
#include SDK.h
Description
Returns
fErrorCode
None
DicskD_freesize
Purpose
Syntax
Example call
DiskD_freesize( );
Includes
#include SDK.h
47
Description
Returns
fErrorCode
None
getDirNum
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
The getDirNum function can get the folder quantity in designate path.
-1 : path error.
-2 : disk unformat.
upward 0 : folder quantity.
fErrorCode
None
getFileNum
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
The getFileNum function can get the file quantity in designate path.
-1 : path error.
-2 : disk unformat.
upward 0 : folder quantity.
fErrorCode
None
getDirList
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The getDirList function can get the folder quantity and name in designate
path.
When pssBuffer = NULL, this function will return the buffer size.
For example, the path D:\ has three folders Program, Fonts,
Lookup, then the buffer will get folder information like Program Fonts
48
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
Syntax
Example call
Includes
Description
#include SDK.h
The getFileList function can get the file quantity and name in designate
path.
When pssBuffer = NULL, this function will return the buffer size.
For example, the path C:\Data\ has two files StoreIn.dat,
StoreOut.dat, and their size are 1128 bytes and 564 bytes, then the
buffer will get file information like StoreIn.dat dat 1128 StoreOut.dat dat
564 .
Returns
-1 : path error.
-2 : disk unformat.
upward 0 : When pssBuffer = NULL, it will return buffer size. When
pssBuffer != NULL, it will return file quantity.
fErrorCode
None
_fclose
Purpose
Use _fclose to close a file opened earlier for buffered input/output using
_fopen.
Syntax
Example call
Includes
Description
Returns
49
_fcloseAll
Purpose
Use _fcloseAll to close all files opened for buffered input/output with _fopen
or tmpfile.
Syntax
Example call
Includes
Description
void _fcloseAll(void);
_fcloseAll();
#include SDK.h
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.
_filelength
Purpose
Syntax
Example call
Includes
Description
Returns
The integer value returned by _filelength is the size of the file in number of
bytes.
_fopen
Purpose
Syntax
Example call
Includes
Description
Access
Interpretation
Mode String
r
Opens a new file for writing. If the file exists, its contents
are destroyed.
r+
50
w+
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. The actual structure is allocated elsewhere and you do not have to
allocate it. In case of an error, _fopen returns a NULL.
_fopenLookup
Purpose
Syntax
Example call
Includes
Description
Returns
_fread
Purpose
Use _fread to read a specified number of data items, eachof a given size,
from the current position in a file opened for buffered input. The current
position is updated after the read.
Syntax
Example call
Includes
Description
Returns
_fseek
Purpose
Syntax
Example call
51
Includes
Description
#include SDK.h
The fseek function sets the current read or write position of the file specified
by the argument file_pointer to a new value indicated by the arguments
off-set and origin. The
offset is a long integer indicating how far away the new position is from a
specific location given in origin. The following table explains the possible
value of origin.
Returns
Origin
Interpretation
SEEK_SET
Beginning of file.
SEEK_CUR
_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
Example call
Includes
#include SDK.h
Description
The _fwrite function writes count data items, each of size bytes, to the file
specified by the argument file_pointer, starting at the current position. After
the write operation is complete, the current position is updated. The data to
be written is in the buffer whose address is passed to _fwrite in the
argument buffer.
Returns
52
DBMS
Ini_Search
Purpose
Syntax
Example call
Includes
Description
#include DBMS.h
This function can initialize a work of searching file. After inserting every
argument, you can use _ DBMS* F _ Search to search files. Several
introduces the argument as follows:
argument
description
_TFILE* filehd
_DBMS* F_Search
53
int record_type
int record_length
int total_field_no
int total_record_no
Returns
0: Initialize defeat.
1: Initialize success.
Close_Search
Purpose
Syntax
Example call
Includes
Description
Returns
Use Close _ Search can close the file search function in Disk C and D.
int Close_Search(_DBMS* F_Search);
Close_Search(&F_Search);
#include DBMS.h
When want to finish the file searching state, you can use this function.
0: Close defeat.
1: Close success.
SearchField
54
Purpose
SearchField can search the appointed field that begin from the appointed
record and compare with importing string. If agreeing, pass back to the
first record.
Syntax
Example call
char str[8]=abcdefg;
int Record_Num;
Record_Num =SearchField(&fsearch, str,0,0,FORWARD);
Includes
Description
#include DBMS.h
Several describe the argument as follows:
argument
_DBMS* F_Search
description
The files searching structure that has been
initialized.
char* field
int search_fieldno
int recordno
int flag
Returns
SearchField_GR
Purpose
SearchField_GR can search the appointed field that begin from the
appointed record and compare with importing string. If agreeing, it will
copy the record which included the field to buffer.
Syntax
Example call
char str[8]=abcdefg,str_buffer[60];
SearchField_GR(&fsearch, str,0,0, str_buffer,FORWARD);
Includes
#include DBMS.h
55
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
_DBMS* F_Search
description
The files searching structure that has been
initialized.
char* field
int search_fieldno
int recordno
char* R_Buffer
int flag
Returns
SearchField_GF
Purpose
Search the designated field. After success, acquiring the appointed field
in including the fields record.
Syntax
Example call
char str[8]=abcdefg,str_buffer[60];
SearchField_GF(&fsearch, str,0,0,1,str_buffer,FORWARD);
Includes
Description
#include DBMS.h
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
56
_DBMS* F_Search
char* field
int search_fieldno
int recordno
int get_field_no
char* F_Buffer
int flag
Returns
SearchMutiField_GF
Purpose
Search the designated field. The fields information include field string
and field number.You can write many fields in this field buffer. After
searching success, acquiring the appointed field in including this fields
record.
Syntax
Example call
char str[20]=00001,0;abcdefg,1,str_buffer[60];
SearchMutiField_GF(&fsearch, str, 0,3,str_buffer,FORWARD);
Includes
Description
#include DBMS.h
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
_DBMS* F_Search
description
The files searching structure that has been
initialized.
57
char* many_field
int recordno
int get_field_no
char* F_Buffer
int flag
Returns
SeekRecord
Purpose
Syntax
Example call
Includes
Description
Returns
GetRecordNum
Purpose
Use this function can read the total amount of records storing in the file at
present. .
Syntax
Example call
58
record_num= GetRecordNum(&fsearch);
Includes
Description
#include DBMS.h
GetRecordNum can pass back the amount of record storing in the file at
present.
Returns
DeleteRecord
Purpose
Syntax
Example call
Includes
Description
Use this function can delete the appointed record in the file.
int DeleteRecord(_DBMS* F_Search,int recordnum);
DeleteRecord(&fsearch,2);//delete the third data of this file
#include DBMS.h
DeleteRecord can delete the appointed record, and change the size of
the file.
As success of deleting, file index will stay in the deleting record front. As
deleting defeat, file index will not move.
Returns
DeleteLastRecord
Purpose
Syntax
Example call
Includes
Description
Use this function can delete the last record in the file.
int DeleteLastRecord(_DBMS* F_Search);
DeleteLastRecord(&fsearch);
#include DBMS.h
DeleteLastRecord can delete the last record in the file, and change the
size of the file.
As success of deleting, file index will stay in deleting record front. As
deleting defeat, file index will not move.
Returns
AppendRecord
Purpose
Syntax
Example call
Use this function can increase a new record on the file end.
int AppendRecord(_DBMS* F_Search,char* record);
char str_record[25]=A1357924680,PT-10,3500;
AppendRecord(&fsearch, str_record);
Includes
Description
#include DBMS.h
AppendRecord can increase a new record on the file end, the data of
record is introduced by char * record.
As increasing success, file index will be moved to the front of increasing
record.
Returns
WriteField
59
Purpose
Syntax
Example call
Use this function can revise the designated record in the existed file.
int WriteField(_DBMS* F_Search, int recordno, int fieldno, char* field);
char str_field[10]=123456789;
WriteField(&fsearch,0,1, str_field);// Revise the second field of the first
data to str_field.
As revising success, file index will be moved to the front of the record
included revising field.
Includes
Description
#include DBMS.h
Using WriteField function can copy the field of appointed record. If the file
in disc D that you want to write, it will not allow to write.
Returns
WriteRecord
Purpose
Syntax
Example call
Includes
Description
#include DBMS.h
Use WriteRecord function can copy the existed record, but unable to
increase a new record.
As revising success, file index will be moved to revise the front of revising
record. If the file in disc D that you want to write, it will not allow to write.
Returns
ReadField
Purpose
Use this function to read the data of appointed field in the appointed
record.
Syntax
Example call
Includes
Description
#include DBMS.h
int recordno : Read of record position.
int fieldno : Read of field position.
char* buffer : Read the storing space of field
Returns
When char * buffer = NULL, functions will pass the data size back. Read
defeat: Pass back - 1.
60
When char * buffer NULL. Read succeed: Pass 1 back; Read defeat:
Pass back - 1.
ReadRecord
Purpose
Syntax
Example call
Includes
Description
#include DBMS.h
int recordno : Read of record position
char* buffer : Read the storing space of field
Returns
When char * buffer = NULL, functions will pass materials size back. Read
defeat. Pass back - 1.
When char * buffer does not equal NULL. Read succeed. Passing 1 back;
Read defeat. Pass back - 1.
61
LED
set_led
Purpose
Syntax
Example call
Includes
Description
description
LED_GREEN
LED_RED
LED_ORANGE
mode
description
LED_OFF
LED_ON
LED_FLASH
Returns
none
62
Keypad
clr_kb
Purpose
Syntax
Example call
Includes
Description
Returns
none
dis_alpha
Purpose
Syntax
Example call
Includes
Description
Returns
none
en_alpha
Purpose
Syntax
Example call
Includes
Description
Returns
get_alpha_enable_state
Purpose
Syntax
Example call
Includes
Description
Returns
set_alpha_mode_state
Purpose
63
Syntax
Example call
Includes
Description
Returns
get_alpha_mode_state
Purpose
Syntax
Example call
Includes
Description
Returns
set_keypad_BL
Purpose
Syntax
Example call
Includes
Description
Returns
get_keypad_BL
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
This function can get keypad backlight status.
TRUE: Key backlight on.
FALSE: Key backlight off.
set_keypad_BL_Timer
Purpose
Syntax
Example call
Includes
Description
Returns
64
get_keypad_BL_Timer
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
This function can get keypad backlight timer.
0: Keypad backlight always on
Other: The timer for keypad backlight(sec.).
_getchar
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The getchar function reads one key stroke from the keyboard buffer and
then removes the key stroke from the keyboard buffer. It will pass the
value back, and clear the buffer. If there is no any key press before, it will
pass NULL(0X00) back.
Returns
The getchar function returns the key stroke read from the keyboard
buffer. If the keyboard buffer is empty, a null character (0x00) is returned.
The keystroke returned is the ASCII code of the key being pressed.
GetKeyClick
Purpose
Syntax
Example call
Includes
Description
Returns
SetKeyClick
Purpose
Syntax
Example call
65
Includes
Description
#include SDK.h
This routine truns on or off the key click sound
1, if key click sound is enabled.
0, if key click sound is disabled.
Returns
none
Def_PKey
Purpose
Syntax
Example call
Includes
Description
Returns
none
_scanf_color
Purpose
Use _scanf_color to read character strings from the standard input file
and covert the strings to values of C variables according to specified
formats.
Syntax
Example call
Includes
Description
#include SDK.h
The _scanf_color function accepts a variable number of arguments, which
it interprets as addresses of C variables, and reads character strings,
representing their values. It converts them to their internal representations
using formatting commands embedded in the argument format, which
must be present in a call to _scanf_color.
The interpretation of the variables depends on the forma. The formatting
command for each variable begins with a % sign and can contain other
characters as well. A whitespace character (a blank space, a tab, or a new
line) may cause _scanf_color to ignore whitespace characters from
keyboard. Other nonwhitespace characters, excluding the % sign, cause
_scanf_color to ignore each matching character from the input. It begins
to interpret the first nonmatching character as the value of variable that is
being read.
For each C variable whose address is included in the argument list to
_scanf_color, there must be a format specification embedded in the
format. For the complete format specification accepted by the
66
Returns
The _scanf_color function returns the number of input items that were
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
Syntax
Example call
Includes
Description
#include SDK.h
The _scanf_color_DefaultStr function accepts a variable number of
arguments, which it interprets as addresses of C variables, and reads
character strings, representing their values. It converts them to their
internal representations using formatting commands embedded in the
argument format, which must be present in a call to
_scanf_color_DefaultStr.
The interpretation of the variables depends on the forma. The formatting
command for each variable begins with a % sign and can contain other
characters as well. A whitespace character (a blank space, a tab, or a new
line) may cause _scanf_color_DefaultStr to ignore whitespace
characters from keyboard. Other nonwhitespace characters, excluding
the % sign, cause _scanf_color_DefaultStr to ignore each matching
character from the input. It begins to interpret the first nonmatching
character as the value of variable that is being read.
For each C variable whose address is included in the argument list to
_scanf_color_DefaultStr, there must be a format specification embedded
in the format. For the complete format specification accepted by the
_scanf_color_DefaultStr function, please refer to the scanf function in
Turbo C++.
If you want input a float value, the value type is double , not float .
Returns
67
value equal to EOF means that an end-of-file was encountered during the
read operation.
_scanf_ctrl_ScannerStatus
Purpose
Syntax
Example call
Includes
Description
Returns
none
_scanf_ctrl_Vibrate
Purpose
Set vibrate on/off when use _scanf_color function and scanner status
on.
Syntax
Example call
Includes
Description
Returns
none
_scanf_ctrl_ScanWithENT
Purpose
Set ENT auto press on/off when use _scanf_color function and scanner
status on.
Syntax
Example call
Includes
Description
Returns
none
_scanf_ctrl_AlphaKey
Purpose
Syntax
68
Example call
Includes
Description
_scanf_ctrl_AlphaKey (TRUE);
#include SDK.h
When use _scanf_color function, this function can set enable/disable
alpha key when key input.
TRUE : Enable alpha key.
FALSE : Disable alpha key.
Returns
none
_scanf_ctrl_AlphaKey_Mode
Purpose
Syntax
Example call
Includes
Description
Returns
_scanf_ctrl_password
Purpose
Syntax
Example call
Includes
Description
Set display for general or user define when use _scanf_color function.
void _scanf_ctrl_password (char ssPassWord);
_scanf_ctrl_password (*);
#include SDK.h
When use _scanf_color function, this function can set enable/disable
alpha key when key input.
0 : Input character nomoral display.
others : Input character display define word.
Returns
none
_scanf_ctrl_KeypadLock
Purpose
Syntax
Example call
Includes
69
Description
When use _scanf_color function, this function can set keypad input
lock on/off except ENT key ,ESC key and Scan key.
TRUE : Keypad lock
FALSE : Keypad unlock.
Returns
none
FNKey_Reset
Purpose
Syntax
Example call
Includes
Description
Returns
none
FNKey_GetState
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
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
-1: Error
FNKey_SetUserDef
Purpose
Syntax
Example call
70
#include SDK.h
The function is used to set the FN-Key. After set successed, the
FN-Key is changed for custom setting function. You can set F1~6, if you
want to set default, please set pslFunction = NULL.
smKeyNum: 0 F1, 1 F2, 2 F3, 3 F4, 4 F5, 5 F6
Returns
1 : Set success
0 : Set false
71
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 TextBlocks 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.
Syntax
Example call
Includes
Description
void clr_eol(void);
clr_eol( );
#include SDK.h
The clr_eol function clears from where the cursor is to the end of the line,
and then moves the cursor to the original place.
Returns
None
clr_rect
Purpose
Clear a rectangular area on the LCD display. The cursor position is not
affected after the operation.
Syntax
Example call
Includes
Description
Returns
left
top
width
height
None
clr_scr
Purpose
Syntax
Example call
Includes
Description
72
system.
Returns
None
fill_rect
Purpose
Syntax
Example call
Includes
Description
Returns
left
top
width
height
None
fill_rect_color
Purpose
Syntax
Example call
Includes
Description
Returns
left
top
width
height
color
None
GetCursor
Purpose
Syntax
Example call
Includes
Description
73
Returns
SetCursor
Purpose
Syntax
Example call
Includes
Description
Returns
Curser status
0
Cursor off.
None
gotoxy
Purpose
Syntax
Example call
Includes
Description
Returns
wherex
Purpose
Syntax
Example call
Includes
Description
Returns
wherexy
Purpose
Syntax
74
Example call
Includes
Description
wherexy(&x_position,&y_position);
#include SDK.h
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
Syntax
Example call
Includes
Description
Returns
none
lcd_backlit_Setlv
Purpose
Syntax
Example call
Includes
Description
Returns
None
lcd_backlit_SetTimer
Purpose
Syntax
Example call
Includes
Description
Returns
None
lcd_backlit_Getlv
Purpose
Syntax
Example call
75
Includes
Description
Returns
#include SDK.h
The lcd_backlit_Getlv gets LCD backlight level.
LCD backlight level for 1~5.
lcd_backlit_GetTimer
Purpose
Syntax
Example call
Includes
Description
Returns
_printf_color
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The _printf_color function accepts a variable number of arguments and
prints them out to display screen. The value of each argument is
formatted according to the codes embedded in the format specification
format_string. If the format_string does not contain a % character (except
for the pair %%, which appears as a single % in the output), no argument
is expected and the format_string is written out to display screen. For the
complete format specification accepted by the _printf function, please
refer to the same function in Turbo C++.
Returns
_putchar
Purpose
Syntax
Example call
Includes
Description
Returns
None
_putchar_color
Purpose
76
Syntax
Example call
Includes
Description
Returns
None
Purpose
_puts
Syntax
Example call
Includes
Description
Returns
The puts function returns the number characters sent to the LCD display.
_puts_color
Purpose
Syntax
Example call
Includes
Description
Returns
The puts function returns the number characters sent to the LCD display
in user define color.
show_image_bmp
Purpose
Syntax
Example call
Includes
77
Description
top
width
height
pat
Returns
Notice
none
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
PT-10s LCD.
78
UserFont
DispFont_SetFont
Purpose
Syntax
Example call
Includes
Description
Returns
filename
TRUE : success
FALSE : fail
DispFont_SetPFont
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
slSelFont
pfile
TRUE : success
FALSE : fail
DispFont_GetFontInfo
Purpose
Syntax
Example call
Includes
Description
DispFont_GetFontInfo(2,&Type,&Width,&slHeight);
#include SDK.h
This function copies the slSelFont(0~9) info of font type ,width and height
to the variables whose address is specified in the arguments slType ,
slWidth and slHeight.
Returns
TRUE : success
FALSE : fail
Notice
Font type
79
TextBlock
TextBlock is a floating text printing rectangle area on screen. TextBlock defines its
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. There are total 16 TextBlocks. TextBlock(0) is system default block. The setting
of TextBlock(0) cant change. TextBlock(1~15) are user defined.
DefineTextBlock
Purpose
Syntax
Example call
DefineTextBlock(1,0,TYPE_IMAGE,(U32*)gausImage_PT20LOGO,10,8,
40,20);
Includes
Description
#include SDK.h
The DefineTextBlock function defines font,background graph,size and
position. There are total 15 text blocks.
slBlockNo
TextBlock number(1~15).
slSelFont
Defined Font:
0~1 system font and 2~9 user font.
slBGType
ulBGData
slColumn
slRow
slXPos
slYPos
Returns
TRUE : success
FALSE : fail
Notice
It must define user font(2~9) before select user font number(2~9). The
function define a TextBlock start at point(slXPos,slYPos) , width equal to
slColumn * FontSize(width) and height equal to slRow * FontSize(height).
The TextBlock also has background color or bmp and the specific font.
80
SetTextBlock
Purpose
Syntax
Example call
Includes
Description
Returns
slBlockNo
TextBlock number(1~15).
bSF
TRUE : success
FALSE : fail
ResetTextBlock
Purpose
Syntax
Example call
Includes
Description
Returns
Notice
TextBlock number(1~15).
None.
System supports one layer screen buffer, only not be overwrote yet
opened TextBlock can be restored. If two or more TextBlock area are not
overlap on screen, they all can be saved and restored properly. In two
overlap TextBlocks, only the later opened one can be restored. To restore
previous one will cause unknown result.
PrintTextBlock
Purpose
Syntax
Example call
Includes
Description
pt = PrintTextBlock(0,5,7,string,COLOR_BLACK);
#include SDK.h
This function displays colorful text to specific TextBlock. The active
TextBlock is not changed.
slBlockNo
TextBlock number(0~15).
slColumn
column.
slRow
row.
81
Returns
string
ulFontColor
Text color.
GetTextBlockCur
Purpose
Syntax
Example call
Includes
Description
Returns
TextBlock number(0~15).
SetTextBlockCur
Purpose
Syntax
Example call
Includes
Description
Returns
slBlockNo
TextBlock number(0~15)
slColumn
Column
slRow
Row
None.
ShowTextBlockCursor
Purpose
Syntax
Example call
Includes
Description
TextBlock number(0~15)
bShow
TRUE:show cursor
FALSE:Hide cursor
slType
0: Cursor off.
1: Cursor on, and cursor type is a line as _.
2: Cursor on, and cursor type is a line as |.
3: Cursor on, and cursor type is a block as .
82
Returns
None.
TextBlock_SetBGColor
Purpose
Syntax
Example call
Includes
Description
TextBlock_SetBGImage
Purpose
Syntax
Example call
Includes
Description
83
Communication Ports
clear_com
Purpose
Syntax
Example call
Includes
Description
Returns
None
close_com
Purpose
Syntax
Example call
Includes
Description
Returns
None
com_cts
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This routine is used to check current CTS level. Use the argument port as
the connect port which is chosen to open. Now we only can choose
1(RS232).
Returns
1 : allow to deliver
0 : not allow to deliver
com_eot
Purpose
Syntax
Example call
84
Includes
Description
#include SDK.h
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
com_overrun
Purpose
Syntax
Example call
Includes
Description
Returns
com_rts
Purpose
Syntax
Example call
Includes
Description
Returns
None
nwrite_com
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This routine is used to send a specific number of characters specified by
count through RS232 ports. If any prior transmission is still in process, it is
85
-1 : error
Other value: the number of words that success writing into.
open_com
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The open_com function initializes the specified RS-232 port. It clears the
receive buffer, stops any data transmission under going, reset the status of
the port, and set the RS-232 specification according to parameters set. Use
the argument port as the connect port which is chosen to open. You can
choose 1(RS232).
Each bit of the argument setting
D0
Returns
baud rate
0 :115200
1-2 : 57600
3 : 38400
4 : 19200
D2
5 : 9600
6-7 : 4800
D3
data bits
0 : 7bits
1 : 8bits
D4
Parity enable
0 : disable
1 : enable
D5
even / odd
0 : odd
1 : even
D6
flow control
0 : disabe
1 : enable
D7
0 : CTS/RTS 1 : Reserved
0 : Open fail
1 : Open success
Remark
When flow control set up disable and flow control method set up CTS/RTS.
When you use IR port, the baud rate only can be setted 115200, flow control
disable.
read_com
Purpose
Syntax
Example call
86
#include SDK.h
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. Use the argument port as the connect port which is
chosen to open. You can choose 1(RS232).
Returns
write_com
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This routine is used to send a string through RS232 ports. If any prior
transmission is still in process, it is terminated then the current transmission
resumes. The character string is transmitted one by one until a NULL
character is met. A null string can be used to terminate prior transmission.
Use the argument port as the connect port which is chosen to open. You
can choose 1(RS232).
Returns
None
USB_Open
Purpose
Syntax
Example call
Includes
Description
Returns
USB_Close
Purpose
Syntax
Example call
Includes
Description
Returns
USB_Read
Purpose
Syntax
Example call
87
#include SDK.h
The function can write specific number of bytes from USB port.
The USBRead function returns the number characters from the PC site
USB_Write
Purpose
Syntax
Example call
Includes
Description
Returns
88
Remote
SetRemoteBaud
Purpose
Syntax
Example call
Includes
Description
Returns
slBaud
Baud rate(bps)
115200
57600
38400
19200
9600
4800
None
GetRemoteBaud
Purpose
Syntax
int GetRemoteBaud(void);
Example call
Switch(GetRemoteBaud())
{
Case 0:
_printf_color(COLOR_RED, RemoteLink baud rate=115200);
Break;
Case 1:
_printf_color(COLOR_RED, RemoteLink baud rate=57600);
Break;
Case 2:
_printf_color(COLOR_RED, RemoteLink baud rate=38400);
Break;
Case 3:
_printf_color(COLOR_RED, RemoteLink baud rate=19200);
Break;
Case 4:
_printf_color(COLOR_RED, RemoteLink baud rate=9600);
Break;
89
Case 5:
_printf_color(COLOR_RED, RemoteLink baud rate=4800);
Break;
}
Includes
Description
Returns
#include SDK.h
This function can get RemoteLink baud rate(when use com port).
0:115200 bps
1:57600 bps
2:38400 bps
3:19200 bps
4:9600 bps
5:4800 bps
SetRemoteInterface
Purpose
Syntax
Example call
Includes
Description
Returns
slInterface
Interface
RS-232
USB
None
GetRemoteInterface
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function can set RemoteLink connect interface.
90
Returns
0RS-232
1USB
RemoteLink
Purpose
Syntax
Example call
Includes
Description
void RemoteLink(void);
RemoteLink( );
#include SDK.h
The RemoteLink function provides the transmission environment to link
with Argolink and make file uploading or downloading.
Returns
RemoteLink_RealTime
Purpose
Syntax
Example call
Includes
Description
Returns
FALSE
TRUE
None
91
System
SysSuspend
Purpose
Syntax
Example call
Includes
Description
Returns
None.
SysDelay
Purpose
Syntax
Example call
Includes
Description
Returns
SetPowerOnState
Purpose
Syntax
Example call
Includes
Description
Returns
None
GetPowerOnState
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
This function can get power on status for resume or restart.
0:Resume
1:Restart
SetAutoPWOff
Purpose
92
Syntax
Example call
Includes
Description
Returns
None
GetAutoPWOff
Purpose
Syntax
int GetAutoPWOff(void);
Example call
int slAPO;
slAPO = GetAutoPWOff( );
Includes
Description
Returns
#include SDK.h
This function can get auto power off timer.
Auto power off timer(s).
SetStatusBAR
Purpose
Syntax
Example call
Includes
Description
SetStatusBAR(TRUE);//Statusbar on.
#include SDK.h
This function can set statusbar display or on display.
If use this function, all of the textblock setting will be reset.
Returns
None.
GetStatausBAR
Purpose
Syntax
Example call
Includes
Description
Returns
#include SDK.h
This function can get statusbar display status.
TRUE: Statusbar display
FALSE: Statusbar no display
SN_Get
Purpose
Syntax
Example call
Includes
Description
93
than 8 bytes.
Returns
None
BIOS_SetDefault
Purpose
Syntax
Example call
Includes
Description
Returns
None
Check_AID
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
This function can check the agency ID correct or not. You can write the
agency ID by AID Maker.
The pssUser and pssPassword need 4~8 characters.
Returns
94
Memory
Tfree
Purpose
Use the Tfree to release an allocated storage block to the pool of free
memory.
Syntax
Example call
Includes
Description
Returns
None
Tmalloc
Purpose
Syntax
Example call
Includes
Description
Returns
The Tmalloc function returns a pointer that is the starting address of the
memory allocated. The allocated memory is properly aligned (the address
of the first byte meets the requirements for storing any type of C variable). If
the memory allocation is unsuccessful because of insufficient space or bad
values of the arguments, a NULL is returned.
Comments
Note that when using Tmolloc to allocate storage for a specific data type,
you should cast the returned void pointer to that type.
TotalHeapSize
Purpose
Syntax
Example call
Includes
Description
Returns
UsedHeapSize
95
Purpose
Syntax
Example call
Includes
Description
Returns
FreeHeapSize
Purpose
Syntax
Example call
Includes
Description
Returns
96
Vibrate
on_vibrator
Purpose
Syntax
Example call
Includes
Description
Returns
None.
off_vibrator
Purpose
Syntax
Example call
Includes
Description
Returns
set_vibrator_timer
Purpose
Syntax
Example call
Includes
Description
Returns
None.
get_vibrator_timer
Purpose
Syntax
Example call
Includes
Description
Returns
97
Other
prc_menu_color
Purpose
Syntax
Example call
Includes
Description
#include SDK.h
The prc_menu function is used to create a user-defined menu. SMENU
and MENU structures are defined in SDK.h. Users can just fill the MENU
structure and call the prc_menu function to build a hierarchy menu-driven
user interface.
Returns
None
98
Includes
Description
#include SDK.h
The CopyFileToTerminal function copies the PC file path specified by
pssPCFileName pointer to the simulator path specified by
pssPDTFileName pointer.
Returns
None
BackupDataFiletoPC
Purpose
Syntax
Example call
Includes
Description
Returns
None
99
Data Conversion
__itoa
Purpose
Syntax
Example call
Includes
Description
Returns
The __itoa function returns the pointer to the string of degits (i.e., it returns
the argument string).
__ltoa
Purpose
Syntax
Example call
Includes
Description
100
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
Syntax
Example call
Includes
Description
Returns
The __ultoa function returns the pointer to the converted string (i.e., it
returns the argument string).
101
APPENDIX 1
Scan Command Table
Command1
Command2
Value
0: Disable
Indication
LED indication
1: Enable
0: Disable
Buzzer indication
1: Enable
Transmission
Code ID position
0: Disable
Code ID transmission
1: Proprietary ID
2: AIM ID
0: Disable
1: Enable
10
0: Disable
1: Enable
11
0: Disable
Case conversion
1: Upper case
2. Lower case
Scan
Double confirm
6
0~9
0 ~ 64
0 ~ 64
0: Disable
1: Enable
String setting
22 characters.
Preamble characters
22 characters.
settings
4
102
Postamble characters
22 characters.
settings
10
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
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
11
0: Disable
Code 39
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 20
Truncate leading
0 ~ 15
Truncate ending
Code ID setting
bytes)
10
0: Standard
Format
1: Full ASCII
103
13
0: Disable
Start/stop transmission
1: Enable
12
0: Disable
Code 93
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
13
0: Disable
Code 128
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
0: Standard
Format
1: UCC.EAN 128
12
104
13
Concatenation code
14
0: Disable
Codabar
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
0: ABCD/ABCD
Start/stop type
1: abcd/abcd
2: ABCD/TN*E
3: abcd/tn*e
11
0: Disable
Start/stop transmission
1: Enable
15
0: Disable
EAN 8
Read
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
0: None
Supplement digits
1: 2 digits
2: 5 digits
3: 2, 5 digits
105
4: UCC/EAN 128
5: 2, UCC/EAN 128
6: 5, UCC/EAN 128
7: All
11
0: None
Truncation/expansion
12
0: Disable
Expansion
1: Enable
16
0: Disable
EAN 13
Read
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
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
12
0: Disable
ISBN/ISSN conversion
1: Enable
17
0:Disable
Industrial 2 of 5
Read
1:Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
PT-20 Programming Guide
0 ~ 15
106
Truncate ending
8
Code ID setting
bytes)
18
0: Disable
Interleaved 2 of
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
19
0: Disable
Standard 2 of 5
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
20
0: Disable
MSI Plessey
Read
1: Enable
0: Disable
107
Check-sum verification
1: Mod 10
2: Mod 10/10
3: Mod 11/10
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
21
0: Disable
UK Plessey
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
22
0: Disable
Telepen
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
108
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
0: Numeric
Format
1: Full ASCII
23
0: Disable
UPCA
Read
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
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
11
0: None
Truncate/expansion
24
0: Disable
UPCE
Read
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 15
Truncate leading
PT-20 Programming Guide
109
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
10
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
11
0: None
Truncate/expansion
12
0: Disable
Expansion
1: Enable
13
0: Disable
UPCE-1
1: Enable
25
0: Disable
Matrix 25
Read
1: Enable
0: Disable
Check-sum verification
1: Enable
0: Disable
Check-sum transmission
1: Enable
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
28
0: Disable
China post
Read
1: Enable
110
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
29
0: Disable
RSS 14
Read
1: Enable
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
11
0: Disable
1: Enable
30
0: Disable
RSS Limited
Read
1: Enable
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
11
0: Disable
1: Enable
31
0: Disable
RSS Expanded
Read
1: Enable
0 ~ 99
0 ~ 99
0 ~ 15
Truncate leading
PT-20 Programming Guide
111
0 ~ 15
Truncate ending
8
Code ID setting
bytes)
11
0: Disable
1: Enable
32
0: Disable
Italian
Read
1: Enable
Pharmacode 39
0 ~ 64
0 ~ 64
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
Code ID setting
bytes)
10
0: Disable
Leading A
1: Enable
112