.

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(...) and/or mpiMotionModify(...) 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 is in a STOPPING, STOPPED, or MOVING state.
      • Any motor associated with the axis has the disableAction configuration set to MEIMotorDisableActionCMD_EQ_ACT and the motor's Amp Enable is disabled.
      • If the command position read from the controller does not match the requested position.
 
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 if command lies outside the range of signed 32-bit integers: [-2147483648, 2147483647]
MPIAxisMessageCOMMAND_NOT_SET  

See Also

MEIMotorDisableAction | AxisActualPositionSet | AxisCommandPositionSet | MPIAxisMessage | Controller Positions

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering