MotionController Axis MultiAxis IO IOPoint NetworkNode RsiError
Sample Apps Changelog

RapidCode API

◆ CommandPositionSet()

void CommandPositionSet ( double  pos)
pure virtual

Sets the value of the command and actual positions of an axis.

Description:
CommandPositionSet writes to the controller's axis' origin to adjust the command position so that it equals the positionparameter. The axis' actual position will also be changed by the same amount. Because the origin is an offset from the controller's command and actual positions, the CommandPositionSet will not cause a change to the position error. Thus, if the motor is enabled, it will not jump when CommandPositionSet is called.

CommandPositionSet should not be called when the axis is in a STOPPING, STOPPED, or MOVING state. If called while in these states, CommandPositionSet will not set the command position and return a RSICONSTANTAxisMessageCOMMAND_NOT_SET error which is necessary to protect the application from conflicting with the controller's trajectory generation.

Parameters
posThe value to set (units).
Sample Code:
// set the command position to 100000
axis.CommandPositionSet(100000);
RapidSetup:
Go to axis screen. In the image below, CommandPositionSet sets the value in the Command Position text box. In the image, the command position is: 4525826
Axis_PositionStatus.jpg
Note
Topics:
PositionMethods
See also
PositionSet