Chapter 14 Onboard Programs
NI-Motion User Manual 14-8 ni.com
Running, Stopping, and Pausing Onboard Programs
Use the Run Program, Stop Program, and Pause/Resume Program
functions to run, stop, and pause an onboard program that resides in the
onboard memory of a motion controller.

Running an Onboard Program

Run Program executes previously stored programs from RAM or FLASH.
Typically, you must call the Run Program function from the host, because
it is not possible for an onboard program to run itself. However, it is
possible to configure the motion controller to automatically run an onboard
program upon powering up the motion control system. You also can call an
onboard program from another onboard program using the Run Program
function.
Note Recursively calling an onboard program generates an error.

Stopping an Onboard Program

Stop Program ends the execution of an onboard program that is currently
running.
Stopping an onboard program using the Stop Program function completely
ends execution. It is not possible to resume execution of the stopped
onboard program, but you can re-run the program from the beginning.
You can stop an onboard program with a Stop Program function call from
the host or from another onboard program.
Note It is not possible for an onboard program to stop itself.
Tip Stopping an onboard program is different from stopping the motion of the axis or
axes. When you stop an onboard program, any moves that have started continue to run. You
must separately call the Stop Motion function to stop the motion of the axis or axes.

Pausing/Resuming an Onboard Program

The Pause/Resume Program function suspends execution of a running
onboard program, or resumes execution of a previously paused onboard
program.
You can pause an onboard program with a function call from the host, from
the onboard program itself, or from another running onboard program.