flex_set_home_polarity |
Set Home Input Polarity
Usage
status = flex_set_home_polarity(u8 boardID, u16 homePolarityMap);
Purpose
Sets the polarity of the home 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) |
homePolarityMap | u16 | bitmap of active polarities for the home inputs |
Parameter Discussion
homePolarityMap is the bitmap of active polarities for the home inputs:
D15 | ... | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
Home 15 | ... | Home 10 | Home 9 | Home 8 | Home 7 | Home 6 | Home 5 | Home 4 | Home 3 | Home 2 | Home 1 | 0 |
For D1 through D15:
1 = Active low/Active open (default)
0 = Active high/Active closed
Using This Function
This function defines the active state for each home 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 home inputs to cause halt stops when the input becomes active with the Enable Home Inputs function. You also can use a home input as a general-purpose input and read its status with the Read Home Input Status function.
To find the home input reference on a system, use Find Reference and configure the search type as "home".
Example
To set the polarity of the home inputs on axes 1, 3, and 4 as active low and the home inputs on the rest of the axes as active high, call the Set Home Input Polarity function with homePolarityMap = 0x001A, which corresponds to the following bitmap:
D15 | ... | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
Home 15 | ... | Home 10 | Home 9 | Home 8 | Home 7 | Home 6 | Home 5 | Home 4 | Home 3 | Home 2 | Home 1 | 0 |
0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 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 home polarity on axes 16 through 30, call the Write Motion I/O Data function on each axis individually.