Programming instructions
37
Intermec Fingerprint 6.13 – Programmer's Guide
ON BREAK...GOSUB
When a BREAK condition occurs on a specified device, the
execution will be interrupted and branched to a specified subrou-
tine. There, you can e.g. let the printer emit a sound signal or display
a message before the program is terminated. You can also let the
program execution continue along a different path.
This example shows how the program is interrupted when the <C>
and <Pause> keys on the printer's keyboard are pressed. The
execution branches to a subroutine, which emits a siren-sounding
signal three times. Then the execution returns to the main program,
which is indicated by a long shrill signal. If the printer is not fitted
with a keyboard, you can isue a break interrupt by transmitting the
character “#" from the host on the communication channel "uart1:".
10 BREAK 1,35
20 BREAK 1 ON
30 ON BREAK 0 GOSUB 1000:REM Break from keyboard
40 ON BREAK 1 GOSUB 1000:REM Break from host (#)
50 GOTO 40
60 SOUND 800,100
70 BREAK 1 OFF: END
1000 FOR A%=1 TO 3
1010 SOUND 440,50
1020 SOUND 349,50
1030 NEXT A%
1040 GOTO 60
RUN
ON COMSET...GOSUB
When one of several specified conditions interrupts the background
communication on a certain communication channel, the program
branches to a subroutine, e.g. for reading the buffer. The interrupt
conditions (end character, attention string and/or max. number of
characters) are specified by a COMSET statement .
Example:
1 REM Exit program with #STOP&
10 COMSET1,"#","&","XYZ","=",50
20 ON COMSET 1 GOSUB 2000
30 COMSET 1 ON
40 IF A$ <> "STOP" THEN GOTO 40
50 COMSET 1 OFF
...
...
1000 END
2000 A$=COMBUF$(1)
2010 PRINT A$
2020 COMSET 1 ON
2030 RETURN
5. FINGERPRINT PROGRAMMING, cont'd.
8. Conditional Branching,
cont'd.
Continued!
☞
Breaking the Execution
Also see:
• Chapter 5.12
☞
Background Communication
Also see:
• Chapter 7.8