Programmable SyncPos motion controller
MG.10.J8.02 – VLT is a registered Danfoss trade mark
114
Software Reference
■■
■■
■ GOSUB
The GOSUB command will call up a subroutine,
and the accompanying program will be carried out.
The main program will be continued following the
completion of the last subroutine command
(RETURN).
Summary
calls a subroutine
Syntax
GOSUB name
Parameter
name = subroutine name
NB!
The subroutine must be defined at the
beginning or end of a program within the
SUBMAINPROG area.
Command group
CON
Cross Index
SUBMAINPROG…ENDPROG, SUBPROG…RETURN
ON ERROR GOSUB, ON INT n GOSUB
Syntax-Example
GOSUB testup /* Call-up the subroutine testup */
Command line 1
Command line n
SUBMAINPROG
/* Subroutine testup must be defined */
SUBPROG testup
Command line 1
Command line n
RETURN
ENDPROG
Program sample
GOSUB_01.M
AXEN D_01.M , I NC L_01.M, STAT_01.M
■■
■■
■ GOTO
The GOTO command enables an unconditional
jump to the indicated program position and the
program processing at this position will be carried
out.
The jumped-to position is identified with a label. A
label can consist of one or more characters and
may not be identical to a variable name or a com-
mand word. A label must also be unique, i.e. it
may not be used for different program positions.
It is therefore possible to program a continuous
loop via the GOTO command.
Summary
Jump to a program label
Syntax
GOTO label
Parameter
label = identification of program target position
NB!
The label for the program target position must
be followed by a colon (:).
Command group
CON
Cross Index
LOOP
Syntax-Example
endless: /* Label to be jumped to */
Command line 1
Command line n
GOTO endless
/* jump command to label endless */
Program sample
GOTO_01.M
EXIT_01.M, IF_01.M