flex_set_limit_input_polarity

NI-Motion Functions

flex_set_limit_input_polarity

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

Set Limit Input Polarity

Usage

status = flex_set_limit_input_polarity(u8 boardID, u16 forwardPolarityMap, u16 reversePolarityMap);

Purpose

Sets the polarity of the forward and reverse limit inputs as either active low/active open or active high/active closed.

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)
forwardPolarityMap u16 bitmap of active polarities for the forward limits
reversePolarityMap u16 bitmap of active polarities for the reverse limits

Parameter Discussion

forwardPolarityMap is the bitmap of active polarities for the forward limit inputs:

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 D8:
   1 = Active low/Active open (default)
   0 = Active high/Active closed

reversePolarityMap is the bitmap of active polarities for the reverse limit inputs:

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 D8:
   1 = Active low/Active open (default)
   0 = Active high/Active closed

Using This Function

This function defines the active state for each forward and reverse limit input as either active low/active open or active high/active closed.

When configured as active low, the input is active when there is a low signal on the input pin. Conversely, active high means that the input is active when there is a high signal on the input pin.

Configuring an active state of active open or active closed does not correspond to the level of the signal on the input pin. Instead, an active open state means that the input is active when current is not flowing through the optocoupled input. Conversely, an active closed state means that the input is active when current is flowing through the optocoupled input.

You can enable limit inputs to cause halt stops when the input becomes active with the Enable Limits function. You also can use a limit input as a general-purpose input and read its status with the Read Axis Limit Status function.

Example

To set the polarity of the forward and reverse limit inputs on axes 1, 2, and 3 as active low and the forward and reverse limit inputs on the remaining axes as active high, call the Set Limit Input Polarity function with the following parameters:

forwardPolarityMap = 0x0E, which corresponds to the following bitmap:

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
0 ... 0 0 0 0 0 0 0 1 1 1 0

reversePolarityMap = 0x0E, which corresponds to the following bitmap:

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
0 ... 0 0 0 0 0 0 0 1 1 1 0

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 set the polarity of the forward and reverse limits on axes sixteen through thirty, call the Write Motion I/O Data function on each axis individually.