flex_read_hs_cap_status

NI-Motion Functions

flex_read_hs_cap_status

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

Read High-Speed Capture Status

Usage

status = flex_read_hs_cap_status(u8 boardID, u8 axisOrEncoder, u8 returnVector);

Purpose

Reads the high-speed position capture status for all axes or encoders.

Note Note  You cannot use this function to read the status of buffered high-speed captures. Use Check Buffer to get the status of the buffer.
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 selector
returnVector u8 destination for the return data

Parameter Discussion

axisOrEncoder is the axis or encoder 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.

returnVector indicates the destination for the return data generated by this function. Available return vectors include return data to the host (0xFF), to a variable (0x01 through 0x78), to an indirect variable (0x81 through 0xF8), and return no data (0). Refer to Input and Return Vectors for more detailed information.

Note  The suffix _rtn on the function indicates that the data must be returned to the host. When this calling convention is used, no returnVector is required.

Using This Function

This function allows you to see if a position capture has occurred or is pending. When configured as a single high-speed capture, the corresponding status bit is set when an input trigger becomes active, as configured in Configure High-Speed Capture. The status bit, along with the captured encoder position, is latched until the input trigger is re-enabled. When the position capture occurs, its status bit is set to True (1). Refer to the Read Captured Position function for information about retrieving the captured position value.

Example

Executing this function with axisOrEncoder = NIMC_AXIS_CTRL returns highSpeedCaptureStatus = 0x000C, which corresponds to the following bitmap:

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
0 ... 0 0 0 0 0 0 0 1 1 0 0

On encoders mapped to axes 2 and 4, high-speed captures have occurred, but all other captures are pending or were never enabled.

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:

  • The high-speed capture circuitry is also used during a Find Reference Index execution. When an index is found successfully, the capture status for the corresponding encoder and axis is set to True as a side effect.
  • Executing the Find Reference function to find an index position automatically leaves the corresponding high-speed capture input disabled after the index is found.