
RPBASIC-52 PROGRAMMING GUIDE
2-56
LINE (Statement)
Syntax: LINE line,data
Where: line = 0 to 8 or 100 to 123 (L ine ran ges may vary. Che ck your hardw are m anual.)
data = 0, 1, ON, or OFF. See text below.
Function: Turns a external opto mod ule or lines L0-L8 on or off.
Mode: Command, Run
Use: LINE 0,1
Cards: Basic statemen t available for a ll cards. line ranges are card dependent. See hardware manua l.
DESCRIPTION
LINE is used to control an external output opto module or on card lines 0-8. On board opto positions are
numbered 0-3. Off card opto racks using the digital I/O port are numbered 100 to 123. 100 is simply added
to the opto position to identify the external rack. For example,
LINE 105,0
turns external opto rack position num ber 5 off.
data is ON, OFF, 0, or 1. ON is equivalent to 1 while OFF is 0. A '0' value turns off a module while a '1'
turns it on. These values are in contrast to the LINE# statement, which has the opposite meaning. For lines
0-7, "O N" se ts a line to a 1 w hile "O FF" s ets it to 0.
LINE 8,0 turns off the high curren t port. LINE 8,1 turns it on.
Using ON or OFF instead of numbers or variables speeds up this statement by 20%.
LINE and LINE # ma y be us ed interchangeably in a program .
RELATED
LINE, LINE#, LINEB (function), LINE#, LINEB (statement), CONFIG LINE
ERROR
BAD ARGUMENT When line is out of range
EXAMPLE
The following example shows how different data is returned.
10 LINE 118,OFFTurns off external opto module 18.
20 LINE #118,0 Sets digital I/O connector line 18 to 0.
30 PRINT LINE(118),LINE#(118)
run
1 0
The function LINE(118) returns a 1 because that is the necessary condition to turn off a module. Also notice
that LINE(118) returns the status at opto port position 18 while LINE#(118) returns the condition at the
digital I/O port connector pin 18.
Use the CONFIG LINE statement to configure lines as inputs and outputs. Refer to the Digital I/O lines
section in the manual and CONFIG LINE statement for more information.
Komentarze do niniejszej Instrukcji