VLT
®
5000 SyncPos option
MG.10.J4.02 – VLT is a registered Danfoss trade mark
122
■■
■■
■ 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
ENDWHILE
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 com-
mands within the loop must have a direct or in-
direct 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
ENDWHILE
Program sample
WHILE_01.M
INKEY_01.M
■■
■■
■ _GETVEL
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 resp.
qc/sec for MAVEL.
Parameter
t = sample time in msec
Command group
I/0
Cross Index
AVEL, 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