flex_check_reference

NI-Motion Functions

flex_check_reference

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

Check Reference

Usage

status = flex_check_reference(u8 boardID, u8 axisOrVectorSpace, u16 axisOrVSMap, u16* found, u16* finding);

Purpose

Checks the status of a search sequence initiated by Find Reference.

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
found u16* returns true if the reference is found
finding u16* returns true if the reference find is ongoing

Parameter Discussion

axisOrVectorSpace selects 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 checking multiple axes or vector spaces, the axisOrVSMap parameter indicates which axes or vector spaces to check. 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 check. 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 wait on a single axis or vector space, set axisOrVectorSpace to the specified axis or vector space. The axisOrVSMap bitmap is ignored.

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

Note  It is not possible to combine a Check Reference on an axis and a vector space in a single use of this function. To accomplish this, create a single axis vector space and then execute a multicoordinate space Check Reference.

found is a returned Boolean value that indicates the success of the search or searches the function is waiting for. It does not matter if different searches are being executed on different axes. When all searches are complete on all the axes or vector spaces specified, found is true if all of the searches were successful. If any search did not complete successfully, found is false.

finding is a returned Boolean value that indicates the status of the search. finding returns true if the find reference is actively searching for the reference, and false if the find reference has stopped.

Using This Function

This function indicates if the reference on the indicated axes is found. There is no need to specify what type of find to wait for because the controller knows what searches are being done on what axes. This function waits for and reports on the success of the current or last executed find on an axis, vector space, or a given set of axes or vector spaces as a whole.

If a Find Reference is executed with the Run Sequence option the Check Reference function does not require an axisOrVectorSpace or axisOrVSMap. When waiting on a Run Sequence, the Check Reference function returns the status of the entire sequence. The found Boolean returns True only if and when all of the operations in the sequence are successful.

Wait until the finding parameter is false before checking the status of the found parameter. The status of the found parameter is undefined when finding is true. The Wait Reference function does this for you, but you cannot execute any other functions while Wait Reference is running.

Example

You initiated a Find Home on Axis 1, and Find Center on Axis 2 and Axis 3, and you want to check if all axes have found their reference. Simply call Check Reference with the following parameters:

axisOrVectorSpace: Axis Control (NIMC_AXIS_CTRL)

axisOrVSMap: 00001110 (axis 1, 2, & 3 enabled)

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 list 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.