Motion Error Handler

NI-Motion VI

Motion Error Handler

Checks for modal errors on the controller.

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
type of dialog (OK msg:1) sets the type of dialog to display.
Value  Definition
0 No message is displayed
1 Message is displayed (default)
2 Message is displayed and user can abort execution
modal error severity (warning) describes how to handle motion control modal errors.
modal error retrieval mode (all) sets how many modal errors to retrieve.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
Error is TRUE if errors exist.
message is the message displayed in the error dialog box.
modal error(s) out is an array of clusters containing modal errors found on the motion controller.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

If the modal error severity input is TRUE (error), modal errors are treated as errors. The first modal error is then passed out through the error out terminal. If this input is FALSE (warning), modal errors are treated as warnings.

When using subVIs that incorporate the error in/error out (or error I/O) structure, place this handler where you want to inform the user of an error, typically at the end of the I/O data path, as the last action of the program. If the error in status is TRUE (a red X), the handler creates a message describing the error and its source.

If the Type of Dialog input is 1 (default), the message is displayed to the user, who can only acknowledge it. If this input is 2, the user can acknowledge the message or abort execution. If the input is 0, no message is displayed; use this value to process the error programmatically.

This VI always checks for modal errors on the controller. If the Modal Error Severity input is TRUE (error), modal errors are treated as errors. The first modal error is then passed out through the error out terminal. If this input is FALSE (warning), modal errors are treated as warnings.

If the Modal Error Retrieval Mode input is TRUE (single), only one modal error is read from the controller's error stack. If this input is FALSE (all), all of the modal errors on the controller are read. Modal errors that are read from the controller are placed into the Modal Error(s) Out output array.