flex_read_axis_limit_status_rtn

NI-Motion Functions

flex_read_axis_limit_status_rtn

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

Read Axis Limit Status Return

Usage

status = flex_read_axis_limit_status_rtn(u8 boardID, u16 limitType, u16* forwardLimitStatus, u16* reverseLimitStatus);

Purpose

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

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)
limitType u16 hardware/software limit selector
forwardLimitStatus u16* bitmap of forward limit status
reverseLimitStatus u16* bitmap of reverse limit status

Parameter Discussion

limitType selects the type of limit status to read, either the hardware limit switch status or the software position limit status.

limitType Constant limitType Value
NIMC_LIMIT_INPUTS 0
NIMC_SOFTWARE_LIMITS    1

forwardLimitStatus is the bitmap of forward limit status (either hardware or software):

D15 ... D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Forward 15 ... Forward 10 Forward 9 Forward 8 Forward 7 Forward 6 Forward 5 Forward 4 Forward 3 Forward 2 Forward 1 0

For D1 through D15:
   1 = Forward limit True (On)
   0 = Forward limit False (Off)

reverseLimitStatus is the bitmap of reverse limit status (either hardware or software).

D15 ... D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Reverse 15 ... Reverse 10 Reverse 9 Reverse 8 Reverse 7 Reverse 6 Reverse 5 Reverse 4 Reverse 3 Reverse 2 Reverse 1 0

For D1 through D15:
   1 = Reverse limit True (On)
   0 = Reverse limit False (Off)

Using This Function

This function returns either the hardware limit input status or the software position limit status, depending on the limit type selected. When limitType = NIMC_LIMIT_INPUTS (0), this function returns the logical state of the forward and reverse limit inputs.

Note  The polarity of the limit inputs determines if an On state is active high or active low. Refer to the Set Limit Input Polarity function for more information.

Alternatively, when limitType = NIMC_SOFTWARE_LIMITS (1), this function 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 input 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, regardless of if the limits are enabled. Enabled limits cause axes to stop when their state transitions True. Refer to the Enable Axis Limits function for more information.

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:

To read the hardware and software limit status on axes sixteen through thirty, use the Read Motion I/O Data function.