IMS MicroLYNX Quick Manual page 31

Hide thumbs Also See for MicroLYNX:
Table of Contents

Advertisement

Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
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
(1 revolution for a 1.8° stepper motor with the MicroLYNX at the default
microstep resolution of 256), the LED will illuminate for 2 seconds, turn off, and
the process will repeat itself until the escape key is pressed.
At this point you will want to clear and restore your MicroLYNX, this is done
by entering the following in the terminal window:
CP 1,1
DVF ,,1
IP
I O S E x e r c i s e # 4 : S e t t i n g a G e n e r a l P u r p o s e I n p u t
In this next example we will build on the last one and do something a little more
complex. In this example the program will run as in the previous one except we
will add a subroutine that will change the delay from 2 seconds to .5 seconds and
move the motor 25,700 microsteps in the opposite direction, repeating this until
the switch is released.
Enter the following program into the text editor window of the LYNX Termi-
nal software:
IOS 21 = 0,1,0
'set I/O line 21 = gen purpose out, active low
IOS 22 = 0,0,1
'set I/O line 22 = gen. purpose in, active high
PGM 200
LBL IO_TEST2
CALL ON_IN, IO 22=1
MOVR 51200
HOLD 2
IO 21 = 1
DELAY 2000
IO 21 = 0
BR IO_TEST2
LBL ON_IN
MOVR -25700
HOLD 2
IO 21 = 1
DELAY 500
IO 21 = 0
BR ON_IN, IO 22=1
RET
END
PGM
Download the program to your MicroLYNX. Test its operation by entering
"EXEC 200" or "IO_TEST2" in the terminal window. The motor and LED
should operate as it did in the previous example, however, when you depress and
hold the switch, the motor will move half a revolution in the opposite direction
and only delay 0.5 seconds between moves. This should repeat as long as the
switch is held. When released the MicroLYNX should return to the main program
and execute it until either the switch is depressed again or the escape key is struck.
'start program at address 200
'name program IO_TEST2
'call sub ON_IN when I/O 22 is active
'index to relative position 51200
'suspend program until motion completes
'set I/O line 21 active
'wait 2 seconds
'set I/O line 21 inactive
'loop to beginning of program
'declare sub ON_IN
'index 25,700 in neg. direction
'suspend program until motion completes
'set I/O line 21 active
'wait 0.5 seconds
'set I/O line 21 inactive
'loop to ON_IN while I/O line 22 is active
'return from subroutine
29

Advertisement

Table of Contents
loading

Table of Contents