Running, Stopping, and Pausing Onboard Programs

NI-Motion

Running, Stopping, and Pausing Onboard Programs

Note  This section applies only to NI 73xx motion controllers.

Use Run Program, Stop Program, and Pause/Resume Program to run, stop, and pause an onboard program that resides in the onboard memory of a motion controller.

Note  Recursively calling an onboard program generates an error.

Running an Onboard Program

The Run Program VI or function executes previously stored programs from RAM or FLASH. Typically, you must call Run Program 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 Run Program.

Stopping an Onboard Program

The Stop Program VI or function ends the execution of an onboard program that is currently running.

Stopping an onboard program using Stop Program 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 VI or function call from the host or from another onboard program.

Note 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 VI or function to stop the motion of the axis or axes.

Pausing/Resuming an Onboard Program

The Pause/Resume Program VI or 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. You can resume an onboard program with a function call from the host or from another running onboard program.

Note  It is not possible for an onboard program to resume itself.
Tip  Similar to the Stop Program VI or function, Pause/Resume Program has no effect on moves that have started.

Automatic Pausing

Any run-time error that occurs during execution automatically pauses the onboard program.

An onboard program also pauses automatically when it executes the Start Motion VI or function or the Blend Motion VI or function on an axis that has been stopped by the host, or when an axis is stopped due to a limit, home, software limit, or following error condition.

Single-Stepping Using Pause

You can use the Pause/Resume Program VI or function to effectively single-step through an onboard program. To single-step, add a Pause/Resume Program call after each function, and then resume the onboard program from the host.