flex_get_last_error |
Get Last Error
Usage
status = flex_get_last_error(u8 boardID, u16* commandID, u16* resourceID, i32* errorCode);
Purpose
Gets detailed information about the last error generated by a high-level NI-Motion function in the course of executing other NI-Motion functions.
Parameters
Name | Type | Description |
---|---|---|
boardID | u8 | assigned by Measurement & Automation Explorer (MAX) |
commandID | u16* | command ID number |
resourceID | u16* | resource ID number |
errorCode | i32* | error code |
Parameter Discussion
errorCode is the error code value, as defined in the file motnErr.h in the NI-Motion include directory.
commandID is the command ID of the function that generated the error.
resourceID is the resource (e.g. axis, vector space, ADC, etc.) that generated the error.
Using This Function
If the Initialize function returns an error, you can call this function to determine the specific NI-Motion function and resource that generated the error. You can then call the Get Error Description function, which formats a string for you with the function name, resource ID and error description.