flex_read_velocity

NI-Motion Functions

flex_read_velocity

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 Velocity

Usage

status = flex_read_velocity(u8 boardID, u8 axisOrVectorSpace, u8 returnVector);

Purpose

Reads the filtered velocity of an axis or vector space.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrVectorSpace u8 axis or vector space to read
returnVector u8 destination for the return data

Parameter Discussion

axisOrVectorSpace is the axis or vector space to read. Valid values are NIMC_AXIS1 through NIMC_AXIS30 or NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15. On motion controllers that support fewer than thirty axes, reading non-existent axes or vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Vector Spaces for axis and vector space 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 returns the axis or vector space filtered velocity. To reduce the effects of noise and jitter on the filter calculation, the data this function returns is averaged based on parameters set in the Load Velocity Filter Parameter function.

For vector spaces, this function returns vector velocity, the root-mean-square of the filtered velocities of the individual axes that make up the vector space.

Note  You also can read velocity in RPM by calling the Read Velocity in RPM function.
Note  Refer to Function Execution Times for benchmark timing information about your controller.