flex_load_pos_bp |
Load Breakpoint Position
Usage
status = flex_load_pos_bp(u8 boardID, u8 axisOrEncoder, i32 breakpointPosition, u8 inputVector);
Purpose
Loads the breakpoint position for an axis or encoder in counts.
Parameters
Name | Type | Description |
---|---|---|
boardID | u8 | assigned by Measurement & Automation Explorer (MAX) |
axisOrEncoder | u8 | axis or encoder to control |
breakpointPosition | i32 | breakpoint position in counts |
inputVector | u8 | source of the data for this function |
Parameter Discussion
axisOrEncoder is the axis or encoder to control. You can load breakpointPosition on encoders mapped to 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.
breakpointPosition is the breakpoint position in quadrature counts. Breakpoint positions can be anywhere within the 32-bit position range, –(231) to +(231–1). The default value is zero (0).
inputVector indicates the source of the data for this function. Available input vectors include immediate (0xFF), variable (0x01 through 0x78), or indirect variable (0x81 through 0xF8). Refer to Input and Return Vectors for more detailed information.
Using This Function
This function loads the breakpoint position value for the axis or encoder specified. The breakpoint position is interpreted differently depending on the breakpoint mode and the encoder position when the breakpoint is enabled. Breakpoint position is double-buffered and not actually used until you execute the Enable Breakpoint function.
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. |
Note Refer to the Write Buffer function to load breakpoint positions for buffered breakpoints. The Load Breakpoint Position function does not have any affect on buffered breakpoints. |
When the breakpoint position is reached, a breakpoint event is generated and the associated high-speed breakpoint output immediately transitions.
High-speed breakpoint functionality is performed by the encoder resources themselves. When this function is sent to an axis, it is actually being sent to the mapped encoder resource. Therefore, for closed-loop stepper systems, the breakpoint position is the encoder count. If the steps/revolution and encoder counts/revolution values are different, be aware that, for this function, the encoder count is most useful.
Breakpoints are only available on the encoder resources (NIMC_ENCODER1 through NIMC_ENCODER30) and are always loaded in quadrature counts.
When the same breakpoint position is used repeatedly, it is not necessary to reload the position each time. It is necessary, however, to re-enable the breakpoint after each use.
Note For closed-loop stepper motion systems in which the encoder counts per revolution differs from the steps per revolution, the captured position is in encoder counts. |