User`s manual
7-14 Motion Mate™ DSM314 for Series 90™-30 PLCs User's Manual
–
January 2001 GFK-1742A
7
SUBROUTINE
The SUBROUTINE statement is the first statement in a motion subroutine. The subroutine
statement identifies the subroutine number (1-40) and the axis configuration. Subroutine
definitions cannot nest.
There are two types of motion subroutines, single-axis in which all commands are directed to the
same axis, and multi-axis, which may contain commands for axis 1 and axis 2. The subroutine
type is specified by the SUBROUTINE statement. A single-axis subroutine is identified by the
word SINGLE-AXIS following the subroutine number. A multi-axis subroutine is identified by
the word MULTI-AXIS following the subroutine number.
The subroutine axis configuration is used to enforce whether or not the axis parameter must be
supplied in the subroutine’s motion commands. It also restricts multi-axis subroutines to calling
multi-axis subroutines, and single-axis subroutines to calling single-axis subroutines. A single-
axis subroutine uses the axis number specified in the calling program.
Syntax:
SUBROUTINE <subroutine number> <axis configuration>
Parameter Description
<subroutine number> The subroutine number must be a decimal value in the range of 1 – 40.
Within a source file, each subroutine defined must have a unique
number.
<axis configuration> The axis configuration must have a value of MULTI-AXIS or SINGLE-
AXIS.
Aliases:
SUB