flex_configure_breakpoint

NI-Motion Functions

flex_configure_breakpoint

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

Configure Breakpoint

Usage

status = flex_configure_breakpoint(u8 boardID, u8 axisOrEncoder, u16 enableMode, u16 actionOnBreakpoint, u16 operation);

Purpose

Configure a position breakpoint on an axis or encoder.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrEncoder u8 axis or encoder to control
enableMode u16 breakpoint mode
actionOnBreakpoint u16 action to perform when breakpoint is reached
operation u16 selects between single and buffered breakpoint operation

Parameter Discussion

axisOrEncoder is the axis or encoder to control. You can enable breakpoints on encoders mapped to axes NIMC_AXIS1 through NIMC_AXIS30 or directly on encoders NIMC_ENCODER1 through NIMC_ENCODER30. On motion controllers that support fewer than thirty axes, configuring non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Encoders for axis and encoder resource IDs.

enableMode is the breakpoint enable mode.

enableMode Constant enableMode Value enableMode Restrictions
NIMC_ABSOLUTE_BREAKPOINT  1
NIMC_RELATIVE_BREAKPOINT  2
NIMC_MODULO_BREAKPOINT  3 Not applicable for buffered breakpoints.
NIMC_PERIODIC_BREAKPOINT  4 Not applicable for buffered breakpoints.

actionOnBreakpoint is the action to perform when the breakpoint is reached.

actionOnBreakpoint actionOnBreakpoint Value actionOnBreakpoint Restrictions
NIMC_NO_CHANGE  0
NIMC_RESET_BREAKPOINT  1 Not applicable for buffered breakpoints.
NIMC_SET_BREAKPOINT  2 Not applicable for buffered breakpoints.
NIMC_TOGGLE_BREAKPOINT (7330/40/90 only) 3
NIMC_PULSE_BREAKPOINT (7350 only) 4

operation selects between single and buffered breakpoint operation. Valid values are NIMC_OPERATION_SINGLE (0) and NIMC_OPERATION_BUFFERED (1)

Using This Function

The Configure Breakpoint function configures the breakpoint to the specified mode, operation, and action. It also defines the action to perform when the breakpoint is reached—leave the breakpoint output unchanged, reset the breakpoint output to low, set the breakpoint output to high, or toggle the state of breakpoint output. Refer to the Synchronization section of the NI-Motion Help for more information about the types of breakpoints you can configure.

Note  For modulo breakpoints, the magnitude of the breakpoint value must be less than the breakpoint modulus. If this range is exceeded, a modal error is generated when you execute the Enable Breakpoint Output function.

The enableMode parameter determines how the previously loaded breakpoint position is interpreted. Absolute breakpoints can be anywhere in the 32-bit position range. Relative breakpoints are relative to the instantaneous encoder position when the breakpoint is enabled. Modulo breakpoints are interpreted within the range of the loaded breakpoint modulus. Refer to the Load Breakpoint Modulus function for more information about modulo breakpoints.

When an enabled breakpoint is reached, a breakpoint event occurs. You can use the Read Breakpoint Status function to see if a breakpoint has occurred.

A breakpoint event also can cause the state of the corresponding breakpoint output to change. The actionOnBreakpoint parameter indicates if the output changes to low, high, toggles state, or does not change when the breakpoint event occurs. If the breakpoint output is presently in the state defined by actionOnBreakpoint, it is forced to the opposite state when the breakpoint is enabled. This guarantees that the specified transition occurs when the breakpoint is reached.

Note  NI-Motion does not support breakpoint and high-speed capture functionality on an axis when the primary feedback for that axis is an analog feedback.

All of the following modes are available for all NI motion controllers unless otherwise specified.

Absolute

This mode is available in both single and buffered operation. The breakpoint position is interpreted with reference to the zero position (origin). This also applies to all the position data in the buffer for buffered operation.

Relative

This mode is available in both single and buffered operation. For single operation, the breakpoint position is interpreted with reference to the encoder position when the breakpoint is enabled. For buffered operation, the first position data is interpreted with reference to the encoder position when the breakpoint is enabled. The subsequent position data is interpreted relative to the previous breakpoint such that:

Breakpoint[0] = Position on enable + Buffer[0]
Breakpoint[n] = Buffer[n-1] + Buffer[n],
where n>=1.

Modulus (7330/40/90)

This mode is available only in single operation. Modulus breakpoint is used to specify multiple breakpoints with a constant distance between them. The breakpoint position is interpreted with the modulus range such that

Breakpoint[n] = Breakpoint position + (n × Breakpoint modulus),
where n is any integer.

When the breakpoint is enabled, the controller enables the two breakpoints closest to the current position, one in the forward direction, and one in the reverse. After a breakpoint occurs, you can re-enable the next breakpoint without loading a new position.

Periodic (7350)

This mode is available only in single operation. Periodic breakpoint is an enhanced version of modulus breakpoint. The period determines the distance between each breakpoint:

Breakpoint[n] = Breakpoint position + (n × Breakpoint period),
where n is any integer.

When you load a breakpoint position, it is interpreted as the first breakpoint. After this breakpoint has occurred, the breakpoint status is asserted and the subsequent breakpoint is automatically loaded and enabled by the controller.