IMS MicroLYNX Quick Manual page 30

Hide thumbs Also See for MicroLYNX:
Table of Contents

Advertisement

I O S E x e r c i s e # 2 B : S e t t i n g a D e d i c a t e d I n p u t A c t i v e H i g h
In this example we are going to use the same
type of switch and LED configuration as in the
previous example, except, instead of connecting
the switch between I/O 22 and I/O GND, we
will connect the switch between I/O 22 and V
PULL. As before, we will use the switch to Soft
Stop the motor.
Connect the switch as shown. Since we will be
pulling the I/O line to +5VDC using the push
button switch to activate it, we move the pull-
up switch for line 22 to the OFF position.
Enter the following into the terminal:
As before, the line is a Soft Stop (10) input (0), only this time we have set it to be
active HIGH (1) instead of LOW, now the line will be active when it sees +5V.
Slew the motor to test the setup. When the switch is depressed the motor should
stop and the LED turn off.
Leave the LED and switch connected for the next two examples.
I O S E x e r c i s e # 3 : S e t t i n g a G e n e r a l P u r p o s e O u t p u t
In this example we are going to use the LED connected to I/O line 21 and write a
small program that will cause the LED to illuminate following a short move,
wait for two seconds, turn the LED off, then repeat.
Enter the following program into the text editor window of the LYNX Terminal
software. It isn't necessary to type in the comments, which are preceded by the
apostophe ('). These are there to explain each line of code. In actual program
development they are a troubleshooting aid.
IOS 21 = 0,1,0
PGM 200
LBL IO_TEST
MOVR 51200
HOLD 2
IO 21 = 1
DELAY 2000
IO 21 = 0
BR IO_TEST
END
PGM
When completed, download the program to your
MicroLYNX by clicking the menu item "Transfer > Down-
load" on the LYNX Terminal's menu bar. Select "Edit Win-
dow" as the source type on the download dialog, click down-
load. The program will transfer to your MicroLYNX.
Test your program by entering "EXEC IO_TEST" into the
terminal window. The motor should move 51200 microsteps
28
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
IOS 22 = 10,0,1
'set I/O line 21 = gen. purpose out, active low
'start program at address 200
'name program IO_TEST
'index to relative position 51200
'hold program execution until motion completes
'set I/O line 21 active
'wait 2 seconds
'set I/O line 21 inactive
'loop to beginning of program
V P U L L
P U S H B U T TO N
S W IT C H
I/O LIN E 22
Figure 8.5: IOS Exercise #2B
These small example programs
language. They introduce common
commands that will be covered
also serve to introduce you
to the LYNX programming
later in this document

Advertisement

Table of Contents
loading

Table of Contents