Programmable SyncPos motion controller
MG.10.J8.02 – VLT is a registered Danfoss trade mark
164
■
■
■
■
■
WHILE .. DO .. ENDWHILE
By using the WHILE. ..
....
.... ENDWHILE construction you
can repeat the enclosed program area one or more
times, dependent on any criteria. The loop criteria is
made up of one or more comparison operations,
and is always monitored at the start of a loop. When
a negative result already appears at the first
monitoring, this can cause an omission of the
commands within the loop, and the program will
continue after the ENDWHILE instruction.
Summary
Conditional loop with start criteria
(While condition is fulfilled, repeat ...)
Syntax
WHILE condition DO
EN DWH I LE
Parameter
condition = abort criteria
NB!
Depending on the loop criteria, it can happen
that the contents of the loop will never be
processed.
To avoid an endless loop, the processed commands
within the loop must have a direct or indirect
influence on the result of the abort check.
Command group
CON
Cross Index
LOOP, REPEAT ..
....
.... UNTIL ..........
Syntax-Example
WHILE (A != 1 AND B == 0) DO
command line 1
command line n
E N D W H I L E
Program sample
WH I LE_01.M , I N KEY_01.M
■
■
■
■
■
_G ETVEL
With the _GETVEL command it is possible to
change the sampling time for AVEL and MAVEL.
AVEL and MAVEL usually work with a sampling
time of 20 ms. With this sampling time the resolu-
tion is better. However, a new measurement is only
sampled every 20 ms.
The command _GETVEL lasts exactly as long as the
assigned value, e.g.
_GETVEL 200 ca. 200 ms.
Summary
Changes sample time for AVEL and MAVEL
Syntax
var = _GETVEL t
The values are displayed in UU/sec for AVEL or qc/
sec for MAVEL.
Parameter
t = sample time in msec
Command group
I/0
Cross Index
AVE L, MAVEL
Syntax-Example
var = _GETVEL 200
Thus, the measurement resolution is considerably
better; however changes are only seen after a delay
of 200 ms.
Software Reference