Argox PT-10 Operating instructions

Programming Guide for
PT-10/12
Portable Data Collector
Copyright © 2005 by ARGOX Information Co., Ltd.
http://www.argox.com
Version: 2.30 2006/10/30

1
Preface
To satisfy the user’s customized needs, the PT-10/12 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 Assembly, C, and C++ 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-10/12.
Later in this manual, you’ll learn how to write the program, how to compile the
linking program, how to download renewed codes and how to test simulation
functions. Finally, this manual will also conclude the function illustration of
PT-10/12 for your reference.

2
Table of Contents
Programming Guide for PT-10/12 Portable Data Collector
1. Program Design:................................................................................................4
◆Development Environment.......................................................................4
◆Function Library..........................................................................................7
◆Standard Function Library........................................................................8
◆How to Build Your Program......................................................................9
2. Simulator..........................................................................................................13
3. Upgrade User Program.............................................................................16
4. Software Support ........................................................................................17
5. SDK Utility........................................................................................................18
6. General Library.............................................................................................20
◆Memory Allocation and Management..................................................24
◆Data Conversion Routines......................................................................25
◆Searching and Sorting.............................................................................26
◆Date and Time Function..........................................................................27
◆File Manipulation.......................................................................................30
◆Input and Output Routines.....................................................................33
◆System Calls for Collector......................................................................41
◆System Calls for Simulator.....................................................................43
◆System Calls for BIOS Setting...............................................................44
◆Graphics-Text Mode .................................................................................45
◆Graphics-Graphics Mode........................................................................46
◆Menu Management....................................................................................49
7. DBMS Library..................................................................................................53
◆DBMS Functions Description ................................................................53
8. CL Library.........................................................................................................63
◆Reader..........................................................................................................66
◆Buzzer ..........................................................................................................69
◆Calender ......................................................................................................71
◆File Manipulation.......................................................................................72
◆LED................................................................................................................84
◆Keypad.........................................................................................................85
◆LCD...............................................................................................................88
◆Communication Ports..............................................................................95

3
◆Keyboard Wedge.......................................................................................99
◆System.......................................................................................................101
◆Power..........................................................................................................102
◆Other...........................................................................................................102

4
1. Program Design:
◆Development Environment
1. User Program Directory
1.1 Menu Structure:
When open the SDK folder in the CD provided with the PT-10/12, it will
show the structure as the following:
1.2 Function Instruction:
‧ Binary file is used to store the generated UserProg.bin files through
Armmake. It is needed when updating programs.
‧ Error file is used to store the generated error or warning files through
Armmake.
‧ Library file is that the library needed is put to the place while
developing the procedure.
‧ MVC file is used to develop program in Microsoft Visual C++ 6.0.
‧ Object file is used to store Armmake generation file.
‧ ARM Project Manager file is used to store ARM Project Manager 2.51
installation files.
‧ Source file is used to store the program files and the PT-10 function
library used in the programs.
1.3 Adding Source File:
For all the source files under the program has to be placed under SRC
folder, also record the entire needed file name under Makefile (placed
under SRC folder), or under ARM Project Manager file before
proceeding with compiling and linking process.

5
2. Development Tool Kit Directory
The Development Tool Kit is available from the menufacture or the
suppliers. After installing the Development Tool Kit, run the files store under
ARM251\WINDOWS\SETUPexe, upon installation completion, both DOS
and Windows will be ready for programming.
2.1 DOS Environment:
Upon installation, under ARM251\BIN\ folder, it will generate the
following commands for compiling, linking, and generating purpose.
Command Function Extension
Armasm.exe Merge to combine codes *.s, *.a
Armcc.exe Edit C & C++ files *.c, *.h
Armlink.exe Link object files *.obj, *.alf
Armmake.exe –a Run MAKEFILE MAKEFILE
2.2 Windows Environment:
‧ Follow the steps above to complete installation and the Windows
system will create a shortcut under (Start\Program\ARM SDT
v2.51\ARM Project Manager shortcut)
.
‧ Click on the shortcut to runARM Project Manager for Windows.
‧ ARM Project Manager for Windows can add a new project by
including Source and Library in order to generate a Binary file and
then download to the data collector to complete the process.
‧ For detailed operations of ARM Project Manager, please refer to the
help files of ARM Project Manager for Windows.
\ (Compressed File) -------ARM251 -------WINDOWS -------SET.exe

6
3. Simulation Directory
3.1 Menu Structure:
When open the SDK folder in the CD provided with the PT-10/12, it will
show the structure as the following:
3.2 Menu Instruction:
‧ “Debug”,”Release” is used to store the source file that created by
compiling and linking user programs.
‧ “Executable” is used to store the execution files of simulator and
dynamical linking function library.
‧ “Library” is used to store the library functions files, including the *.h
files.
‧ “SRC” is used to store the customerized program files, including the
*.cpp files.
3.3 Adding User Program:
This simulator is required running under the Microsoft Visual C++ 6.0.
The file adding and deleting must be done under this environment. All
the user program files have to be stored in the UPFiles folder. Simply
select the Project\Add to project\Files…function, and record the
UPCode file under Workspace“SDK_SIM. You will be able to view the
file lists through the Workspace windows, and then proceed with
debugging.

7
◆Function Library
‧ The user program of data collector can use the PT-10/12 Function
Library provided by the manufactur to complete the data collection
jobs. PT-10/12 Function Library provides variety of services, and
accomplish special functions according to specifical demands.
‧ When using the PT-10/12 Function Library, please add the import
command (#include “UserLib.h", “DBMS.h”, “LIB_CL.h”) into the
user program file (*.c) and the function can be imported. In this case,
the PT-10/12 Function Library file SDKLib.alf is needed. The path
should be:
SDK\UserProg\Library\SDKLib.alf (Refer to User Program Directory)
‧ The PT-10/12 Function Library file SDKLib.alf has always the revision
control issue. For most updated version, please ask helps from your
vendor or the manufactur. If your function library has errors or
requirements for new features, this file needs to be updated.
‧ In order to complete generating the UserProg.bin file, the PT-10/12
Function Library file SDKLib.alf will be needed when compiling and
linking.
‧ The libraries offered at present has::
1.UserLib.h: General Functions. Please refer General Library of this
document.
2.LIB_CL.h: CL Functions. Please refer CL Library of this document.
3.DBMS.h: Database Manage System. Please refer DBMS Library of
this document.
‧ If want to use the examples of CL and DBMS libraries, please copy
LIB_CL and DBMS examples to UserProg.c in SDK\UserProg\SRC.
Executes the UserProg.apj file in SDK\UserProg\SDT. After compiling,
You must download the binary file to PT-10 and use the example file in
collector.

8
◆Standard Function Library
‧ The user program in the data collector can complete the tasks by
using standard C language function library. The function library is
enclosed in the developing environment (ARM Software Development
Toolkit). When the developing environment installation was completed,
you will find the include head file of standard C language function
library in the directory \\ARM251\Include. 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;
‧ If you need to use standar C language functions in the user program,
please import the correlated include head files, and import #include
<header file name> in the top of the file. See following sample:
#include <stdio.h>
‧If follow the steps above, after running the Compile and Link, all the
correlated functions will be imported and used to generate as the
UserProg.bin file.

9
◆How to Build Your Program
1. Edit Program:
‧ Developers may use the UserProg.c file under SRC folder in the User
Propgram Directory as the starting file. And you can use int
UserProg(void) as the start point to edit the program. And also you
can freely create a new source file to proceed structuralization
development.
‧ There is a sample program was enclosed. It is the service system for
Import, Export, Search and Link.And already covers most of the
function-calls and the way to use. There are toally three file were
included:
UserProg.c, UserDef.c, and UserLib.h.
‧ For regulations and procedures in the developing procedures, please
refer to the “Development Notice”
2. Under DOS Mode:
‧ Add or Delete Files:
When adding or deleting the source files, the makefile (placed
under the SRC folder) has to be registered first.
‧ Compile, Link and Create:
To compile and link the program, you can use the armmake
under DOS mode to combine the procedures of compiling and
linking and simplify the generating process. However, the
makefile file (placed under SRC folder) should be provided.
Please see the command below:
armmake –a
3. Under WINDOWS Mode:
‧ Add or Delete Files:
When adding or deleting the source files, you can complete the
adding and removing direcly under the ARM Executable Image.
The file will be displayed under DebugRel, Debug, and Release.
‧ Compile, Link and Create:
Here we provide another choice, you can open the default
project UserProg.apj in \SDK\UserProg\SDT to have the
ability to edit, translate,link,and produce the source file. When
compiling, linking, and producing, it's neccesary to use the

10
Release version to be the last requirement. The steps of
Execution are listed below (Figure 1), Choose the number to 4 in
order, double click the part of the reverse white, and the program
of compilation will be started. After finishing the compilation, click
the number 5, the compile message will be showed. If no mistake
occurs, click number 6 to save. The file will be saved in the
folder\SDK\UserProg\SDT\Release. The file name is
UserProg.bin. At the moment, the file can be downloaded from
Argo Link and be executed on PT-10
4. Update Firmware:
Please refer to the “Upgrade User Program” section.
5. Development Notice:
‧ Enter the program from int UserProg (void) of UserProg.c
‧ Maximum User Task Steak: 8K bytes
‧ Memory allocation: 200K bytes
‧ Maximum capacity of the Binary file (UserProg.bin): 256K bytes.
‧ The fonts needed for the program will have to be exported to a text file
by developer and through Argobuilder’s font generating function to
make the font file and put in D:\Fonts. So developer can take this font
file from the folder and provide to environment initialization function
BOOLUM_Initial (char*passDLFile).
‧ The system will reserve Drive C and D for file storage.
‧ The developer can exchange files using the communication tool
Argolink provided by Argobuilder and collector Remote Link function.

11
‧ The developer can exchange files using the communication tool File
Transfer DLL (Dynamic Link Library) and collector Remote Link
function.
‧ The developer can exchange files using the communication tool
Standard Read/Write DLL and the transmission procedures made by
developer.
‧ Please check the file path of “SDKLib.alf” error or not when you
update our SDK folder.If there is any error, please modify your
path.You can check the file path as follow figure:

12
6. Development Flow Chart:

13
2. Simulator
1. Purpose:
To shorten the development time and increase the program stability, a
simulation tool is designed for developer to edit and debug program with
ease. With this simulator, developer will know in advance whether there is
any error in the program code or whether this program meets actual
demands before downloading the program to the collector so that the
correction and debugging can be done immediately.
The simulator provides a platform, which can simulate the same hardware
functionality as a real collector, for example buzzer, LED, scanner, key
buttons, memory allocation and LCD display. Developer can identify
whether the program meets the demands through the simulation test.
2. Developing Environment:
Microsoft Visual C++ 6.0 developing tool needs
to be installed into the workstation. The
developing environment will appear like the
image on the right.
Copy the CD or compressed file provided by the
manufacturer to any disk of the workstation
(Refer to the Simulation Directory in page 5).
3. How to use:
3.1 Complete the developing environment setup listed above.
3.2 Execute \SDK\Simulator\SDK_Sim.dsw in the directory then you can
open the simulation project file. Under VC++6, execute Build\Set
Active Configuration...,select UPCode - Win32 Debug, then click OK to
complete the environment setting.
3.3 Start Simulating:
6.1. Open simulator in VC++6 and select Build\Execute
SDK_Sim.exe. Then a simulator will appear on the desktop (See
image on the next page)
6.2. Press on the User Program Button to run the program.

14
LED Simulation
LCD Display Simulation
Keypad Simulation
RS-232 Linking Simulation
3.4 Debug:
6.3. When running simulation, VC++6 will compile
and link all the programs and generate a DLL file to link with the
simulation file in the Execute directory. When compiling and linking,
the error(s) or warning(s) will be displayed on the VC++6 windows to
let user know the error messages.
6.4. The developer will need to remove all the errors and warnings to
ensure the syntax accuracy of the program.
6.5. The logical errors of the program need to be debugged using
VC++6 debugging environment. This debugging environment
provides the functions of line-by-line program execution, variable
listing and message hints.
6.6. When executing Menu\Build\Start Debug\Go under VC++6, the
debugging function environment will be started.
3.5 Add or delete user program:
6.7. To add a new user program file, the relative files must be placed
in the UPFiles directory. Developer needs to register all the
necessary files using VC++6 Menu\Project\Add to project\Files…
function into the UPCode files of Workspace”SDK_Sim”. And you
will view the file list in the Workspace window.
6.8. To delete a user program file, all the relative files in UPFiles
directory shoud be deleted. And you will need to completely remove
file names in the UPCode file list of Workspace”SDK_Sim”.
4. File transfer to a Data collector for execution:
If you want to transfer the file passed by the Simulator to a real collector for
operation, you will need to compile and link files through ARM compiler.
And you need to download the Binary file (UserProg.bin) generated by the

15
compiler through Argolink firmware update function to a real collector for
program execution.
The developer must copy the *.cpp or *.h files under SRC directory to
\SDK\UserProg\SRC directory. But the *.cpp file names have to be
changed to *.c. See below for details:
Source Purpose Note
SDK\Simulator\SRC\*.cpp SDK\UserProg\SRC\*.c Convert
SDK\Simulator\SRC\*.h SDK\UserProg\SRC\*.h
To simplify the procedures of file converting and transferring, here we
provide a batch file that user can register the files and after executing this
batch file, the *.cpp file will be automatically converted to *.c file and copied
to \SDK\UserProg\SRC directory. The user will be able to transfer files to
the Simulator or the UserProg by running this batch file. See below for
details:
Update_from_Simulator.bat (Simulation files copy to the UserProg)
copy ..\Simulator\SRC\XXX.cpp .\SRC\XXX.c Program File
copy ..\Simulator\SRC\XXX.h .\SRC\XXX.h Header File
Update_from_UserProg.bat (UserProg files copy to the simulator)
copy ..\UserProg\SRC\XXX.c .\SRC\XXX.cpp Program File
copy ..\UserProg\SRC\XXX.h .\SRC\XXX.h Header File
XXX means editable file name. The rest are the preset path.

16
3. Upgrade User Program
1. System Requirement:
Software: Argolink
Hardware: PT-10/12 and a personal computer.
Firmware: Binary file generaged by ARM compiler (UserProg.bin)
2. Upgrade Procedure:
Place the Binary file (UserProg.bin) under \SDK\UserProg\BIN or
\SDK\UserProg \SDT\Release.
Power on PT-10/12 and select Setting\F/W Upgrade in the main menu.
Connect the cable to the PC and wait for Argolink communication.
Execute Argolink and select Tool\F/W Update. Select the Binary file
(UserProg.bin) and complete the firmware update.
3. Execute User Program:
Select PT-10/12 Main Menu 1. Applications and you will find a user
program selection menu. After selecting, the program will be automatically
executed.
There are two ways going back to the Main Menu:
1. Set an option in the program to terminate this UserProg.
2. Remove the battery and restart the collector. Then it will go to the
Main Menu.
4. Set Default Program:
The PT-10/12 can set a UserProg as a preset program. When power on the
collector, this preset program will be always automatically executed. This
function can be terminated when user disabled the setting.
How to set:
Main Menu Æ4. Setting ÆEnter Password (default as 0000) Æ
2. Boot Config Æ1. Mode Setting Æ2. Program ÆUser Program
Disable Default Program:
User Program Mode ÆTurn off power ÆTurn on (PW+ESC+FN)

17
4. Software Support
To help the developers to create the Windows program, we have provided
the DLL file to help and complete the transferring process between program
and data collector. The transmission was done through either RS232 or USB
interface. There are two transmission agreements: One is using standard
reading and writing; another one is using Argolink as a package for uploading
and downloading. The examples for both ways are also provided for
developer’s reference.
The standard reading and writing uses ReadData to import pointer, then
return the data with specific length. The pointer is a specific buffer.
WriteData is to import the pointer of the buffer that you are going to write,
and then you can write the data with specific length. The data length is
counted by byte.
The method of uploading and downloading through Argolink package is to
upload the files in the data collector disk to PC through Req_UploadFile.
And it also provides some other file management functions. Please refer to
the Function Description for details.
There are two sample programs made for Visual Basic and Visual C++.
You can simply click and run the program directly.
For the function description, please see details in the readme.txt file under
Doc directory.
For environment description, please see below:
1. Doc is used to save the function description file.
2. Example is used to save the two sample programs.

18
3. Library is used to save the DLL file.
4. DOS Command stores at DOS Command function.
5. SDK Utility
The SDK Utility is a tool that will help the developer to complete the
development with the graphic transfer, impage process, and font editing.
Function:
1. BMP ÆText:
If the program needs the Disp_PutImage to show
a rectangle image, you can either use
Disp_GetImage to get the graphic source, or use
this function to generate an array buffer to save a
specific rectangle image. After Cut and paste
onto the *.c or *.h program file was done, then
use Disp_PutImage to import this array buffer data and the rectangle
graphic can be shown on the screen.
Firstly select the source Bitmap file (*.bmp) and target Text file (*.txt). Then
select BMP ÆText button (T) to complete the process.
The source file must be Bitmap black/white non-compressed file, 128 x 64
pixels.
The target file is array buffer text file.
2. BMPÆBMP Text:
If the program needs the Disp_PutBitmap to show a rectangle Bitmap
image, you can either use the files in the disk as the graphic source, or use
this function to generate an array buffer to save a specific rectangle Bitmap
image. After Cut and paste onto the *.c or *.h program file was done, then
use Disp_PutBitmap to import this array buffer data and the rectangle
graphic can be shown on the screen.
Firstly select the source Bitmap file (*.bmp) and target Bitmap Text file
(*.txt). Then select BMP ÆBMP Text button (E) to complete the process.
The source file must be Bitmap black/white non-compressed file, 128 x 64
pixels.
The target file is array buffer text file.
3. Create Font File:
If using the font in 2 bits and the font in 1 bit not provided in the program,

19
then the font file will be on demand to support font monitoring
After choosing “Making font image(such as figure1,Step 1),click
“Browse”(such as Step 2),and choose the font
source file(Our program offered
BIG-5,GBK,Shift-jis and ASC-II),and choose
“Making font image(such as Step 3).After Step
3,it will show a dialog such as figure 2,when
you choosed ID and Language,it will show
other dialog such as figure 3,after chooses,click
“OK”,this dialog will be closed and back to
figure 2.Now,you can click “Making” to make a
new font file,and click “Save Edit…”to save this
file.
The generated font file path and extension will be
shown on the target file field(Such as figure
1,Source File).
Other manuals for PT-10
2
This manual suits for next models
1
Table of contents
Popular Data Logger manuals by other brands

Hydro International
Hydro International Hydro-Logic Flexi Logger 105 user manual

EchoStar
EchoStar Hughes 4200 user guide

EasyLog
EasyLog EL-SMS quick start guide

Computech
Computech DataMaxx Pro Dash 8 instruction manual

Steinberg Systems
Steinberg Systems SBS-DL-10 user manual

Aqualytic
Aqualytic AL15 instruction manual