flex_start

NI-Motion Functions

flex_start

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

Start Motion

Usage

status = flex_start(u8 boardID, u8 axisOrVectorSpace, u16 axisOrVSMap);

Purpose

Starts motion on a single axis, single vector space, multiple axes, or multiple vector spaces.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrVectorSpace u8 axis or vector space selector
axisOrVSMap u16 bitmap of axes or vector spaces to start

Parameter Discussion

axisOrVectorSpace can select an axis (NIMC_AXIS1 through NIMC_AXIS30), vector space (NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15), multiple axes (NIMC_AXIS_CTRL), or multiple vector spaces (NIMC_VECTOR_SPACE_CTRL). When simultaneously starting multiple axes or vector spaces, the axisOrVSMap parameter indicates which axes or vector spaces are involved. On motion controllers that support fewer than thirty axes, configuring non-existent axes or vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Vector Spaces for axis and vector space resource IDs.

axisOrVSMap is the bitmap of axes or vector spaces to start. It is only required when multiple axes or vector spaces are selected with the axisOrVectorSpace parameter. NI-Motion ignores additional axes and vector spaces if you select non-existent axes.

When starting axes (axisOrVectorSpace = NIMC_AXIS_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

For D1 through D15:
   1 = Start axis
   0 = Do not start axis

When starting vector spaces (axisOrVectorSpace = NIMC_VECTOR_SPACE_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
VS 15 ... VS 10 VS 9 VS 8 VS 7 VS 6 VS 5 VS 4 VS 3 VS 2 VS 1 0

For D1 through D15:
   1 = Start vector space
   0 = Do not start vector space

To start a single axis or vector space, set the axisOrVectorSpace selector to the specified axis or vector space. The axisOrVSMap bitmap is ignored.

To start multiple axes, the axisOrVectorSpace selector is set to NIMC_AXIS_CTRL and the axisOrVSMap bitmap defines the axes to start. Similarly, to start multiple vector spaces, the axisOrVectorSpace selector is set to NIMC_VECTOR_SPACE_CTRL and the axisOrVSMap bitmap defines the vector spaces to start.

Note  It is not possible to combine the start of an axis and the start of a vector space in a single use of this function. To accomplish this, create a single axis vector space and then execute a multi-vector space start.

Using This Function

This function is used to start a motion profile on axes or vector spaces, either simultaneously or individually. A start is preemptive and uses the most recently loaded values of acceleration, velocity, target position, s-curve, operation mode, and so on to generate the motion profile.

Note  If a stepper axis is in a killed state (not energized), halt the axis using the Stop Motion function, with stopType set to NIMC_HALT_STOP, before you execute a Start Motion or Blend Motion function. After you halt the axis, you might need to wait before executing a Start Motion or Blend Motion function, so that the stepper drive comes out of reset state. This is especially important for stepper axes configured for P-command mode to avoid position error between the controller and the drive. If the stepper drive does not come out of reset state before you execute the function, the stepper axis might lose some steps during acceleration. Refer to the stepper drive documentation or vendor to determine if you need to wait before executing the function.

You also can use the Start Motion function to update trajectory parameters to a move that is already in process. Trajectory parameters loaded after the start take effect immediately upon the next start without requiring the motion to come to a stop. You can use this feature for velocity profiling and other continuous motion applications. The execution of a preemptive start depends on the parameters entered, the type of move, and the controller. Refer to the following table for more information.

Move Type Controller Type Same Direction Opposite Direction
Single Axis Move 73xx Controller Move starts immediately1 Motion decelerates to a stop, then starts2
NI SoftMotion Controller Move starts immediately Motion decelerates to a stop, then starts2
Vector Space Move 73xx Controller Motion decelerates to a stop, then starts2 Motion decelerates to a stop, then starts2
NI SoftMotion Controller Move starts immediately Motion decelerates to a stop, then starts2
1 In most cases, the move starts immediately. However, if the new target position is closer to the current position than the previous target position, the move decelerates to a stop, then starts. Refer to the figures below for more information.

2 The time required to start the next move depends on the deceleration time. If the deceleration time is very slow, the next move may take longer than expected to start.

The first image demonstrates the case where Start Motion is called with a new target position on the same side of the original target position as the current position. In this case, motion decelerates to a stop, then starts again. The second image demonstrates the case where Start Motion is called with a new target position on the opposite side of the original target position as the current position. In this case, the move continues to the new target position without stopping.

Motion starts on properly configured and enabled axes. If motion on any axis involved in a start is illegal due to a limit or other error condition, the entire Start Motion function is not executed and a modal error is generated. None of the axes are started or updated.

Example 1

To execute a multi-axis start on axes 2 and 4, call the Start Motion function with the following parameters:
   axisOrVectorSpace = NIMC_AXIS_CTRL
   axisOrVSMap = 0x14

The axisOrVSMap value of 0x14 corresponds to the following bitmap:

D15 ... D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0
0 ... 0 0 0 0 0 0 1 0 1 0 0

Example 2

To start motion on vector space 2, call the Start Motion function with the following parameters:
   axisOrVectorSpace = NIMC_VECTOR_SPACE2
   axisOrVSMap = Don't care

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI SoftMotion Controller Considerations

The following includes considerations you must make when you are using this function with the NI SoftMotion Controller:

You cannot execute this function on multiple axes using the NIMC_AXIS_EX_CTRL resource parameter with axes sixteen through thirty.