beautypg.com

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

Page 72

background image

RPBASIC-52 PROGRAMMING GUIDE

2-53

LINE

(Function)

Syntax:

A = LINE(line)
Where: line = 0-9 o r 100 to 123 (L ine ran ges m ay var y. Che ck you r hardw are m anua l.)

Function:

Returns status o f a line at on-card lines L 0-7 or interrupt port.

Mode:

Comm and,Run

Use:

A = LINE(2)

Reads line 2.

Cards:

Basic functio n available on a ll cards. Range s vary from ca rd to card. See hard ware m anual.

D E S C R IP T I ON

LINE returns a 0 or a 1. A '0' corresponds to a low while a '1' is a high. LINE returns the status of an external
opto ra ck line or on ca rd lines 0-7. line number corresponds to a position on an external opto rack. For on
card lines, the range is 0 to 9. For an off card rack connected to the digital I/O port, it is num bered 100 to
123. 10 0 is sim ply ad ded to the op to posi tion nu mbe r to spec ify a po sition.
When using LINE to return the status of an opto output line, a '0' means the module is ON while a '1'
indicates it is OFF. This is in contrast to the LINE statement which turns on a module with a '1'. When
reading an opto input module, a '0' indicates there is no voltage applied to the inputs.

LINE returns true logic for L0-L7. A "0" is a logic low while a "1" is a logic high. Line 8 returns the status
of INT0 and/or ISOA/B input. Line 9 returns the status of INT 1.

LINE(n ) and LINE #(n) may be used interchan geably in a prog ram. For exa mple, you m ay have an e xternal 8
positio n opto rack a nd use some of the n on opt o digita l lines fo r switc h inpu ts.

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 '(' or ')' are missing

BAD DATA

When line is out of range for a port.

EXAMPLE

The following example show how LINE and LINE# may be used

10 CONFIG LINE 100,12,0,0,1

Configure I/O port

20 PRINT LINE(104)

Read external opto rack position 4

30 PRINT LINE#(119)

Read digital I/O port line 19 (Port A.0)

40 LINE 100,1

Turns on opto module at external rack position 0

50 LINE#110,1

Turns on high current output at I/O port line 10.