
User Manual
Chapter 7
GFK-1742F
Jan 2020
Programmed Motion
171
Chapter 7:
Programmed Motion
A motion program consists of a group of user-programmed motion command statements
that are stored to and executed in the DSM314. The DSM314 executes motion program
commands sequentially in a block-by-block fashion once a program is selected to run.
The motion program is executed autonomously from the host controller, although the host
controller starts the DSM314 motion program and can interface with it (with parameters
and certain commands) during execution. In addition, external inputs (CTL bits) connected
directly to the DSM314 faceplate or controlled by Local Logic can be used in motion
programs to delay or alter program execution flow. The host controller receives status
information (such as position, velocity, and Command Block Number) from the DSM314
during program execution. Motion programs 1
—
10 and subroutines 1
—
40 are created using
the host controller programming software and are stored along with the module’s
configuration settings to the DSM314 via the host controller backplane.
For further information, please refer to the online help for your software, or the software
user manual, PAC Machine Edition Logic Developer-PLC Getting Started, GFK-1918.
7.1
Single-Axis Motion Programs and Subroutines
A single-axis program contains program statements for one axis only. The programmed axis
is specified in the first line of the program, for example: PROGRAM 1 AXIS1. The DSM314
may operate up to four single-axis programs. These programs may run independently or
simultaneously. For example, motion Program 1 may be written for Axis 1 and motion
Program 2 written for Axis 2. Each axis may be home referenced and the motion program
for each axis may execute independently without regard to the state of the other axis.
Alternately, Program 1 and Program 2 may start simultaneously (via the run program %Q
bits) during the same CPU sweep.
DSM314 motion programs support the subroutine feature, which may include all the
available motion program commands including the CALL command. The SYNC Block
command is reserved for multi-axis (Axis 1 and 2) programs and subroutines. Subroutines
can be nested, using CALL statements, to a maximum of eight levels. Single-axis
subroutines, similar to motion programs, contain commands for only one axis. The
difference is that the axis number is not specified in a single-axis subroutine. A single-axis
motion program may CALL any single-axis subroutine stored in module memory. For
example, single-axis motion Program 1, operating Axis 1, may include a CALL statement to
single-axis Subroutine 1. Additionally, single-axis motion Program 2, operating Axis 2, may
include a CALL statement to single-axis Subroutine 1. Single-axis motion programs cannot
CALL multi-axis subroutines.
The motion program and subroutine structure allow flexibility in execution and axis control
in the DSM314 module. The practical limitation is that each axis may only execute one
program at a time. For example, if Program 1 is enabled to run in Axis 1, it must either
complete or abort prior to enabling Program 2 to run in Axis 1.