flex_enable_hs_capture

NI-Motion Functions

flex_enable_hs_capture

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

Enable High-Speed Capture

Usage

status = flex_enable_hs_capture(u8 boardID, u8 axisOrEncoder, u16 enable);

Purpose

Enables or disables the specified high-speed capture input.

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)
axisOrEncoder u8 axis or encoder to enable or disable
enable u16 enable/disable value

Parameter Discussion

axisOrEncoder is the axis or encoder selector. Valid values are 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.

enable indicates if the function enables or disables the high-speed capture input.

   1 = Capture enabled
   0 = Capture disabled

Using This Function

This function enables high-speed capture inputs to capture instantaneous encoder position when an input becomes active. The position capture is implemented in the encoder resource to reduce capture latency to the sub-100 ns range.

Note  If your application uses the Select Signal function to route the high-speed capture source, you must call the Select Signal function before enabling the high-speed capture.

High-speed capture 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.

The high-speed inputs have programmable polarity and edge behavior. You can set the polarity of the input with the Configure High-Speed Capture function. You can determine the results of the high-speed capture from the Read High-Speed Capture Status and Read Captured Position functions.

Using single high-speed capture, you can enable only one high-speed capture per axis or encoder at a time. When an enabled event is captured, the high-speed capture is automatically disabled. You must explicitly re-enable the high-speed capture to use it again. To disable a previously-enabled operation, call this function again with enable set to 0.

For buffered high-speed capture, you need to enable the input trigger only once. Subsequent high-speed captures are automatically re-enabled by the controller. This function has no effect when the input trigger is configured as a digital input.

If you are using buffered high-speed capture, ensure that the buffer is configured before you execute this function. Refer to Configure Buffer for more information.

High-speed capture is useful in registration and synchronization applications. You can calculate subsequent moves relative to the captured position. Refer to the Set Operation Mode function for information about relative-to-capture mode. Refer to the Gearing section of the NI-Motion Help for information about using superimposed moves/registration applications. Also, refer to the Rotating Knife section of the NI-Motion Help example code that includes superimposed moves.

Note  Enabling a high-speed capture input when the input is already active captures the position immediately and sets the status bit. If you change the mode with Configure High-Speed Capture after you enable high-speed capture for this axis, the new mode does not take effect until the next time Enable High-Speed Capture is called.
Note  Enabling a high-speed capture when a breakpoint is enabled may cause the breakpoint to be missed. If you are using a breakpoint on the same axis on which you are performing the high-speed capture, ensure that both the breakpoint and the high-speed capture are configured and enabled before starting the move.

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this function with a 73xx motion controller:

  • If your application includes a high-speed capture that takes place after a Find Reference move that finds an index, you must enable the high-speed capture after the find reference move. If your application includes a buffered high-speed capture, you must also configure the buffer after the find reference move.
  • NI 73xx controllers do not support multiple simultaneous high-speed captures per axis. NIMC_SECOND_HS_CAPTURE is not supported.

NI SoftMotion Controller Considerations

The following list includes considerations you must make when you are using this function with the NI SoftMotion Controller:

  • The NI SoftMotion Controller supports multiple simultaneous high-speed captures per axis.

    To configure the first high-speed capture line on an axis, use the constant for that axis. For example, if the first high-speed capture is on axis 1, the function call appears as

    status = flex_enable_hs_capture ( boardID, NIMC_AXIS1, TRUE);

    To configure the second high-speed capture line on an axis, use the second high-speed capture constants NIMC_SECOND_HS_CAPTURE1 through NIMC_SECOND_HS_CAPTURE30. For example, if the second high-speed capture is on axis 1, the function call appears as

    status = flex_enable_hs_capture ( boardID, NIMC_SECOND_HS_CAPTURE1, TRUE);

  • The NI SoftMotion Controller for Copley Controls' Accelnet and Xenus CANopen drives does not support multiple simultaneous high-speed captures per axis. NIMC_SECOND_HS_CAPTURE is not supported.