EasyManua.ls Logo

IMS MicroLYNX - Program Samples

Default Icon
98 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
64
Program Samples
The following program samples may be used either as templates or as a means of
familiarizing yourself with the use of the LYNX programming language. Each
step is fully explained by comments.
Motion Sample
This program will move the motor 100,000 steps each time it is executed.
PGM 200 'enter program mode at address 200
LBL MO_SAMP 'label the program MO_SAMP
MOVR 100000 'move relative 100000 steps
HOLD 2 'suspend program until motion completes
END 'designate the end of the program
PGM 'exit program mode
If-Then Sample
This program will loop until an input is pulled to ground. Use of this will
require a switch connected between I/O line 22 and I/O GND.
IOS 22=0,0,0 'set i/o 22 to gen. purpose input, active low
PGM 200 'start program at address 200
LBL IF_THEN 'name the program IF_THEN
MOVR 10000 'relative index 10000 steps
HOLD 2 'suspend program until motion completes
BR IF_THEN,IO 22=0 'IF i/o 22=inactive THEN branch to IF_THEN
MOVR -100000 'relative index -100,000 steps
HOLD 2 'suspend program until motion completes
END 'designate end of program
PGM 'exit program mode
Counting Sample
Each time this program senses an input, it will index the motor a short distance
and count it. As in the previous sample, this program requires the switch be
connected between I/O line 22 and I/O GND.
IOS 22=0,0,0 'set i/o 22 to gen. purpose input, active low
PGM 200 'start program at address 200
VAR COUNT=0 'declare local variable COUNT, set val to 0
LBL IN_CNT 'name the program IN_CNT
BR IN_CNT, IO 22=0 'if i/o 22=inactive, then branch to IN_CNT
LBL LOOP 'label process LOOP
BR LOOP, IO 22=1 'if i/o 22=1, then branch to LOOP
MOVR 10000 'relative index 10000
HOLD 2 'suspend prog. until motion completes
INC COUNT 'increment COUNT
PRINT "COUNT = " COUNT 'display value of COUNT
BR IN_CNT 'uncond. branch to IN_CNT
END
PGM
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Table of Contents

Other manuals for IMS MicroLYNX

Related product manuals