Intermec PX6i Fingerprint Developer's Guide (old) - Page 41

Executing the Program, Writing, Executing, and Listing a Short Program

Page 41 highlights

Chapter 2 - Understanding Fingerprint Syntax • Subroutines for key-initiated actions: ON KEY. • Subroutines for display messages: PRINT#. • Error handling subroutines: ERR, ERL, PRSTAT. • Label layout subroutines: PRPOS, DIR, ALIGN, FONT, BARSET, PRTXT, PRBAR, PRIMAGE, PRBOX, PRLINE, and so on. Executing the Program To start the execution of the program currently residing in the printer working memory, issue a RUN statement. Note: Do not issue a RUN statement on a numbered line, or on a line without a number in Programming Mode, or a "RUN statement in program" error occurs. By default, program execution starts at the line with the lowest number and continues in ascending line number order, with the exception of possible loops and branches. Optionally, you can start execution at a specified line (for example, RUN 40 starts at line 40). Use an EXECUTE statement to execute a program that is not currently loaded, or to execute Fingerprint programs from within another Fingerprint program. When you are connected to the printer through a serial connection, the first error that stops the execution causes an error message to be returned to the host screen. In case of program errors, the number of the line where the error occurred is reported by default (for example ,"Field out of label in line 110"). After the error has been corrected, the execution must be restarted by means of a new RUN statement, unless an error-handling routine is included in the program. Writing, Executing, and Listing a Short Program Follow the next procedure to write a short Fingerprint program, execute the program, and list it. To write, execute, and list a short program 1 Connect the printer to a host PC and start a communications program on the host PC. For help, see "Sending Fingerprint Commands to the Printer" on page 3. 2 In HyperTerminal, type NEW and press Enter. The printer returns "Ok". 3 Type IMMEDIATE OFF and press Enter. The printer returns "Ok". 4 Type the following text and press Enter at the end of each line: REM This is a demonstration program PRINT "This is the main program" GOSUB sub1 END sub1: PRINT "This is a subroutine":'Line label RETURN IMMEDIATE ON Intermec Fingerprint Developer's Guide 25

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187

Chapter 2 — Understanding Fingerprint Syntax
Intermec Fingerprint Developer’s Guide
25
Subroutines for key-initiated actions: ON KEY.
Subroutines for display messages: PRINT#.
Error handling subroutines: ERR, ERL, PRSTAT.
Label layout subroutines: PRPOS, DIR, ALIGN, FONT, BARSET, PRTXT,
PRBAR, PRIMAGE, PRBOX, PRLINE, and so on.
Executing the Program
To start the execution of the program currently residing in the printer working
memory, issue a RUN statement.
By default, program execution starts at the line with the lowest number and
continues in ascending line number order, with the exception of possible loops and
branches. Optionally, you can start execution at a specified line (for example, RUN
40 starts at line 40).
Use an EXECUTE statement to execute a program that is not currently loaded, or to
execute Fingerprint programs from within another Fingerprint program.
When you are connected to the printer through a serial connection, the first error
that stops the execution causes an error message to be returned to the host screen.
In case of program errors, the number of the line where the error occurred is
reported by default (for example ,“Field out of label in line 110”). After the error has
been corrected, the execution must be restarted by means of a new RUN statement,
unless an error-handling routine is included in the program.
Writing, Executing, and Listing a Short Program
Follow the next procedure to write a short Fingerprint program, execute the
program, and list it.
To write, execute, and list a short program
1
Connect the printer to a host PC and start a communications program on the
host PC. For help, see
“Sending Fingerprint Commands to the Printer” on
page 3.
2
In HyperTerminal, type
NEW
and press
Enter
. The printer returns “
Ok
”.
3
Type
IMMEDIATE OFF
and press
Enter
. The printer returns “
Ok
”.
4
Type the following text and press
Enter
at the end of each line:
REM This is a demonstration program
PRINT “This is the main program”
GOSUB sub1
END
sub1: PRINT “This is a subroutine”:'Line label
RETURN
IMMEDIATE ON
Note:
Do not issue a RUN statement on a numbered line, or on a line without a
number in Programming Mode, or a “RUN statement in program” error occurs.