MPIMapPtr

Declaration

typedef struct MPIMapPtr {
    union {
        unsigned long   ui32;
        MPIUInt64       ui64;
    } mask;
    long                shift;
    union {
        void*           v;
        double*         d;
        long*           i32;
        unsigned long*  ui32;
        MPIInt64*       i64;
        MPIUInt64*      ui64;
    } ptr;
   MPIDataType          dataType;
} MPIMapPtr;

Required Header: map.h

Change History: Added in 04.00.

Description

MPIMapPtr is a structure that represents areas of memory on the motion controller. These areas of memory could represent a single bit (for digital I/O) or multiple bits (for all other types of memory).

MPIMapPtr is used as an intermediate representation of memory between certain MPI configurations (such as MPIRecorder traces) and a version independent representation of memory by the MPIMapSymbol structure.

Warning: The information in MPIMapPtr is not portable between MPI versions. To represent commonly referenced memory locations on the controller, use the MPIMapSymbol structure.

mask The bit mask associated with a particular memory location. Used when representing I/O on the controller. Digital I/O uses a single bit and analog I/O uses 16 bits.
ptr The host pointer to the controller memory.
dataType The data type of the controller memory.

Sample Code

MPIMap       mpiMap;
MFWData*     firmware;
MPIMapSymbol data;
MPIMapPtr    info;
MPI_RESULT   returnValue;

/* ... */
/* Obtain information about firmware->SystemData.SampleCounter assuming a mask of 0xFFFFFFFF*/ info.ptr.ul = &firmware->SystemData.SampleCounter; info.mask.ul = 0xFFFFFFFF;
returnValue = mpiMapPtrToSymbol(mpiMap, &info, &data);
/* data.location should be MPIMapSymbolTypeSAMPLE_COUNTER */
/* All elements of data.index should be equal to -1 indicating they are not */ /* needed when describing the sample counter. */

See Also

mpiMapSymbolToPtr | mpiMapPtrToSymbol | MPIMapSymbol