flex_wait_for_move_complete

NI-Motion Functions

flex_wait_for_move_complete

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

Wait for Move Complete

Usage

status = flex_wait_for_move_complete(u8 boardID, u8 axisOrVectorSpace, u16 axisOrVSMap, u32 timeout, i32 pollInterval, u16* moveComplete);

Purpose

Waits up to the specified period of time for a move to complete on an axis, vector space, group of axes, or group of 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 check
timeout u32 timeout in milliseconds
pollInterval i32 polling interval in milliseconds
moveComplete u16* the move complete status

Parameter Discussion

axisOrVectorSpace can select an axis (NIMC_AXIS1 through NIMC_AXIS15), vector space (NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15), multiple axes (NIMC_AXIS_CTRL), or multiple vector spaces (NIMC_VECTOR_SPACE_CTRL). When simultaneously waiting for a move to complete on multiple axes or vector spaces, the axisOrVSMap parameter indicates which axes or vector spaces to wait for. On motion controllers that support fewer than fifteen axes, waiting for 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 wait for. It is only required when multiple axes or vector spaces are selected with the axisOrVectorSpace parameter. Otherwise, this parameter is ignored. NI-Motion ignores additional axes and vector spaces if you select non-existent axes.

When waiting for multiple 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 = Move must be complete on specified axis
   0 = Move can be either complete or not complete on specified axis (do not care)

When waiting for multiple 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 = Move must be complete on specified vector space
   0 = Move can be either complete or not complete on specified vector space (do not care)

To wait for move complete on a single axis or vector space, set the axisOrVectorSpace selector to the specified axis or vector space. The axisOrVSMap parameter is ignored.

To wait for move complete on multiple axes, the axisOrVectorSpace selector is set to NIMC_AXIS_CTRL and the axisOrVSMap bitmap defines the axes to wait for. They must all be move complete, for the moveComplete output to be true. Similarly, to wait for move complete on multiple vector spaces, the axisOrVectorSpace selector is set to NIMC_VECTOR_SPACE_CTRL and the axisOrVSMap bitmap defines the vector spaces to wait for.

timeout is the amount of time, in milliseconds, to wait for the move to become complete.

pollInterval is the amount of time, in milliseconds, to wait between successive queries to the controller to determine if the move is complete.

moveComplete indicates if the move is complete on the axes or vector spaces specified:
   1 = Move complete
   0 = Move not complete

Using This Function

This utility function is built on top of the Check Move Complete Status function, and is provided for your programming convenience. This function compares the axes or vector spaces specified in the axisOrVectorSpace and/or axisOrVSMap input parameters with the move complete status for the appropriate axes or vector spaces. It does this repeatedly, with the pollInterval time determining the frequency that the controller is queried. When the move is complete, this function returns with the moveComplete parameter set to true (1), otherwise it waits for the amount of time specified by the timeout parameter. If the function waits longer than timeout it returns NIMC_eventTimeoutError, and moveComplete is set to false (0).

The output is a single true/false value indicating if the specified move or moves are complete.

This function does not check for following error status or axis off status. Checking for faults during moves is recommended. To do this, use Read per Axis Status, which returns following error and axis off status in addition to the move complete status. Refer to the NI-Motion Help for more information and example code.

Refer to the Read Trajectory Status and Configure Move Complete Criteria functions for more information about move complete status.

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:

To wait for move complete on axes sixteen through thirty, use the Read per Axis Status function.