
32
In each case you can calculate the decimal equivalent by adding the weights of
the bits that are set in the I/O group.
Reading the state of inputs will work the very same way. In a real-world example
you may not be using LED’s, but rather outputing to, or receiving input from,
PLC inputs or outputs for process control applications. In this case, in your
MicroLYNX program, you may want to call up various subroutines when the
I/O group is at a certain state. This gives you the power of programming up to
63 events in your process controlled by the standard I/O group on the
MicroLYNX.
I O V a r i a b l e E x e r c i s e # 2
In this exercise we will use a short program that will use I/O group 20 as a
binary counter. The program will display the decimal equivalent of the binary
count on the screen. It will also move the motor a short distance and wait 0.25
seconds in between counts.
Type the following into the text editor window and save. Download to
MicroLYNX.
IOS 20 = 0,1,0 'set I/O group 20 = gen. purp. outputs, active low
IO 20 = 0 'set the state of I/O group 20 to 0
PGM 200
'start program at address 200
LBL IO_CNT
'name the program "IO_CNT"
VI=100000
'set the init. velocity = 100,000 munits/sec.
IO 20=IO 20+1
'add 1 to the value of I/O group 20
MOVR 10000
'move relative 10000 munits
HOLD 2
'suspend program until motion completes
DELAY 250
'wait 0.25 seconds
PRINT "\rThe decimal state of I/O Group 20 is: " IO 20;
BR IO_CNT, IO 20=<63 'loop to IO_CNT while I/O 20 is lss that 63
PRINT "\nALL DONE!" 'line feed to next line print ALL DONE
END
PGM
EXEC IO_CNT to run the program. The LED’s will cycle and the number will
count up on the terminal screen.
S e t t i n g t h e D i g i t a l F i l t e r i n g f o r t h e I / O ( I O F )
User-definable digital filtering
makes the MicroLYNX well
suited for noisy industrial
environments. The IOF variable
allows the user to software select
filter settings ranging from 215
Hz to 27.5 kHz.
The IOF variable has 1 param-
eter with a range of 1 to 7.
These are shown in table 8.2.
O
/
I
d
e
t
a
l
o
s
I
e
s
o
p
r
u
P
l
a
r
e
n
e
G
e
h
t
r
o
f
s
g
n
i
t
t
e
S
r
e
t
l
i
F
F
O
I
)
7
-
0
=
>
m
u
n
<
(
>
m
u
n
<
=
F
O
I
g
n
i
t
t
e
S
r
e
t
l
i
F
f
f
o
t
u
C
y
c
n
e
u
q
e
r
F
e
s
l
u
P
e
l
b
a
t
c
e
t
e
D
m
u
m
i
n
i
M
h
t
d
i
W
0
z
H
k
5
.
7
2
s
d
n
o
c
e
s
o
r
c
i
m
8
1
1
z
H
k
7
.
3
1
s
d
n
o
c
e
s
o
r
c
i
m
6
3
2
z
H
k
9
8
.
6
s
d
n
o
c
e
s
o
r
c
i
m
3
7
3
z
H
k
4
4
.
3
s
d
n
o
c
e
s
o
r
c
i
m
5
4
1
4
z
H
k
2
7
.
1
s
d
n
o
c
e
s
o
r
c
i
m
0
9
2
5
z
H
0
6
8
s
d
n
o
c
e
s
o
r
c
i
m
1
8
5
6
z
H
0
3
4
s
d
n
o
c
e
s
il
l
i
m
2
6
1
.
1
)
t
l
u
a
f
e
d
(
7
z
H
5
1
2
s
d
n
o
c
e
s
il
l
i
m
3
2
3
.
2
Table 8.2: IOF Settings
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from