mpiAxisCommandPositionSet

Declaration

long mpiAxisCommandPositionSet(MPIAxis  axis,
                               double   command) 
Required Header: stdmpi.h

Description

mpiAxisCommandPositionSet sets the value of the command position of an Axis (axis) from command. 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 an mpiMotionStart(...). Use mpiMotionStart(...) for controlled, gradual motion.

mpiAxisCommandPositionSet truncates command to an integer value before sending the new position to the controller. If a different type of rounding is desired, then it should be implemented by the application prior to calling AxisCommandPositionSet.

mpiAxisCommandPositionSet(...) Error Check
The mpiAxisCommandPositionSet(...) error check has been extended. If the controller is updating the axis's command position when mpiAxisCommandPositionSet(...) is called, MPIAxisMessageCOMMAND_NOT_SET will be returned. mpiAxisCommandPositionSet(...) checks for the following conditions:

axis a handle to the Axis object
command value to which the Actual command position will be set

Remarks

Setting the Axis Command Position will cause the axis to jump. See the discussion of the Axis Origin before using the mpiAxisActualPositionSet(...) and mpiAxisCommandPositionSet(...) methods. The origin is not changed when mpiAxisCommandPositionSet(...) is called. The change is made directly to the command position.

Return Values
MPIMessageOK
MPIMessageARG_INVALID
MPIAxisMessageCOMMAND_NOT_SET

See Also

MPIMotorDisableAction | AxisActualPositionSet | AxisCommandPositionSet | MPIAxisMessage | Controller Positions