![Danfoss VLT5000 SyncPos Скачать руководство пользователя страница 117](http://html.mh-extra.com/html/danfoss/vlt5000-syncpos/vlt5000-syncpos_operating-instructions-manual_4121908117.webp)
Programmable SyncPos motion controller
MG.10.J8.02 – VLT is a registered Danfoss trade mark
116
Software Reference
■
■
■
■
■
IF ..THEN .., ELSEIF .. THEN .. ELSE .. ENDIF
Conditional program branching can be realized
with the IF..EN DIF construction.
When the conditions following IF or ELSEIF are
fulfilled, then the commands leading to the next
ELSEIF, ELSE or ENDIF are carried out – and the
program will be continued after the ENDIF in-
struction.
When the conditions are not fulfilled, then the
following ELSEIF branching will be checked and,
in as much as the conditions are fulfilled, the
corresponding program part will be carried out,
and the program continued after ENDIF.
The branching conditions that are checked after IF
or ELSEIF can be made up of one or more com-
parison operations.
Any number of ELSEIF branching can occur within
an IF...ENDIF construction – however, only one ELSE
instruction should be available. Following the ELSE
instruction is a program part that must be carried
out, in as much as none of the conditions are
fulfilled.
The E LSEIF and ELSE instructions can, but do not
have to be, contained within an IF ENDIF
construction.
Summary
Conditional single or multiple program branching.
(When the conditions are fulfilled, then ...
...
...
...
..., else ...
...
...
...
...)
Syntax
IF condition THEN command
ELSE IF condition THEN command
ELSE command
EN D I F
Parameter
condition = Branching criteria
command = one or mor program commands
NB!
After a condition has been fulfilled, the
appropriate program part will be carried out
and the program following the ENDIF instruction
continued. Further conditions will no longer be
checked.
Command group
CON
Cross Index
REPEAT ..
..
..
..
.. UNTIL, WHILE ..ENDWHILE
Syntax-Example
/* simple branch */
IF (a == 1) THEN
/* Variable a = 1, then */
command line 1
command line n
E N D I F
/* multiple branch */
IF (a == 1 AND b != 1) THEN
command lines
ELSEIF (a == 2 AND b != 1) THEN
command lines
ELSEIF (a == 3) THEN
command lines
ELSE
command lines
E N DI F
Program sample
I F_01.M; E RROR_01.M, EXIT_01.M , HOME_01.M,
I N_01.M, …