flex_configure_hs_capture |
Configure High-Speed Capture
Usage
status = flex_configure_hs_capture(u8 boardID, u8 axisOrEncoder, u16 captureMode, u16 operation);
Purpose
Configures the high-speed capture input for the specified signal behavior.
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 configure |
captureMode | u16 | how the controller interprets incoming signal |
operation | u16 | selects between single and buffered high-speed capture operation |
Parameter Discussion
axisOrEncoder is the axis or encoder to configure. 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.
captureMode specifies how the incoming high-speed capture is interpreted by the motion controller.
captureMode | Constant Name | Value |
---|---|---|
Non-inverting Level | NIMC_HS_NON_INVERTING_LEVEL | 0 |
Inverting Level | NIMC_HS_INVERTING_LEVEL | 1 |
Low-to-high Edge | NIMC_HS_LOW_TO_HIGH_EDGE | 2 |
High-to-low Edge | NIMC_HS_HIGH_TO_LOW_EDGE | 3 |
Non-inverting Digital Input | NIMC_HS_NON_INVERTING_DI | 4 |
Inverting Digital Input | NIMC_HS_INVERTING_DI | 5 |
Modes 0 through 3 define the state of the input signal that results in a high-speed capture event. Inverting level means an active low input triggers a capture. Conversely, non-inverting level means an active high input triggers a capture. Notice that if the signal is already at the specified level when high-speed capture is enabled, the capture occurs immediately. High-to-low edge requires that the signal make a transition from high to low to trigger a capture. Low-to-high edge requires that the signal make a transition from low to high to trigger a capture.
Modes 4 and 5 let you configure the high-speed capture input as a simple digital input independent of the high-speed capture circuitry. You use the Read High-Speed Capture Status function to read this state of the digital input. This functionality is useful when you do not need the high-speed capture capability, but need an extra digital input for general-purpose use. When configured in these modes, there is no need to enable the high-speed capture input.
operation selects between single and buffered high-speed capture operation. Valid values are NIMC_OPERATION_SINGLE (0) and NIMC_OPERATION_BUFFERED (1)
Note The mode set by Configure High Speed Capture does not take effect until Enable High-Speed Capture is called. |
Using This Function
Note NI-Motion does not support breakpoint and high-speed capture functionality on an axis when the primary feedback for that axis is analog feedback. |
After configuring the high-speed capture input, enable the high-speed capture circuitry with the Enable High-Speed Capture function. The Read High-Speed Capture Status function tells you when the capture event has occurred. Finally, you read the captured value with the Read Captured Position function.
High-speed capture inputs are an integral part of the encoder resources. You can execute this function indirectly on axes or directly on encoder resources. After it is enabled, the controller captures the instantaneous encoder position when the input becomes active, as specified in the captureMode parameter.
High-speed capture works only on axes that have an encoder as primary feedback or on encoders directly.
High-speed capture functionality is available in both single and buffered mode. In single high-speed capture, the input trigger is configured to capture a single encoder position, and must be re-enabled after each capture. You can use buffered high-speed capture to support higher capture frequencies. Buffered high-speed capture allows captures positions to be stored into a buffer and automatically re-enabled by the controller. Refer to the Configure Buffer function to configure a buffer for high-speed capture.
You can use a high-speed capture input as a general-purpose input and read its status with Read High-Speed Capture Status. In modes 0 through 3, the input has latching behavior. This means that after the high-speed capture input has been enabled, if the input signal ever becomes active (as defined by the captureMode parameter), the high-speed capture status is true until the input is reenabled. In modes 4 and 5, the inputs simply reflect the current state of the input signal. The input does not need to be enabled or reenabled at any time in these modes.
Note When configured as a digital input, Enable High-Speed Capture and Read Captured Position have no effect. The high-speed capture input is used as a general-purpose digital input. Refer to Read High-Speed Capture Status for information about reading the input status. |
Note National Instruments suggests that you do not change the capture mode when the high-speed capture is already enabled. Doing so might cause a false capture immediately after the Configure High-Speed Capture function is invoked. |
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:
- You can synchronize NI 73xx motion controllers with other National Instruments devices using the RTSI bus. Refer to the Select Signal function for information about using the RTSI bus as the high-speed capture trigger.
- 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_configure_hs_capture ( boardID, NIMC_AXIS1, NIMC_HS_LOW_TO_HIGH_EDGE, NIMC_OPERATION_SINGLE);
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_configure_hs_capture ( boardID, NIMC_SECOND_HS_CAPTURE1, NIMC_HS_LOW_TO_HIGH_EDGE, NIMC_OPERATION_SINGLE);
- The NI SoftMotion Controller does not support buffered high-speed captures.
- The NI SoftMotion Controller for the Copley Controls CANopen devices, Accelnet and Xenus, does not support high-speed captures.
- The NI SoftMotion Controller does not support RTSI synchronization.