Rpbasic-52 programming guide, Line – Remote Processing BASIC 52 User Manual
Page 73

RPBASIC-52 PROGRAMMING GUIDE
2-54
LINE#
(Function)
Syntax:
A = LINE#( line)
Where: line = connecto r number from 101 to 125 (Lin e ranges m ay vary. Che ck your hardw are
man ual.)
Function:
Returns status o f a line at the digital I/O c onnector.
Mode:
Comm and,Run
Use:
A = LINE#(103) Reads level from digital I/O port connector number 3.
Card:
Function ava ilable on all cards. R anges will va ry from card to c ard. See hardw are manu al.
D E S C R IP T I ON
The '# ' modi fier to L INE specif ies the actua l line nu mbe r at the d igital I/O port co nnec tor. line must range
from 101 to 125 or else a BAD ARGUM ENT is returned. Line 102 is also not valid. LINE# cannot be used
for the on card opto rack (0 - 3). The line nu mber is com puted by sim ply adding 100 to the connec tor pin
num ber.
LINE# returns a '0' or a '1', which correspond directly to the logic level at the connector. When using LINE#
to return the status of an o pto output line, a '0' mea ns the mod ule is ON w hile a '1' indicates it is OFF . This is
in con trast to th e LIN E state men t whic h turns o n a m odule with a '1'. Whe n read ing an opto in put m odule , a
'0' indicates there is no voltage applied to the inputs.
The follow ing exam ple returns the status at d igital I/O connec tor J3, pin 19 (82C5 5 port A, bit 0);
A = LINE#(119)
See LINE function for more program exam ples.
RELATED
L I N E , L I N E B fu n c ti o ns , LI N E , L I N E #, L IN E B s t at e m e nt s , C O N F I G L IN E
ERRORS
B A D S Y N T A X
When # is used for on card positions.
BAD DATA
When line is out of range for a port.