.

mpiAxisMemory

Declaration

 
long mpiAxisMemory(MPIAxis  axis,
                   void     **memory)
  Required Header: stdmpi.h

Description

mpiAxisMemory sets (writes) an address (used to access a Control object's memory) to the contents of memory.

 
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

mpiAxisMemoryGet | mpiAxisMemorySet

 

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