APIs, concepts, guides, and more

◆ CommandPositionDirectSet()

void CommandPositionDirectSet ( double position)
The motor will servo directly to the new command position the next servo sample after the new command position is set. This change in position will not be gradual or controlled, as it is in MoveTrapezoidal (for example). Use one of the motion methods (e.g. MoveTrapezoidal) for controlled, gradual motion.
positionThe value to set (UserUnits).
Sample Code:
// directly set the command position to 100000 - WARNING this could cause the motor to jump!
Setting the command position will cause an axis to jump or could cause a position error. The command position is typically controlled by the trajectory calculator, setting this value is not recommended. Cannot set if State is MOVING, STOPPING or STOPPED.
See also