flex_enable_auto_start

NI-Motion Functions

flex_enable_auto_start

Device Compatibility

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

Enable Auto Start

Usage

status = flex_enable_auto_start(u8 boardID, u8 enableOrDisable, u8 programToExecute);

Purpose

Allows you to automatically run a program when the controller powers up.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
enableOrDisable u8 enable or disable auto start
programToExecute u8 program number to execute

Parameter Discussion

enableOrDisable enables or disables the auto start feature. Set this to NIMC_TRUE (1) to enable auto start and NIMC_FALSE (0) to disable auto start.

programToExecute is the onboard program the controller executed if the auto start feature is enabled. This must be a valid program number (1—255), that is stored to FLASH using the Object Memory Management function.

Using This Function

This function configures the controller to automatically start an onboard program on power up. After auto start is enabled, the controller automatically executes the onboard program specified when the controller is powered on. The onboard program to be executed must be saved to FLASH using the Object Memory Management function before the controller is powered down. If the controller does not find a valid program that it can load, NIMC_autoStartFailedError is generated. If the onboard program is removed from FLASH memory, the auto start functionality is disabled.

Note  This function writes to onboard FLASH memory and hence it is not safe to execute when motors are in motion. Doing so generates a NIMC_wrongModeError.

This function may take longer than 62 ms to process, so it is not guaranteed to be compatible with real-time execution.