MPIMapStrMacros

Declaration

#define MPIMapStr0(type) \
   MPIMapStr##type

#define MPIMapStr1(type, index1) \ MPIMapStr##type \ MPIMapStrIndex##index1
#define MPIMapStr2(type, index1, index2) \ MPIMapStr##type \ MPIMapStrIndex##index1 \ MPIMapStrIndex##index2
#define MPIMapStr3(type, index1, index2, index3) \ MPIMapStr##type \ MPIMapStrIndex##index1 \ MPIMapStrIndex##index2 \ MPIMapStrIndex##index3

Required Header: map.h

Change History: Added in 04.00.

Description

The MPIMapStr macros are used to easily build map strings.

These macros can be used by typing the MPIMapSymbolType enumeration suffix into the first argument. The remaining arguments specify the indices needed by a MPIMapSymbolType enumeration value.

For example, to build the map string for Axis #1’s actual position, use:

MPIMapStr1(AXIS_ACTUAL_POSITION, 1)

To build the map string for SynqNet node #3, analog input 5, use:

MPIMapStr2(SQNODE_ANALOG_IN, 3, 5)

Sample Code

      MPIMapSymbol   data;
      MPIMapPtr      info;
      int32_t           pointCount = 0;
      void           *point[MPIRecorderADDRESS_COUNT_MAX] = {0};
      MPI_RESULT     returnValue;

/* Set up Points to be recorded */
/* Obtain information for Axis 0 DAC Output */ returnValue = mpiMapStringToPtr(mpiMap, MPIMapStr1(FILTER_OUTPUT, 0), &info); msgCHECK(returnValue); point[pointCount++] = info.ptr.v;
/* Get Address for User Buffer location */ returnValue = mpiMapStringToPtr(mpiMap, MPIMapStr1(USER_BUFFER, 0), &info); msgCHECK(returnValue); point[pointCount++] = info.ptr.v;
returnValue = mpiRecorderRecordConfig(recorder, MPIRecorderRecordTypePOINT, pointCount, point); msgCHECK(returnValue);

See Also

MPIMapSymbolType