Danfoss VLT5000 SyncPos Operating Instructions Manual page 148

Motion controller for danfoss vlt5000 series; danfoss vlt 5000flux series
Table of Contents

Advertisement

■ ■ ■ ■ ■ SUBPROG name .. RETURN
The instruction SUBPROG identifies the beginning of
a subroutine. The name of the subroutine must
directly follow SUBPROG code word. The name can
be made up of one or more characters, and must be
unique, i.e. only one subroutine may have that name.
A subroutine can be called up and executed at any
time by use of the GOSUB instruction.
A subroutine can have any number of command
lines and can refer to all program variables. The
last command in each subroutine must be the
RETURN instruction, which permits exiting the sub-
routine and continuing the program with the
command following the GOSUB instruction.
Summary
Subroutine definition
Syntax
SUBPROG name
RETURN
Parameter
name = subroutine name
NB!
All subroutines must be contained within the
SUBMAINPROG and ENDPROG defined
areas. It is not admissible to declare a second sub-
routine within an existing subroutine.
Command group
CON
Cross Index
SUBMAINPROG ... ENDPROG,
GOSUB, ON ERROR GOSUB, ON INT n GOSUB
Syntax-Example
SUB MAI NPROG
/* begin SP-section * /
SUBPROG sp1
/* begin sp1
command line 1
command line n
R ETU R N
/* end sp1
ENDPRO G
/* end SP-section
Program sample
GOSUB_01.M, AXEND_01.M, ER ROR_01.M,
IF_01.M, STAT_01.M
MG.10.J8.02 – VLT is a registered Danfoss trade mark
Programmable SyncPos motion controller
■ ■ ■ ■ ■ SWAPMENC
This command allows swapping of the master and
slave encoders. This is particularly meaningful if one
wishes to alternately use two motors with one
control.
Prior to the command SWAPMENC ON/OFF, a
MOTOR OFF must always be executed in order to
avoid a tolerated position error exceeded. Also, the
controller parameters or axis parameters must be
changed if both motors are different.
The motor leads could be switched via relay.
Summary
Swap master and slave encoder internally.
Syntax
SWAPMENC s
Parameter
s = condition
ON = master encoder input is feedback input
OFF = slave encoder input is feedback input
NB!
In this changeover, no positions are lost, even if
the motors are moved by hand while the other
motor is controlled. It is possible to always access the
uncontrolled motor through MAPOS as well.
Command group
I N I
Cross Index
MAPOS
Syntax Example
SWAPMENC ON // Swap slave encoder internally
Sample
* /
MOTOR OFF
OUT 1 1
SET KPROP ...
* /
SWAPMENC ON
* /
MOTOR ON
POSA 10000
MOTOR OFF
OUT 1 0
SET KPROP ...
SWAPMENC OFF // Swapencoder
MOTOR ON
POSA 0
// with master encoder
// Switch motor leads
// Change axis parameters
// Swap encoder internally
// Turn on control again
// Move the motor which is
// connected to master encoder
// Switch motor leads
// Change axis parameters
// Turn on control again
// Move the motor again which is
// connected to the slave encoder
147

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VLT5000 SyncPos and is the answer not in the manual?

Questions and answers

Table of Contents