MPI 04.00 Reference >> mpiMotion

mpiMotionMemoryGet

Declaration

long mpiMotionMemoryGet(MPIMotion   motion,
                        void        *dst,
                        const void  *src,
                        long        count) 

Required Header: stdmpi.h
Change History: Modified in the 03.03.00

Description

mpiMotionMemoryGet copies count bytes of a Motion's (motion) memory (starting at address src) to application memory (starting at address dst).

Return Values
MPIMessageOK

Sample Code

/* motionFeedRateGet(...) demonstrates how to read the 
current feedrate 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 rate. 
*/

long motionFeedRateGet(MPIMotion    motion,
                       double       *feedRate)
{
   MFWMotionSupervisorData *dataMemory;
   long                    returnValue;

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

   /* Get MS FeedRate value */
   if(returnValue == MPIMessageOK)
   {
      returnValue = 
         mpiMotionMemoryGet(motion,
                            Vel,
                            &dataMemory->FeedRate.Current,
                            sizeof(&dataMemory->FeedRate.Current));
   }
   return returnValue;
}

See Also

mpiMotionMemorySet | mpiMotionMemory