mpiFilterMemoryGet

Declaration

int32_t mpiFilterMemoryGet(MPIFilter     filter,
                        void          *dst,
                        const  void   *src,
                        int32_t          count)

 

Required Header: stdmpi.h

Change History: Modified in 04.00.

Description

mpiFilterMemoryGet copies count bytes of a Filter's (filter) memory (starting at address src) and writes them into application memory (starting at address dst).

Return Values
MPIMessageOK

Sample Code

/* filterControlOutputGet(...) demonstrates how to read 
the control output velocity on a motion object directly 
through memory. mpiFilterMemory(...) obtains the filter 
control memory pointer. The pointer's address is then 
passed into mpiFilterMemoryGet(...) to obtain the control 
output. 
Note: MPIXmpFilter *memory must be casted as (void *) in 
mpiFilterMemory(...).
*/

int32_t filterControlOutputGet(MPIFilter  filter,
                            double      *controlOutput)
{

   MFWFilterData   *dataMemory;
   int32_t           returnValue;

   /* Get filter control memory pointer */
   returnValue =
      mpiFilterMemory(filter, 
                      NULL,
                      dataMemory);

   /* Get filter control output value */
   if(returnValue == MPIMessageOK)
   {
       returnValue = 
           mpiFilterMemoryGet(filter,
                              controlOutput,
                              &dataMemory->CalcData.ControlOutput,
                              sizeof(&dataMemory->CalcData.ControlOutput));
   }
   return returnValue;
}

See Also

mpiFilterMemorySet | mpiFilterMemory