Acquire Trajectory Data

NI-Motion VI

Acquire Trajectory Data

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

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
Timeperiod (3 ms) is the time period between samples in ms. The range is from 3 (default) to 65,535 ms.
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Number of samples (1) is the number of samples to acquire. The maximum number of samples depends upon the number of axes selected by Axis Map:

Number of Samples (max) = 4,096/number of axes

With one axis selected, the maximum is 4,096 samples. With four axes selected, the maximum is 1024 samples.

Axis Map specifies the axes for which data is acquired:
Axis 1—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 2—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 3—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 4—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 5—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 6—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 7—If true, acquire samples on this axis. If false, do not acquire samples (default).
Axis 8—If true, acquire samples on this axis. If false, do not acquire samples (default).
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

The Acquire Trajectory Data VI 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 VI. You can select which axes to acquire data for and program the time period between samples.

The Acquire and Read Trajectory Data VIs are used to acquire and read back time-sampled position and velocity data for analysis and display. These VIs implement a digital oscilloscope that is useful during system set up, PID tuning, and general motion with data acquisition synchronization.

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 VIs 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.

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

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 VI with the following parameters:

Axis Map corresponds to the following

     Axis 1 Axis 2 Axis 3 Axis 4
True True False False

Number of Samples = 100
Timeperiod = 10