flex_acquire_trajectory_data

NI-Motion Functions

flex_acquire_trajectory_data

Device Compatibility

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

Acquire Trajectory Data

Usage

status = flex_acquire_trajectory_data(u8 boardID, u16 axisMap, u16 numberOfSamples, u16 timePeriod);

Purpose

Acquires time-sampled position and velocity data on multiple axes.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisMap u16 bitmap of axes to acquire data for
numberOfSamples u16 number of samples to acquire
timePeriod u16 time period in milliseconds between samples

Parameter Discussion

axisMap is the bitmap of axes to acquire data for.

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 XXX

D1 through D8:
   1 = Acquire samples on this axis
   0 = Do not acquire samples (default)

numberOfSamples is the number of samples to acquire. The maximum number of samples depends upon the number of axes selected by axisMap.

numberOfSamples (max) = 4096/number of axes. With one axis selected, the maximum is 4,096 samples. With four axes selected, the maximum is 682 samples.

timePeriod is the time period between samples in ms. The range is from 3 (default) to 65,535 ms.

Using This Function

This function initiates the automatic acquisition of position and velocity data for the selected axes. The data is held in an onboard first-in-first-out (FIFO) buffer until later read back with the Read Trajectory Data function. You can select which axes to acquire data for and program the time period between samples. The Acquire Trajectory Data and Read Trajectory Data functions are used to acquire and read back time-sampled position and velocity data for analysis and display. These functions implement a digital oscilloscope that is useful during system setup, PID tuning, and general motion with data acquisition synchronization.

Caution  Wait an appropriate amount of time before attempting to read back the trajectory data.

After it is started, this data acquisition operates autonomously in the background as a separate task. Motion control operates normally and you can execute other motion functions simultaneously. Depending upon the programmed time period and the total number of samples, this acquisition task can run anywhere from a few milliseconds to tens of hours.

Because host communication, event handling, arc point generation, contour point dispensing, buffered breakpoints, and buffered high-speed capture are a higher priority on the controller than acquiring trajectory data, you may notice irregular time spacing of sampled data when host communications or event notification is heavy. To minimize the chance of irregular data, limit host communication to a minimum while acquiring trajectory data. If you still notice irregular data, increase the time period.

Example

To acquire 100 samples of data on axes 1 and 2 at 10 ms/sample, call the Acquire Trajectory Data function with the following parameters:

axisMap = 0x0006, corresponding to the following bitmap:

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

numberOfSamples = 100
timePeriod = 10

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI SoftMotion Controller Considerations

This function cannot handle axes greater than fifteen.