Function Return Status

NI-Motion Functions

Function Return Status

Every NI-Motion function is of the following form:

status = function_name (parameter 1, parameter 2, … parameter n)

Each function returns a value in the status variable that indicates the success or failure of the function. A returned status of NIMC_noError (0) indicates that the function was sent to the NI motion controller successfully. A non-zero status indicates that the function was not executed because of an error. Refer to Error Codes for a complete description of errors and possible causes.

In addition to errors returned in the status variable, modal errors can occur when the controller executes the function. These modal errors have to be explicitly read from the Error Stack on the NI motion controller. Refer to Errors and Error Handling for more information about modal errors and the Error Stack.

For C/C++ users, the header file, flexmotn.h provides the NI-Motion function prototypes. All the functions in flexmotn.h have FLEXFUNC as the return status. FLEXFUNC defines the return data type status. In Windows, FLEXFUNC also defines the calling convention of the NI-Motion dynamic link library.

FLEXFUNC defines the return status of the NI-Motion functions to be i32. In addition, FLEXFUNC defines the calling convention as standard (__stdcall), which is the same as that used to call Win32 API functions.

For Visual Basic users, flexmotn.bas provides the NI-Motion function prototypes. All NI-Motion functions in Visual Basic return an i32.