Statement: print or p – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual
Page 69

Operating Functions
Chapter 5
5–32
If you do not want this delay, you should assign a variable to the special
function operator, TIME, at the beginning of the interrupt routine.
Example:
u10 TIME=0 : CLOCK1 : ONTIME 2,100: DO
u20 WHILE TIME t10: END
u100 A=TIME
u110 PRINT “TIMER INTERRUPT AT –”,A,“SECONDS”
u120 ONTIME A+2,100 : RETI
uRUN
TIMER INTERRUPT AT – 2 SECONDS
TIMER INTERRUPT AT – 4 SECONDS
TIMER INTERRUPT AT – 6 SECONDS
TIMER INTERRUPT AT –8 SECONDS
TIMER INTERRUPT AT – 10 SECONDS
READY
Important: You must exit the ONTIME interrupt routine with a RET I
statement. Failure to do this “locks-out” all future interrupts.
The ONTIME statement eliminates the need for you to “test” the value of
the TIME operator periodically throughout the BASIC program.
Mode: COMMAND and/or RUN
Type: INPUT/OUTPUT
The PRINT statement directs the BASIC Module to output to the console
device. You may print the value of expressions, strings, literal values,
variables or text strings. You may combine the various forms in the print
list by separating them with commas. If the list is terminated with a
comma, the carriage return/line feed is suppressed. P. is a “shorthand”
notation for PRINT.
Examples:
uPRINT 10*10,3*3 u PRINT “MCS–51
″
u PRINT 5,1E3
100
9
MCS–51
5 1000
Important: Values are printed next to one another with two intervening
blanks. A PRINT statement with no arguments sends a carriage return/line
feed sequence to the console device.
5.4.20
Statement: ONTIME
[expr], [ln num] (continued)
5.4.21
Statement: PRINT or P.