Section 3
TM6564-C-00
26 April, 2011
3-6
3.6.
SAMPLE PROGRAMS
The following program will exercise the scanner relays 1 through 16 and leave the line clear.
This program is for HTBasic computers with the scanner address set to 724.
10
! SCANNER TEST
20
DIM Relay$[16]
30
Relay$=”01020304050607080910111213141516”
40
FOR I = 1 TO 16
50
OUTPUT 724;”A”&Relay$[2*I-1,2*I]
! CLOSES A RELAY
60
WAIT .2
70
NEXT I
80
OUTPUT 724;”A00”
! CLEARS CHANNEL
90
END
Note: A Wait of at least 200 milliseconds is required between relay actuations to allow time for
the relay circuits to actuate.
The second program example has exactly the same result as the first program listed above but
uses string output statements. The formatted output statement is used to assure the first character
that the scanner sees (after the address) is the line code and the next two characters are the relay
code.
10
! SCANNER TEST
30
FOR I = 1 TO 16
40
OUTPUT Code$ USING “A,ZZ”;”A”,I ! SETS CODE
50
OUTPUT 724; Code$
! CLOSES A RELAY
60
WAIT .2
100
NEXT I
110
PRINT “A00”
! CLEARS CHANNEL
140
END