Error Message Stack

NI-Motion VI

Error Message Stack

Modal errors generate an error message containing the command ID, resource ID, and error code that is pushed on the Error Message Stack on the NI motion controller and flagged in the Error Message (Err Msg) bit of the Communications Status Register (CSR). You can return a modal error message to the host by executing the Read Error Message VI.

For your convenience, the Motion Error Handler VI checks the CSR for errors, and if an error is present on the stack, reads the error message from the controller.

The Error Message Stack is organized as a last-in-first-out (LIFO) buffer so that the most recent error is available immediately. Older errors can be read with additional calls to the Motion Error Handler VI and are returned in the inverse order to which they were generated. When the stack is empty, the Error Message (Err Msg) bit in the CSR is reset.

The Error Stack can hold up to 10 errors. When the stack is full, which is an unlikely event, additional error messages are thrown away.