Enable Limits

NI-Motion VI

Enable Limits

Enables/disables either the forward and reverse limit inputs or the forward and reverse software position limits.

Details     Remarks

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 to enable, 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.
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.
Forward Limits (Disabled) is the bitmap of forward limits to enable (either inputs or software):
Axis 1—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 2—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 3—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 4—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 5—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 6—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 7—If true, forward limit enabled. If false, forward limit disabled (default).
Axis 8—If true, forward limit enabled. If false, forward limit disabled (default).
Reverse Limits (Disabled) is the bitmap of reverse limits to enable (either inputs or software):
Axis 1—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 2—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 3—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 4—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 5—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 6—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 7—If true, reverse limit enabled. If false, reverse limit disabled (default).
Axis 8—If true, reverse limit enabled. If false, reverse limit disabled (default).
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.

Using This VI

The Enable Limits VI enables/disables any combination of axis limits. You can enable the physical limit inputs (hardware) or the logical position limits (software) depending upon the Limit Type selected. You can enable or disable forward and reverse limits separately. To enable both software and hardware limits on an axis or axes, call this VI twice.

The limit inputs are typically connected to end-of-travel limit switches or sensors. An enabled limit input causes a halt stop on the axis when the input becomes active. You can configure each limit input as active low or active high with the Set Limit Input Polarity VI. Active limit inputs also prohibit attempts to start motion that would cause additional travel in the direction of the limit. You also can use limit inputs as general-purpose inputs and read their status with the Read Limit Status VI.

Note  For the end-of-travel limits to function correctly, the forward limit switch or sensor must be located at the positive (count up) end of travel and the reverse limit at the negative (count down) end of travel.

Similarly, software limits are often used to restrict the range of travel further and avoid ever hitting the hardware limit switches. An enabled software limit causes the axis to smoothly decelerate to a stop when the limit position is reached or exceeded. To enable the software limits, you must first find the reference point using the Find Reference VI.

Even when disabled, you can use the host computer to poll the software limits to warn of an out-of-range position. Refer to the Load Software Limit Positions and the Read Limit Status VIs for information about loading and reading the forward and reverse software limits.

Hardware limit inputs and software position limits are enhancements on the NI motion controller and are not required for basic motion control. You can operate all motion control VIs without enabling or using these limits except the Find Reference VI, which requires enabled limit and home inputs for operation. Refer to the following VIs for more information about enabling home inputs: Set Home Input Polarity, Enable Home Inputs, and Read Home Input Status.

Example

To enable the forward and reverse software limits on axes 1 and 3, and to disable the forward and reverse software limits on the remaining axes, call the Enable Limits VI with the following parameters:

Limit Type = Software limits (1)
Forward Limits corresponds to the values shown in the following table.

Forward 1  Forward 2  Forward 3  Forward 4  Forward 5  Forward 6  Forward 7  Forward 8 
True False True False False  False False False

Reverse Limits corresponds to the following.

Reverse 1  Reverse 2  Reverse 3  Reverse 4  Reverse 5  Reverse 6 Reverse 7 Reverse 8
True False True False False  False False False

This example affects only the software limits, because the Limit Type parameter is set to Software limits (1). To affect the hardware limits, set the Limit Type parameter to Hardware limits (0) when calling Enable Limits.

Remarks

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

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this VI with a 73xx motion controller:

  • An active (and enabled) limit input transition on an axis that is part of a vector space move causes that axis to halt stop and the other axes in the vector space to decelerate to a stop.
  • If any axis in a vector space move exceeds an enabled software limit position, all axes in the vector space decelerate to a stop.

NI SoftMotion Controller Considerations

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

  • An active (and enabled) limit on an axis that is part of a vector space causes all of the axes in the vector space to halt stop.