|
/* 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;
}
|