Argox PI-10X0 Owner's manual

1
Preface
To satisfy the user’s customization needs, PI-10X0 / PI-12X0 series Basic provides effective approaches for
users to generate programs right to their actual demands. This allows users to collect data, execute data
processing, then store the processed data into proper location for future use.
PI-10X0 / PI-12X0 series Basic interpreter provides a platform for users to develop application programs to be
excuted on the PI1 series data terminals using BASIC language. Users can develop an application to meet
their own individual needs efficiently.
You’ll soon learn how to use BASIC language to write application programs. Please proceed and enjoy the
perfect combination of PI-10X0 / PI-12X0 series Basic and PI1 series and the productivity they can boost for
you in your application.

PI1X Basic Programming Manual Ver. 1.10 2/156
Table of Contents
Preface .................................................................................................................. 1
Table of Contents .................................................................................................. 2
1How to run BASIC program......................................................................... 5
1.1 User Menu....................................................................................... 5
1.1.1 Run program............................................................................. 5
1.1.2 Remote Link............................................................................. 5
1.1.3 Information............................................................................... 6
2Program Structure......................................................................................... 7
2.1 Constants......................................................................................... 7
2.1.1 String ....................................................................................... 7
2.1.2 Numeric ................................................................................... 7
2.2 Variables.......................................................................................... 7
2.2.1 Variable Names and Declaration Characters............................... 8
2.2.2 Array Variables......................................................................... 8
2.3 Expression and Operators ................................................................. 8
2.3.1 Assignment Operator ................................................................ 9
2.3.2 Arithmetic Operator.................................................................. 9
2.3.3 Relational Operator................................................................... 9
2.3.4 Logical Operator....................................................................... 9
2.4 Operator Precedence........................................................................10
2.5 Labels.............................................................................................10
2.6 Subroutines.....................................................................................11
2.7 Exit program...................................................................................12
2.8 Special notes...................................................................................12
3Command Sets..............................................................................................13
3.1 General commands..........................................................................13
3.2 Commands for decision structures....................................................17
3.3 Commands for looping structures.....................................................20
3.4 Commands for string processing......................................................22
3.5 Commands for event trapping..........................................................28
3.6 System commands...........................................................................38
3.7 Reader commands ...........................................................................43
3.8 Beeper commands ...........................................................................50
3.9 Calendar and timer commands.........................................................52

PI1X Basic Programming Manual Ver. 1.10 3/156
3.10 LED Command...............................................................................54
3.11 Keypad commands..........................................................................55
3.12 LCD Commands .............................................................................63
3.13 Font................................................................................................67
3.13.1 User font commands..................................................................67
3.14 TextBlock .......................................................................................69
3.14.1 TextBlock commands.................................................................70
3.15 File manipulation commands ...........................................................74
3.15.1 Standard Commands ................................................................74
3.15.2 DBMS Commands...................................................................82
3.16 Vibrator commands .........................................................................87
3.17 Communication port commands.......................................................88
3.18 Memory commands.......................................................................105
3.19 USB commands ............................................................................106
3.20 LinkingPort commands..................................................................107
3.21 RFHOST (Only for PI-1060) commands ........................................118
3.22 Simulator (Only for PC simulator) commands................................119
4Appendices .................................................................................................120
Appendix A..................................................................................................120
PI series Basic Commands list....................................................................120
A1. General commands ................................................................120
A2. Commands for decision structures..........................................120
A3. Commands for looping structures ...........................................121
A4. Commands for string processing.............................................121
A5. Commands for event trapping.................................................122
A6. System commands .................................................................122
A7. Reader commands..................................................................123
A8. Buzzer commands..................................................................124
A9.Calendar and timer commands................................................124
A10. LED command ......................................................................124
A11. Keypad commands.................................................................124
A12. LCD Commands....................................................................125
A13. User font commands ..............................................................126
A15. File manipulation commands..................................................127
A16. Vibrator commands................................................................128
A17. Communication port commands.............................................128
A18. Memory commands ...............................................................129
A19. USB commands.....................................................................129

PI1X Basic Programming Manual Ver. 1.10 4/156
A20. LinkingPort commands ..........................................................130
A21. RFHOST commands..............................................................130
A22. Simulator (Only for PC simulator) commands.........................131
Appendix B ........................................................................................................132
Scan Module (CCD) Configuration Table..................................................132
Appendix C........................................................................................................144
Scan Module (2D) Configuration Table......................................................144

PI1X Basic Programming Manual Ver. 1.10 5/156
1How to run BASIC program
1.1 User Menu
.
If you have already downloaded FW file, then you can view the User Menu by
pressing the power key.
1.1.1 Run program
If the BASIC program file (xxx.bas) in the direct path
(D:\\Program\\) then you can run the BASIC program now.
If the BASIC program file (xxx.bas) is not in the direct path
(D:\\Program\\) then the following message will prompt you.
1.1.2 Remote Link
You can use this item to download program file or
download/upload other files.

PI1X Basic Programming Manual Ver. 1.10 6/156
1.1.3 Information
You can use this item to get version information of all software
and firmware parts of the system.

PI1X Basic Programming Manual Ver. 1.10 7/156
2Program Structure
2.1 Constants
Constants are the actual values used or generated in the program. There
are two types of constants:
2.1.1 String
Astring constant is a sequence of up to 2048 alphanumeric
characters or symbols enclosed in a pair of double quotation
marks.
"BASIC"
"2017.05.13"
"ArgoBasic program guide"
"168 IbB……"
"IbB 168 ……!"
2.1.2 Numeric
Numeric constants include positive and negative numbers.
Numeric constants in BASIC cannot contain commas. There are
two types of numeric constants that can be used in the PI Basic
interpreter.
Integer constants: –2147483648 ~ + 2147483647
Real number constants: Positive or negative real number, that
contain a decimal point, such as 1.23
or –3.5897
2.2 Variables
Variable are symbols used to represent data items, such as numerical
values or character strings that are used in BASIC program. The value of a
variable may be assigned explicitly and can be changed during the
execution of the program. Value of a variable is assumed to be undefined
until a value is assigned to it.

PI1X Basic Programming Manual Ver. 1.10 8/156
2.2.1 Variable Names and Declaration Characters
The following are the rules to declare variable names and
characters:
A variable name must be begun with a letter.
The remaining characters can be letters, numbers, or
underscores.
The last character can be one of these declaration characters:
% (Integer) : 4 bytes (- 2147483648 to 2147483647)
!(Real number) : 8 bytes
$ (String) : 2048 bytes
Variable name cannot be any BASIC reserved words.
Only 3 types of variable are supported.
Variable names are case ( upper or lower case ) dependent.
2.2.2 Array Variables
An array is a group or table of values referenced by the same
variable name. Each element in an array is referenced by an array
variable that is subscripted with an integer or an integer
expression.
Each element in an array is referenced by an array variable that is
subscripted with an integer or an integer expression. In PI Basic,
the maximum number of dimensions for an array is 2.
Forexample:
A$(8) ‘one dimension array
Str%(2,5) ‘two dimension array
DIM A%(23) ‘declares an integer array with 23
elements.
DIM Str$(60) ‘declares a string array with 60 elements.
2.3 Expression and Operators
An expression may be a string or numeric constant, or a variable, or it may
be a combination of constants and variables with operators to produce a
string value.
Operators perform mathematical or logical operations.

PI1X Basic Programming Manual Ver. 1.10 9/156
2.3.1 Assignment Operator
PI Basic interpreter supports an assignment operator “=”
Forexample:
Size% =100
PI! =3.1415
Str1$=”back”
2.3.2 Arithmetic Operator
The arithmetic operators are:
Operator
Operation
Example
^
Exponentiation
A% = 9^6
-
Negation
A% = -B%
*
Multiplication
A% = B% * C%
/
Division
A% = B% / C%
+
Addition
A% = B% + C%
-
Subtraction
A% = B% - C%
MOD
Modulo arithmetic
A% = B% MOD C%
2.3.3 Relational Operator
Relational operators are used to compare two values. Result of the
comparison is either “True” or “False”.
Operator
Operation
Example
=
Equality
A% = B%
<>
Inequality
A%<> B%
>
Greater than
A% > B%
<
Less than
A%< B%
>=
Greater than or equal to
A% >= B%
<=
Less than or equal to
A% <= B%
2.3.4 Logical Operator
Logical operators perform tests on multiple relations and Boolean
operations. Logical operator returns a result which is either
“True” (not zero) or “False” (zero). In an expression, logical
operations are performed after arithmetic and relational
operations.

PI1X Basic Programming Manual Ver. 1.10
10/156
Operator
Operation
Example
NOT
Logical negation
NOT (A% = B%)
AND
Logical and
(A% = B%) AND (C% =
D%)
OR
Inclusive or
(A% = B%) OR (C% = D%)
XOR
Exclusive or
(A% = B%) XOR (C% =
D%)
2.4 Operator Precedence
The precedence of BASIC operators affects the evaluation of operands in
expressions. Expressions with higher precedence operators are evaluated
first. Precedence of BASIC operators is listed below in the order of
precedence from highest to lowest.
Order of Precedence
Type of Operation
symbol
Highest
Arithmetic
^
↓
Arithmetic
*, /, MOD
↓
Arithmetic
+, -
↓
Relational
=, <>, >, <, >=, <=
↓
Logical
NOT, AND, OR,
XOR
Lowest
Assignment
=
2.5 Labels
Line labels are used to represent some special lines in the BASIC program.
They can be either integer numbers or character strings.
A valid integer number for the line label is in the range from 1 to
65279.
Acharacter string label can have up to 2048 characters (if the string
label has more than 2048 characters, error can be it cannot be
anticipated).
Acharacter string label that precedes a program line must have a colon
between the label and the program line, but it is not necessary for an
integer label.

PI1X Basic Programming Manual Ver. 1.10
11/156
Forexample:
GOTO 100
…
100
…
GOTO LABEL2
…
LABEL2:
…
2.6 Subroutines
Asubroutine is a set of instructions with a particular name or a line label.
User can simplify their programming by breaking programs into
subroutines. Asubroutine will be executed when being called by a
GOSUB command.
Forexample:
ON COM (1) GOSUB ReadCOM
…
ReadCOM:
…
RETURN
The command RETURN marks the end of the subroutine and tells the
processor to return to the caller. A subroutine has to be appended at the
end of the main BASIC program. Asubroutine can be defined with or
without a pair of brackets.
For example:
GOSUB FUN
GOSUB Place
GOSUB Test
END
…
SUB FUN( )
PRINT "Run function!!"
END SUB

PI1X Basic Programming Manual Ver. 1.10
12/156
Place:
PRINT "Run Place!!"
RETURN
SUB Test
PRINT “TEST…”
END SUB
2.7 Exit program
In any place of the program, you can use “END” to exit the
program. The system will go to BASIC Menu.
PRINT "Press key to exit!"
WHILE INKEY$ = ""
WEND
END
2.8 Special notes
Commands have to be appeared in uppercase letters
PRINT “OK…” → right
print “NG…” → error
Variable names are case sensitive.
ABC%、ABc%、AbC% → Three kind of different variables
ARGO%、ARGO!、ARGO$ → Three kind of different variables

PI1X Basic Programming Manual Ver. 1.10
13/156
3Command Sets
3.1 General commands
ABS
Purpose:
To return the absolute value of a numeric expression.
Syntax:
A% = ABS(N%) or A% = ABS(N!)
Example:
Num1% = 2.89
Num2% = 9.55
Difference% = ABS (Num1% - Num2%)
Description:
A% is numeric variable to be assigned to the absolute value
of a numeric expression.
N% or N! is a numeric expression, it can be an integer or a
real number.
DIM
Purpose:
To specify the maximum value of variable subscripts and to
allocate storage accordingly.
Syntax:
DIM Array (range {,range}) {, Array(range {,range})}
Example:
DIM A%(8), B%(5,5),C$(6)
Description:
Array is an array variable.
Range can be an integer or an integer expression.

PI1X Basic Programming Manual Ver. 1.10
14/156
GOSUB
Purpose:
To call a specified subroutine.
Syntax:
GOSUB SubName|SubLabel|SubNumber
Example:
GOSUB FUN
GOSUB Place
GOSUB 100
END
SUB FUN( )
PRINT "Run SUBNAME"
END SUB
Place:
PRINT "Run SUBLABEL"
RETURN
100
PRINT "RunSUBNUMBER"
RETURN
Description:
SubName is the name of a subroutine.
SubLabel is the line label of a subroutine.
SubNumber is the line number of a subroutine.
GOTO
Purpose:
To branch unconditionally to a specified line number or line
lable from the normal program sequence.
Syntax:
GOTO LineNumber|LineLabel
Example:
GOTO FUN
100
PRINT "NUMBER"
WHILE INKEY$=""
WEND
END
FUN:
PRINT "LABEL NAME"
GOTO 100
Description:
LineNumber is the integer number in front of a program line.
LineLabel is the string label of a program line.

PI1X Basic Programming Manual Ver. 1.10
15/156
INT
Purpose:
To return the largest integer that is less than or equal to the
giver numeric expression.
Syntax:
A% = INT(N%) or A% = INT(N!)
Example:
A% = INT(9.86)
PRINT A%
B% = INT(-5.68)
PRINT B%
Description:
A% is an integer variable to be assigned to the result.
N% or N! is a numeric expression,it can be an integer or a
real number.
REM
Purpose:
To insert explanatory remarks in a program.
Syntax:
REM remark or 'remark
Example:
REM This is function
' This is BASIC program
Description:
remark may be any sequence of characters. BASIC
interpreter will ignore whatever follows the REM or ‘ until
end of the line’.
SET_PRECISION
Purpose:
To set the precision of the decimal points for printing real
number expression.
Syntax:
SET_PRECISION(N%)
Example:
A! = 3.141592654
SET_PRECISION(6)
PRINT "A= ", A! ' A= 3.141593
Description:
N% is a numeric expression in the rang of 0 to 6.
The precision default setting is two digits.

PI1X Basic Programming Manual Ver. 1.10
16/156
SGN
Purpose:
To return an indication of the mathematical sign (+ or -) of a
given numeric expression.
Syntax:
A% = SGN(N%) or A% = SGN(N!)
Example:
A% = SGN(9.86)
PRINT A%
B% = SGN(-5.68)
PRINT B%
B% = SGN(0)
PRINT B%
Description:
N% or N! is a numeric expression,it can be an integer or a
real number.
A% is an integer variable to be assigned to the result.
A%
Meaning
1
N% >0
0
N% =0
-1
N% <0

PI1X Basic Programming Manual Ver. 1.10
17/156
3.2 Commands for decision structures
IF …THEN …{ELSE IF…} [ELSE…] END IF
Purpose:
To provide a decision structure for multiple-line conditional
execution.
Syntax:
IF condition1 THEN [statements1] {ELSE IF condition2
THEN statements2} [ELSE elsestatements] END IF
Example:
PRINT "Input a number:"
Result%=INPUT("",K%)
IF K% < 10 THEN
PRINT "One digit"
ELSE IF K% < 100 THEN
PRINT "Two digits"
ELSE
PRINT "Over one Hundry!"
END IF
Description:
condition is a logical expression.
statements can be multiple lines of BASIC statements.

PI1X Basic Programming Manual Ver. 1.10
18/156
ON …GOSUB …
Purpose:
To call one of the specified subroutines depending on the
value of the expression.
Syntax:
ON N% GOSUB SubLabel| SubName {,SubLabel|
SubName}
Example:
D% = DAY_OF_WEEK
ON D% GOSUB MON, THE, WED, THR, FRI, SAT, SUN
WHILE INKEY$=""
WEND
END
MON:
PRINT "MONDAY"
RETURN
THE:
PRINT "TUESDAY"
RETURN
WED:
PRINT "WEDNESDAY"
RETURN
THR:
PRINT "THURSDAY"
RETURN
FRI:
PRINT "FRIDAY"
RETURN
SAT:
PRINT "SATURDAY"
RETURN
SUN:
PRINT "SUNDAY"
RETURN
Description:
N% is a numeric expression that is rounded to an integer. The
value of N% determines which subroutine is to be called. If
the value of N% is 0 or greater than the number of routines
listed, the interpreter will continue with the next executable
statement.
SubLabel is the name of a subroutine.

PI1X Basic Programming Manual Ver. 1.10
19/156
SubName is the line label of a subroutine.
ON …GOTO …
Purpose:
To branch to one of several specified Line Labels depending
on the value of an expression.
Syntax:
ON N% GOTO LineLabel | LineNumber {,LineLabel |
LineNumber}
Example:
D% = DAY_OF_WEEK
ON D% GOTO 1, 2, 3, 4, 5, 6, 7
1
PRINT "MONDAY"
END
2
PRINT "TUESDAY"
END
3
PRINT "WEDNESDAY"
END
4
PRINT "THURSDAY"
END
5
PRINT "FRIDAY"
END
6
PRINT "SATURDAY"
END
7
PRINT "SUNDAY"
END
Description:
N% is a numeric expression which is rounded to an
integer.The value of N% determines which line lable in the
list will be used for branching. If the value N% is 0 or greater
than the number of line labels listed,the interpreter will
continue with the next executable statement.
LineLabel is the string label of a program line.
LineNumber is the integer number in front of a program line.
This manual suits for next models
1
Table of contents
Other Argox Printer manuals

Argox
Argox iX4 Series User manual

Argox
Argox O4 Series User manual

Argox
Argox AME-3230 User manual

Argox
Argox AME-3230 User manual

Argox
Argox X2000 User manual

Argox
Argox R-400plus User manual

Argox
Argox OS Series User manual

Argox
Argox iX4 Series User manual

Argox
Argox P4 Series User manual

Argox
Argox OS Series User manual

Argox
Argox A-2240 User manual

Argox
Argox OS-2130DE User manual

Argox
Argox A-50 User manual

Argox
Argox X-2300 User manual

Argox
Argox O4 Series User manual

Argox
Argox O4 Series User manual

Argox
Argox CP-2140Z User manual

Argox
Argox CP Series User manual

Argox
Argox O4 Series User manual

Argox
Argox D4 250 User manual