flex_read_breakpoint_status_rtn |
Read Breakpoint Status Return
Usage
status = flex_read_breakpoint_status_rtn(u8 boardID, u8 axisOrEncoder, u16 breakpointType, u16* breakpointStatus);
Purpose
Reads the breakpoint status for all axes or encoders.
Note You cannot use this function to read the status of buffered breakpoints. Use Check Buffer to get the status of the buffer. |
Parameters
Name | Type | Description |
---|---|---|
boardID | u8 | assigned by Measurement & Automation Explorer (MAX) |
axisOrEncoder | u8 | axis control or encoder control selector |
breakpointType | u16 | reserved (must be 0) |
breakpointStatus | u16* | bitmap of breakpoint status |
Parameter Discussion
axisOrEncoder is the axis control or encoder control selector. For multi-axis status, use NIMC_AXIS_CTRL. For multi-encoder status, use NIMC_ENCODER_CTRL. Refer to Axes and Encoders for axis and encoder resource IDs.
breakpointType is a reserved input that must be set to NIMC_POSITION_BREAKPOINT (0).
breakpointStatus is the bitmap of breakpoint status for all axes or all encoders.
Note The breakpoint status does not reflect the voltage level of the breakpoint output. |
When reading breakpoint status for axes (axisOrEncoder = NIMC_AXIS_CTRL):
D15 | ... | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
XXX | ... | XXX | XXX | Axis 8 | Axis 7 | Axis 6 | Axis 5 | Axis 4 | Axis 3 | Axis 2 | Axis 1 | XXX |
For D1 through D8:
1 = Breakpoint occurred
0 = Breakpoint pending or disabled
When reading breakpoint status for encoders (axisOrEncoder = NIMC_ENCODER_CTRL):
D15 | ... | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
XXX | ... | XXX | XXX | Enc 8 | Enc 7 | Enc 6 | Enc 5 | Enc 4 | Enc 3 | Enc 2 | Enc 1 | XXX |
For D1 through D8:
1 = Breakpoint occurred
0 = Breakpoint pending or never enabled
Using This Function
This function allows you to see if a breakpoint has occurred or is pending. When you enable a breakpoint, the corresponding status bit is reset to indicate that the breakpoint is pending. When the breakpoint position is reached, its status bit is set to True (1).
Note Read Breakpoints Status returns the breakpoint status for either all axes or all encoders, based on which value is passed into axisOrEncoder. |
Example
Executing the Read Breakpoint Status function with axisOrEncoder = NIMC_ENCODER_CTRL and breakpointType = 0 returns breakpointStatus = 0x0012, which corresponds to the following bitmap:
D15 | ... | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
XXX | ... | XXX | XXX | Enc 8 | Enc 7 | Enc 6 | Enc 5 | Enc 4 | Enc 3 | Enc 2 | Enc 1 | XXX |
0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 |
On encoders 1 and 4, breakpoints have occurred, but on encoders 2 and 3, breakpoints are pending or were never enabled.