flex_initialize_controller

NI-Motion Functions

flex_initialize_controller

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
Y
NI SoftMotion Controller for CANopen—Accelnet
Y

Initialize Controller

Usage

status = flex_initialize_controller(u8 boardID, i8* settingsName);

Purpose

Initializes the specified controller according to the settings as configured in Measurement & Automation Explorer.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
settingsName [i8] name of configuration settings

Parameter Discussion

settingsName is the name of the configuration settings, such as Default 7330 Settings, as specified in MAX. To use the current configuration settings, pass in NULL for the settingsName parameter. settingsName must be a null terminated string.

Using This Function

This function allows you to initialize the controller to a known state based on the configuration settings stored in the MAX database. This function pulls values from the configuration database and calls dozens of NI-Motion functions, configuring the controller for you in one simple step.

If the Initialize Controller function returns an error, you can call the Get Last Error function to determine the specific NI-Motion function and resource generating 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.

Note  If you are running a NI-Motion startup application on ETS (PharLap) systems, the first function in your application must be either the Clear Power Up Status or Initialize Controller function. Calling any other function first may result in error –70012 (NIMC_badBoardIDError) because the driver may not have loaded before a NI-Motion function is called.
Note  Refer to Function Execution Times for benchmark timing information about your controller.