.

mpiMotionMemory

Declaration

 
long mpiMotionMemory(MPIMotion  motion,
                     void       **memory) 
 

Required Header: stdmpi.h

Description

mpiMotionMemory sets (writes) the address [that is used to access a Motion's (motion) memory] to the contents of memory. This address (or an address calculated from it) is passed as the src argument to mpiMotionMemoryGet(...), and also as the dst argument to mpiMotionMemorySet(...).

 
Return Values
MPIMessageOK  

Sample Code


/* motionEStopRempVel(...) demonstrates how to read the 
EStopRamp velocity on a motion object directly through memory. 
mpiMotionMemory(...) obtains the motion control memory pointer. 
The pointer's address is then passed into mpiMotionMemoryGet(...)
to obtain the EStopRamp velocity. 
Note: MEIXmpMotionSupervisor *memory must be casted as (void *) 
in mpiMotionMemory(...).
*/

long motionEStopVelGet(MPIMotion   motion,
                       float       *EStopRampVel)
{
   MEIXmpMotionSupervisor *memory;
   long                   returnValue;

   /* Get MS control memory pointer */
   returnValue =
      mpiMotionMemory(motion, 
                     (void *)&memory);

   /* Get MS EStopRamp velocity */
   if(returnValue == MPIMessageOK)
   {
      returnValue = 
         mpiMotionMemoryGet(motion,
                            EStopRampVel,
                            &memory->FeedRate.EStopRamp.Vel,
                            sizeof(&memory->FeedRate.EStopRamp.Vel));
   }
   return returnValue;
}

See Also

mpiMotionMemoryGet | mpiMotionMemorySet

 

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