flex_read_hs_cap_status_rtn

NI-Motion Functions

flex_read_hs_cap_status_rtn

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 Return

Usage

status = flex_read_hs_cap_status_rtn(u8 boardID, u8 axisOrEncoder, u16* highSpeedCaptureStatus);

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
highSpeedCaptureStatus u16* bitmap of high-speed capture status

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.

highSpeedCaptureStatus is the bitmap of capture status for all axes or all encoders.

When reading high-speed capture status for axes (axisOrEncoder = NIMC_AXIS_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

For D1 through D15:
   1 = Capture occurred
   0 = Capture pending or disabled

When reading high-speed capture status for encoders (axisOrEncoder = NIMC_ENCODER_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Enc 15 ... Enc 10 Enc 9 Enc 8 Enc 7 Enc 6 Enc 5 Enc 4 Enc 3 Enc 2 Enc 1 0

For D1 through D15:
   1 = Capture occurred
   0 = Capture pending or disabled

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. Refer to the Read Captured Position function for information about retrieving the captured position value.

Example

Executing the Read High-Speed Capture Status function with axisOrEncoder = NIMC_AXIS_CTRL returns highSpeedCaptureStatus = 0x000C, which corresponds to the following bitmap:

D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 Axis 14 Axis 13 Axis 12 Axis 11 Axis 10 Axis 9 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 0 0 0 0 1 1 0 0

On encoders mapped to axes 2 and 3, 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 Find 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 Index function automatically leaves the corresponding high-speed capture input disabled after the index is found.

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 read 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_read_hs_cap_status_rtn (boardID, NIMC_AXIS1, &highSpeedCaptureStatus);

    To read 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_read_hs_cap_status_rtn (boardID, NIMC_SECOND_HS_CAPTURE1, &highSpeedCaptureStatus);

  • 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.
  • Executing the Find Reference Index function does not affect the capture status.
  • To obtain the high-speed capture status and secondary high-speed capture status of axes sixteen through thirty, use the Read per Axis Status Return function.