flex_read_reference_status

NI-Motion Functions

flex_read_reference_status

Device Compatibility

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

Read Reference Status

Usage

status = flex_read_reference_status(u8 boardID, u8 axisOrVectorSpace, u16 axisOrVSMap, u16 attribute, u8 returnVector);

Purpose

Reads the currently selected reference status for the given set of axes or coordinate (vector) space.

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
attribute u16 type of reference to read
returnVector u8 destination for the return data

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 reading 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, reading 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 read. 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.

attribute is the type of reference on which to read the status.

You can choose the following attributes:

Attribute Number Description
NIMC_HOME_FOUND 0x0 returns True if the last Find Home executed successfully
NIMC_INDEX_FOUND 0x1 returns True if the last Find Index executed successfully
NIMC_CENTER_FOUND 0x2 returns True if the last Find Center executed successfully
NIMC_FORWARD_LIMIT_FOUND 0x3 returns True if the last Find Forward Limit executed successfully
NIMC_REVERSE_LIMIT_FOUND 0x4 returns True if the last Find Reverse Limit executed successfully
NIMC_REFERENCE_FOUND 0x5 returns True is the last Find Reference executed successfully
NIMC_CURRENT_SEQUENCE_PHASE 0x6 returns the current phase of a sequence that is currently executing
NIMC_FINDING_REFERENCE 0x7 returns True if a Find Reference is currently executing

returnVector indicates the desired destination for the return data generated by this function. Available return vectors include return data to the host (0xFF), to a variable (0x01 through 0x78), to an indirect variable (0x81 through 0xF8), and do not return data (0). Refer to Input and Return Vectors for more detailed information.

Note  The suffix _rtn on the function indicates that the data must be returned to the host. When this calling convention is used, no returnVector is required.

Using This Function

This function reads the currently selected reference status for the given set of axes or coordinate (vector) space.

If multiple axes in a coordinate space are selected using the axis bitmap, all axes must have successfully found their last reference for NIMC_HOME_FOUND, NIMC_INDEX_FOUND, NIMC_CENTER_FOUND, NIMC_FORWARD_LIMIT_FOUND, NIMC_REVERSE_LIMIT_FOUND, and NIMC_REFERENCE_FOUND to be true.

If any of the selected axes are currently executing a Find Reference, NIMC_FINDING_REFERENCE is true. Wait until NIMC_FINDING_REFERENCE is false before checking the status of any other attribute. The status of the NIMC_HOME_FOUND, NIMC_INDEX_FOUND, NIMC_CENTER_FOUND, NIMC_FORWARD_LIMIT_FOUND, NIMC_REVERSE_LIMIT_FOUND, and NIMC_REFERENCE_FOUND attributes are undefined when NIMC_FINDING_REFERENCE is true. The Wait Reference function does this for you, but you cannot execute any other functions while Wait Reference is running.