Intelligent Motion Systems Modular LYNX System User Manual

Page 29

Advertising
background image

1 - 29

Modular L

YNX System

Modular LYNX System 12.05.2003

C o n f i g u r i n g a n O u t p u t

Figure 6.3 illustrates the Output equivalent circuit of the Isolated I/O. When used as an output the I/O line is
able to sink 350mA continuous for each output, or a total of 1.5A for the entire I/O Group. See Section 9:
The Isolated Digital I/O Module
for detailed specifications. In the usage example we will use an LED on I/O
Line 31 for the load. We will use the same program from the input example, only we will use the output to
light the LED while the motor is
moving.

IOS 31 = 18, 1, 1

Using the table on page 27 we can
break this setting down as follows:
IOS 31 - Identifies that I/O line 31 is
being configured.
18 - Configures the I/O Type as
“Moving”.
1 - Configures the I/O line as an
output.
1 - Configures the Line as “Active
HIGH”.

Now when the input program above is
executed, the LED will be lit during the
move.

T h e I O V a r i a b l e

After configuring the I/O by means of the IOS variable, we need to be able to do two things with the I/O.

1]

Write to an output, or group of outputs, thus setting or changing its (their) state.

2]

Read the states of either inputs or outputs. We can use this information to either display those
states to our terminal, or to set up conditions for branches and subroutine calls within a program.

We can also use this command to write or read the state of an entire I/O group.

R e a d / W r i t e a S i n g l e I / O L i n e

To read the state of a single input or output, the following would be typed into the terminal:

PRINT IO 21

The response from this would be 1 or 0, depending on the state of the line.
The state of an input or output in a program can be used to direct events within a LYNX program by either
calling up a subroutine using the “CALL” instruction, or conditionally branching to another program
address using the “BR” instruction. This would be done in the following fashion.

CALL MYSUB, IO 22=1

This would call up a subroutine labled “MYSUB” when I/O line 21 is active.

BR 200, IO 22=0

This would branch to address 200 when I/O line 22 is inactive.

Writing to an output is accomplished by entering the following into a terminal or program:

IO 21=1

IO 21=0

This would change the state of I/O line 21.

I/O LINE

4.5V Internal

Pullup

Pull-Up Switch = OPEN

+5 VDC

L

Y

N

X

Co

nt

ro

l M

o

d

u

le

7.5k

Figure 6.3: Isolated I/O Output

Advertising