mpiMapSymbolToPtr
Declaration
MPI_DECL1 MPI_RESULT MPI_DECL2 mpiMapSymbolToPtr(MPIMap mpiMap, const MPIMapSymbol *data, MPIMapPtr *info);
Required Header: map.h
Change History: Added in 04.00.
Description
mpiMapSymbolToPtr returns information about commonly referenced memory locations on the controller. mpiMapSymbolToPtr is most commonly used to configure which traces are recorded by the data recorder, but may also be used in conjunction to configure program sequencers or user limits.
mpiMap | The MPIMap object used to translate addresses. |
---|---|
data | A read-only pointer to the MPIMapSymbol structure representing the location of the controller data whose information is to be looked up. |
info | A pointer to the MPIMapPtr structure where the memory information is to be written. |
Return Values |
---|
MPIMapMessageMAP_INVALID |
MPIMessageARG_INVALID |
MPIMapMessageMAP_DATA_INVALID |
Sample Code
MPIMap mpiMap; MPIMapSymbol data; MPIMapPtr info; MPI_RESULT returnValue;
/* ... */
/* Obtain information about axis 3's actual position. */ data.location = MPIMapSymbolTypeACTUAL_POSITION; data.index[0] = 3;
returnValue = mpiMapSymbolToPtr(mpiMap, &data, &info);
/* info.dataType holds axis 3's data type. */
/* info.ptr holds a host pointer to axis 3's memory on the controller */ /* info.ptr.v may be used to configure a data recorder trace */
/* info.mask should be 0xFFFFFFFFFFFFFFFF (as actual positions are not bitmasks) */ /* info.mask will only have one bit set for digital i/o though, and */ /* info.mask will likely only have 16 bits set for analog i/o. */
See Also
mpiMapPtrToSymbol | MPIMapSymbol | MPIMapPtr