Argox PA-20 Operating instructions

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

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.
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 PA-20 /
PA-2010 / PA-21 / PA-2110.
Later in this manual, you‟ll 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 PA-20 / PA-2010 / PA-21 / PA-2110 for your reference.

PT-20 Programming Guide
1
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 ..................................................................................9
1. Edit Program:.........................................................................................9
2. Under RealView:....................................................................................9
3. Update your System:............................................................................10
4. Development Notice:...........................................................................10
Upgrade System...................................................................................................11
1. System Requirement:...........................................................................11
2. Upgrade Procedure: .............................................................................11
3. Execute System:...................................................................................13
Utility & Others ...................................................................................................14
1. AID MAKER.......................................................................................14
2. Scanner FW Upgrade...........................................................................14
3. Font......................................................................................................14
4. ScanSetting ..........................................................................................14
SDK Library.................................................................................................................15
SDK Functions list...............................................................................................15
Reader..................................................................................................................23
Buzzer..................................................................................................................28
Calender...............................................................................................................30
Bluetooth(For PA-2010 / PA-2110) .....................................................................32
File Manipulation.................................................................................................37
DBMS..................................................................................................................54
LED......................................................................................................................65
Keypad.................................................................................................................66
LCD......................................................................................................................76
UserFont...............................................................................................................83

PT-20 Programming Guide
2
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:.........................................................................................................120
Scan Module (Laser) Configuration Table....................................................120

PT-20 Programming Guide
3
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:
PA2-T01.00-000
Scanner FW
Upgrade
AID MAKER
SDK
Upgrade
Utility
Laser
Document
PC DLL
CCD
Sample Code
(For PC DLL)
Sample Code
(For Terminal)
Terminal
Upgrade SDK
Tool
Upgrade BAT file
Upgrade BIN file
Font
ScanSetting

PT-20 Programming Guide
4
Folder introduction:
Upgrade:
For Fw upgrade, it has two sub folders, “Ugrade BIN file” and “Upgrade BAT file”.
Ugrade BIN file:
It has a bin file for fw upgrade.
Upgrade BAT file:
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.
You can download bin file by PT-FileManager in these status, too.
Please refer to the “Upgrade System”section.
SDK:
For SDK develop tools. It has six sub folders, “Document”, “PC DLL”, “Sample
Code(For Terminal)”, “Sample Code(For PC DLL)”, “Terminal”, and “Upgrade
SDK Tool”.
Document:
It has two PDF file, “PC DLL.pdf”and “Terminal.pdf”, these PDF files are
introduct about how to use PC DLL and SDK functions.
PC DLL:
For PC DLL files.
Sample Code(For Terminal):
For terminal sample code.
Sample Code(For PC DLL):
For PC DLL sample code.
Terminal:

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-2010 / PA-21 / PA-2110 agency ID.
Scanner FW upgrade:
For upgrade scanner module fw, if your scanner has something wrong, you can try
to upgrade it, Please see “Scanner FW upgrade”
Utility:
It has two sub folders, “Font”and “ScanSetting”
Font:
You can make your font for PA-20 / PA-2010 / PA-21 / PA-2110 to display.
ScanSetting:
It can make a setting file for scanner, you need use SDK function to set it.( For
PA-20 / PA-2010 / PA-21 / PA-2110)
Functions in SDK folder description:
You have to Install RealView 2.2 in your computer.
PA2X_SDK.mcp is a RealView Developer Suite project file, developer need to set
PA2X_SDK.mcp as RealViews‟ project file.
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.
Library folder is used to store PA2X_Lib.a, Startup.s, and other *.inc files for
compiler, don‟t delete this folder.
Others folder is for later use. Don‟t care this folder.
PA2X_SDK_Data folder is used to store object files.
Release folder is used to store compiler information.
Adding Source File:
All user application program source files has to be placed under Source folder, and
register needed files‟ name in the project file of PA2X_SDK.mcp before proceeding
with compiling and linking process.

PT-20 Programming Guide
6
Function Library
PA-20 / PA-2010 / PA-21 / PA-2110 Function Library supports user application
program to perform the data collection jobs. PA-20 / PA-2010 / PA-21 / PA-2110
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. In this case, the PA-20 / PA-2010 / PA-21 / PA-2110 Function
Library file PA2X_Lib.a is needed.
The PA-20 / PA-2010 / PA-21 / PA-2110 Function Library file PA2X_Lib.a is updated
occasionally. For most update version, please ask helps from your vendor or the
manufacturer.
PA-20 / PA-2010 / PA-21 / PA-2110 Function Library file PA2X_Lib.a is needed
during compiling and linking for generating App.bin.
The update library release is SDK.h. Please refer SDK Library section.

PT-20 Programming Guide
7
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. The following
are the available include head file list in standard C language function library:
<assert.h>
__assert ;
<ctype.h>
isalnum; isalpha; iscntrl; isdigit; isgraph; islower; ispr; ispunct;
isspace; isupper; isxdigit; tolower; toupper;
<locale.h>
setlocale; localeconv;
<math.h>
acos; asin; atan; atan2; cos; sin; tan; cosh;
sinh; tanh; exp; frexp; ldexp; log; log10; modf;
pow; sqrt; ceil; fabs;__d_abs; floor; fmod;
<setjmp.h>
setjmp; longjmp;
<signal.h>
signal; raise;
<stdio.h>
sprintf; sscanf;
<stdlib.h>
atof; atoi; long atol; strtod; long strtol; strtoul; rand; srand;
_ANSI_rand; _ANSI_srand; abort; atexit; exit; getenv; system; bsearch;
qsort; abs; long labs;
<string.h>
strcpy; strncpy; strcat; strncat; memcmp; strcmp; strncmp; strcoll; strxfrm; strstr;
memset; strlen;
If you need to use standard C language functions in the user program, please add
#include <header file name> in the top of the file to import the correlated include
head files. See following example:
#include <stdio.h>

PT-20 Programming Guide
8
#include <stdlib.h>
The statements listed above will make Compiler and Linker to import all the
correlated functions to generate App.bin file.
Other manuals for PA-20
2
This manual suits for next models
3
Table of contents
Other Argox Touch Terminal manuals



















