beautypg.com

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

Page 76

background image

RPBASIC-52 PROGRAMMING GUIDE

2-57

LINE#

(Statemen t)

Syntax:

LINE# line,data
Where: line = 101 to 125, is the digital I/O line connector number. (Line ranges may vary. Check

your ha rdwa re ma nual.)
data = O N , O FF , 0, o r 1 . Se e te x t b e lo w .

Function:

S e t s a s pe c if i ed l in e a t t h e d i gi t al I /O c o n ne c to r hi g h o r lo w .

Mode:

Comm and, Run

Use:

LIN E #10 2,0

Card:

Basi c com man d avai lable fo r all car ds. line ranges are card dependen t. Refer to hardw are manu al.

D E S C R IP T I ON

LIN E # ad dresse s the dig ital I/O conne ctor pin s. line must be be tween 101 and 125. Line 102 is not valid (it
is the +5 V su pply).

data is either ON, O FF, 0 or 1. ON is the same a s a 1 while O FF is a 0. '0' sets the line low w hile a '1' sets it
high. This is the opp osite of the LIN E com mand. O pto modu les require a low , or '0' level to turn on. LINE
inverts data while LINE # does not. Using ON and OFF speeds up statement execution by about 20%.

LIN E and LINE # ma y be us ed inte rchan geab ly in a p rogram .

RELATED

L I N E , L I N E B (f u nc t io n ), L IN E , L IN E B ( st a te m e n t) , C O N F I G L IN E

ERRORS

B A D A R G U M E N T When line is out of range
B A D S Y N T A X

When # is used for on card opto rack

EXAMPLE

The following example shows how different data is returned.

10 LINE 118,OFF

Turns 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 condition to turn off a module.