flex_load_move_constraints

NI-Motion Functions

flex_load_move_constraints

Device Compatibility

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

Load Move Constraints

Usage

i32 status = flex_load_move_constraint (i32 boardID, i32 axisID, TnimcMoveConstraint attribute, NIMC_DATA* value);

Purpose

Loads move constraints in user units.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID i32 assigned by Measurement & Automation Explorer (MAX)
axisID i32 axis or vector space to control
attribute TnimcMoveConstraint type of move constraint to load
value NIMC_DATA* value of move constraint to load

Parameter Discussion

axisOrVectorSpace is the axis or vector space to control. 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, configuring non-existent axes or vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Vector Spaces for axis and vector space resource IDs.

attribute is the move constraint to load.

attribute Constant attribute Value
TnimcMoveConstraintVelocity 0
TnimcMoveConstraintAcceleration 1
TnimcMoveConstraintDeceleration 2
TnimcMoveConstraintAccelerationJerk 3
TnimcMoveConstraintDecelerationJerk 4

value is the value to load for the specified attribute. Use the doubleData element of the following structure to load the attribute value:

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

Use one of the following steps to load the appropriate value:

  • TnimcMoveConstraintVelocity—Set doubleData to velocity limit in user unit/second.
  • TnimcMoveConstraintAcceleration—Set doubleData to acceleration limit in user unit/second2.
  • TnimcMoveConstraintDeceleration—Set doubleData to deceleration limit in user unit/second2.
  • TnimcMoveConstraintAccelerationJerk—Set doubleData to acceleration jerk limit in user unit/second3.
  • TnimcMoveConstraintDecelerationJerk—Set doubleData to deceleration jerk limit in user unit/second3.

Using This Function

This function loads move constraints in user units using the doubleData element of the NIMC_DATA structure. Use Load Counts/Steps per Revolution to set the user unit ratio.

Example 1

If you load 2,000 counts/rev using the Load Counts/Steps per Revolution function, and then you call Load Move Constraints, with NIMC_VELOCITY_CONSTRAINT set to 10.5, the velocity loaded is 10.5 revolutions/second or 21,000 counts/second.

Example 2

If you set countsOrSteps to 1 in the Load Counts/Steps per Revolution function, and then you call Load Move Constraints, with NIMC_VELOCITY_CONSTRAINT set to 1.3, the velocity loaded is 1.3 counts/second.

Remarks

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

NI 73xx Controller Considerations

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