
MCO 305 Design Guide
__ Software Reference __
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
135
ON MCPOS .. GOSUB
Summary
Call up a subprogram when the master position xxx (MU) is passed.
Syntax
ON sign MCPOS xxx GOSUB name
Parameter
sign =
+ = when the master position xxx is passed in positive direction
– = when the master position xxx is passed in negative direction
xxx =
Master Position in MU
name =
name of the subprogram
100
xxx
0
<
positive direction
!
negative direction
Description
It is possible to call up a subprogram with the instruction ON MCPOS which is
typical for CAM controls if a specific master position (MU) has been passed in
positive or negative direction. This allows not only the realization of CAM boxes,
but also the execution of tasks that are much more complex. For example, one
could change parameters online depending on the position.
NB!:
–
A DEFMCPOS or a SETCURVE must always be placed in front of the command
ON MCPOS .. GOSUB, since otherwise the curve position is not known.
–
An ON MCPOS Interrupt can be deleted with the command ON DELETE ..
GOSUB ...
–
The subroutine to be called up must be defined within the SUBMAINPROG and
ENDPROG identified program.
–
During the execution of a subroutine called by an interrupt NOWAIT is
automatically set to ON.
Command Group
INT
Cross Index
SUBPROG .. RETURN, DISABLE …, ENABLE …, Priorities of Interrupts, ON DELETE ..
GOSUB, NOWAIT
Syntax Example
ON +MCPOS 1200 GOSUB parameter
// Always call up subprogram at position 1200
Syntax Example
Cardboard boxes are transported irregularly on a conveyor belt. By setting an
output, the slave will always be started when the position xxx is reached.
ON +MCPOS 4500 GOSUB output
// call subprogram output always on position 4500
SUBMAINPROG
// set subprogram output
SUBPROG
output
OUT 3 1
// 03 on
RETURN
ENDPROG
Summary of Contents for MCO 305
Page 4: ......