nimcReadCoordinateData

NI-Motion Functions

nimcReadCoordinateData

Device Compatibility

Device Compatibility
7330
N
7340
N
7344
N
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
N
NI SoftMotion Controller for CANopen—Accelnet
N

Read Coordinate Data

Usage

status = nimcReadCoordinateData(TnimcDeviceHandle deviceHandle, TnimcCoordinateHandle coordinateHandle, TnimcCoordinateData attribute, TnimcData* data);

Purpose

Reads the velocity or following error for a specified coordinate.

Parameters

Name Type Description
deviceHandle TnimcDeviceHandle assigned by Measurement & Automation Explorer (MAX)
coordinateHandle TnimcCoordinateHandle coordinate to read
attribute TnimcCoordinateData attribute to read
data TnimcData* the value for the attribute you are reading

Parameter Discussion

coordinateHandle is the coordinate to read with this function. Valid values are coordinates 1 through 15. On motion controllers that support fewer than thirty axes, reading non-existent coordinates returns error –70006 (NIMC_badResourceIDOrAxisError).

attribute is the attribute to read. The following are valid attributes:

  • TnimcCoordinateDataVelocity
  • TnimcCoordinateDataFollowingError

data is the value for the attribute you are reading in the following structure:

struct{
   i32 longData;
   u8 boolData;
   f64 doubleData;
} TnimcData;

Based on the attribute, the correct member of TnimcData will be returned by the motion controller. The values of the other elements in the structure are undefined.

Read doubleData in the TnimcData structure to retrieve the vector space velocity and following error.

Using This Function

Use this function to read the velocity or following error for a specified coordinate.

Caution  If this function uses reflective memory, it should not be used for event checking. In this case, only use the information returned by this function for display purposes. Refer to Reflective Memory Functions for more information.

For velocity, this function returns the filtered coordinate velocity for the coordinate move. The velocity is calculated using the root-mean-square of the filtered velocities of the individual axes that make up the coordinate.

For following error, this function returns the instantaneous difference between the commanded trajectory position and the actual feedback position in counts for servo systems and steps for stepper systems. The coordinate following error is calculated using the root-mean-square of the following errors for the individual axes that make up the coordinate.

Note  Refer to Function Execution Times for benchmark timing information about your controller.