◆ CommandPositionSet()

virtual void CommandPositionSet ( double  position)
pure virtual

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

ℹ This function is avaliable in RapidCode and RapidSequencer

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.

positionThe value to set (UserUnits).
Sample Code:
// set the command position to 100000
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
See also