Read Limit Status

NI-Motion VI

Read Limit Status

Reads the instantaneous state of either the hardware limit inputs or the software limits.

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
Limit Type (Limit Inputs) selects the type of limit status to read, either the hardware limit switch inputs or the software position limits, as follows.

Value Definition
0 Limit inputs
1 Software limits
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
Ret Vect contains the reverse limits and forward limits, which are returned in one onboard variable: 0000 000F FFFF FFF0 0000 000R RRRR RRR0.

Available return vectors include return data to the host (0xFF), return data to a variable (0x01 through 0x78), return data to an indirect variable (0x81 through 0xF8), and do not return data (0). Refer to Input and Return Vectors for more detailed information.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Reverse Limits is the bitmap of reverse limit status (either hardware or software):
Axis 1—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 2—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 3—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 4—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 5—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 6—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 7—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Axis 8—If true, reverse limit is True (On). If false, reverse limit is false (Off).
Forward Limits is the bitmap of forward limit status (either hardware or software):
Axis 1—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 2—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 3—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 4—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 5—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 6—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 7—If true, forward limit is True (On). If false, forward limit is false (Off).
Axis 8—If true, forward limit is True (On). If false, forward limit is false (Off).

Using This VI

The Read Limit Status VI returns either the hardware limit input status or the software position limit status, depending on the limit type selected. When Limit Type = Limit Inputs (0), this VI returns the logical state of the forward and reverse limit inputs.

Note  This VI returns undefined values for axes that are currently performing find reference moves.
Note  The polarity of the limit inputs determines whether an On state is active high or active low. Refer to the Set Limit Input Polarity VI for more information.

Alternatively, when Limit Type = Software Limits (1), this VI returns the state of the forward and reverse software limits. A True (On) indicates that the forward or reverse limit position for the corresponding axis has been reached or exceeded. The limit status during a Find Reference move is undefined.

You can read the status of the limit inputs and the software position limits at any time, whether the limits are enabled or not. Enabled limits cause axes to stop when their state transitions True. Refer to the Enable Limits VI for more information.

Note  If you are doing onboard programming and are using Retn Vect to write data, this VI writes the variables starting at the memory address pointed to by Retn Vect in the following order: Forward Limits, Reverse Limits.