Write Trajectory Data

NI-Motion VI

Write Trajectory Data

Configures trajectory generator parameters.

Details     Remarks

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
Y
NI SoftMotion Controller for CANopen—Xenus
Y
data in is a cluster of variables that contains the values for the selected attribute.
integer is 32-bit integer data.
double is 64-bit floating point data.
Boolean is Boolean data.

Based on the attribute, the correct member of data in must be set as follows:

  • For move complete when deactivated, set the Boolean element of the data in cluster to TRUE to add motor off status as a criteria for move complete, and set it to FALSE to remove motor off status.
  • For move complete when not moving, set the Boolean element of the data in cluster to TRUE to add motor stop status as a criteria for move complete, and set it to FALSE to remove motor stop status.
  • For move complete after delay, set the Boolean element of the data in cluster to TRUE to enable a user-defined delay as a criteria for move complete, and set it to FALSE to disable a user-defined delay.
  • For move complete time delay, set doubleData in the TnimcData structure to the desired time delay to wait for move complete. Valid values are 0 to 0.255 seconds.
  • For move complete when in range, set the Boolean element of the data in cluster to TRUE to enable a position range as a criteria for move complete, and set it to FALSE to disable a position range.
  • For move complete range distance, set doubleData in the TnimcData structure to the desired position range distance for move complete. Valid values are 0 to 32,787 counts, steps, or user units on the NI SoftMotion Controller.
  • For move complete minimum active time, set doubleData in the TnimcData structure to the desired minimum wait time to wait for move complete. Valid values are 0 to 0.255 seconds.
  • For move complete when in position active, set the Boolean element of the data in cluster to TRUE to enable using the in-position input as a criteria for move complete, and set it to FALSE to disable using the in-position input.
attribute is the attribute you want to load. The following are valid attributes:
  • move complete when deactivated
  • move complete when not moving
  • move complete after delay
  • move complete time delay
  • move complete when in range
  • move complete range distance
  • move complete minimum active time
  • move complete when in position active

The effect of the criteria parameters can be summarized with the following equation:

Move Complete = (Profile Complete [ OR when deactivated ] )
   [ AND (not moving == True) ]
   [ AND (delay == Done ) ] 
   [ AND ( | position – target position | < range distance ) ]
   [ AND (in-position == Active) ]
where [...] indicates optional criteria.

board in is a unique number assigned by Measurement & Automation Explorer used to send and receive commands and data to or from a specific NI motion controller.
axis in is the axis you are controlling.
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.
board out is provided for flow control. You can string together NI-Motion VIs by wiring the board out terminal of one VI to the board in terminal of the next VI.
axis out is provided for flow control. You can string together NI-Motion VIs by wiring the axis out terminal of one VI to the axis in 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

Use this VI to configure trajectory generator parameters for reporting a move complete. When a move is complete on an axis, the corresponding bit in the Move Complete Status (MCS) register is set. Refer to Read Move Complete Status for information about reading the MCS register.

If move complete when deactivated is true, any condition that causes the axis to turn its motor off (a kill or following error trip) satisfies this requirement for Move Complete.

If the move complete when not moving is true, the axis must be logically stopped for the move to be considered complete.

If move complete after delay is true, the axis must wait a user-defined delay after the other criteria are met before the move is considered complete. The move complete time delay attribute is typically used to wait the mechanical settling time so that a move is not considered complete until vibrations in the mechanical system have damped out. It also can be used to compensate for PID pull-in time due to the integral term. This pull-in is typically at velocities below the Run/Stop threshold.

Note  You can use the move complete after delay parameter to guarantee a minimum time for the False state. The status transitions from Complete to Not Complete at the start of a move and stays in the Not Complete state for at least this delay time even in the case of a zero distance move.

If move complete when in range is true, the axis checks its final stopping position versus its target position and only sets the Move Complete status if the absolute value of the difference is less than move complete range distance.

Finally, if move complete when in position active is true, the in-position input signal is used as a criteria for move complete, and the move is only complete if the in-position signal is active.

A non-zero value for move complete minimum active time guarantees the status stays in the True state for at least this minimum time, even if another move starts immediately. You can use this feature to make sure the host does not miss a Move Complete status when it polls the Move Complete Status register.

Tip  You can adjust move complete criteria settings in MAX on the Trajectory Settings tab.

This VI is typically called for each axis prior to using the axis for position control. After the attribute is set, it remains in effect until it is disabled. You can execute this VI at any time.

When an axis starts, its corresponding bit in the Move Complete Status register is reset to zero. When the move completes, the bit is set to one. You can check the status of an axis or axes at any time by polling the MCS register. Onboard programs can use this status to automatically sequence moves with the Wait on Condition VI.

Remarks

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

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this VI with a 73xx motion controller:

  • The NI 7344 does not support the move complete when in position active attribute.
  • 7330, 7340, and 7350 controllers use Configure Motion I/O Map to map the in-position input to a general-purpose I/O line.

NI SoftMotion Controller Considerations

The following includes considerations you must make when you are using this VI with the NI SoftMotion Controller:

The NI SoftMotion Controller does not support the move complete when in position active attribute.