.

mpiAxisMemoryGet

Declaration

 
long mpiAxisMemoryGet(MPIAxis      axis,
                      void         *dst,
                      const void   *src,
                      long         count)
  Required Header: stdmpi.h

Description

mpiAxisMemoryGet copies count bytes of Axis (axis) memory (starting at address src) to application memory (starting at address dst).

 
axis a handle to the Axis object
*dst pointer to the destination location to where the memory will be written
*src pointer to the source location of memory being read
count size of memory to be read
   
 
Return Values  
MPIMessageOK  

Sample Code


/* axisPositionErrorGet(...) demonstrates how to read the position 
error on an axis object directly through memory. mpiAxisMemory(...) 
obtains the axis control memory pointer. The pointer's address is 
then passed into mpiAxisMemoryGet(...) to obtain the position error value. 
Note: MEIXmpAxis *memory must be casted as (void *) in mpiAxisMemory(...).
*/

long axisPositionErrorGet(MPIAxis   axis,
                          float     *positionError)
{
    MEIXmpAxis    *memory;
    long          returnValue;

    /* Get axis control memory pointer */
    returnValue =
       mpiAxisMemory(axis, 
                    (void *)&memory);

    /* Get axis position error value */
    if(returnValue == MPIMessageOK)
    {
        returnValue = 
           mpiAxisMemoryGet(axis,
                            positionError,
                            &memory->PositionError,
                            sizeof(&memory->PositionError));
    }
    return returnValue;
}

      

See Also

mpiAxisMemory | mpiAxisMemorySet

 

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