![Galil Motion Control DMC-14 5 Series Скачать руководство пользователя страница 41](http://html1.mh-extra.com/html/galil-motion-control/dmc-14-5-series/dmc-14-5-series_manual_3258007041.webp)
This program moves the motor to an initial position of 1000 and returns it to zero on increments of half
the distance. Note, _TP is an internal variable which returns the value of the position. Internal
variables may be created by preceding a DMC-141X instruction with an underscore, _.
Example 13 - Control Variables and Offset
Objective: Illustrate the use of variables in iterative loops and use of multiple instructions on one line.
Instruction
Interpretation
#A
Set initial values
KI0
DP0
V1=8; V2=0
Initializing variables to be used by program
#B
Program label #B
OF V1
Set offset value
WT 200
Wait 200 msec
V2=_TP
Set variable V2 to the current position
JP#C,@ABS[V2]<2
Exit if error small
MG V2
Report value of V2
V1=V1-1 Decrease
Offset
JP #B
Return to top of program
#C;EN End
This program starts with a large offset and gradually decreases its value, resulting in decreasing error.
32
i
Chapter 2 Getting Started
DMC-14x5/6
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com