Automatic pausing, Single-stepping using pause, Conditionally executing onboard programs – National Instruments NI-Motion User Manual

Page 217: Conditionally executing onboard programs -9

Advertising
background image

Chapter 14

Onboard Programs

© National Instruments Corporation

14-9

NI-Motion User Manual

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

Similarly to the Stop Program 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
function or the Blend Motion 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 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.

Conditionally Executing Onboard Programs

You can set conditions that affect the execution of the onboard programs.
For example, you may want the onboard program to wait until a specific
event occurs, and then continue executing.

The Wait on Condition function allows you to create onboard programs that
wait for events, such as move complete and blend complete. These onboard
programs can send functions to start moves and wait for moves to complete.
The onboard program uses almost no processor time while waiting for an
event such as move complete. When the move is complete, the trajectory
generator enables the I/O reaction task, which causes the onboard program
to continue executing the next function in its sequence, as shown in
Figure 14-5.

Advertising