User`s guide
Programming via GPIB and VXI 4
Agilent VISA User’s Guide 95
Mapping Memory Space
When using VISA to access the device's registers, you must map
memory space into your process space. For a given session, you can
have only one map at a time. To map space into your process, use the
VISA viMapAddress function:
viMapAddress(vi, mapSpace, mapBase, mapSize,
access, suggested, address);
This function maps space for the device specified by the vi session.
mapBase
, mapSize, and suggested are used to indicate the offset of the
memory to be mapped, amount of memory to map, and a suggested
starting location, respectively. mapSpace determines which memory
location to map the space. The following are valid mapSpace choices:
VI_A16_SPACE - Maps in VXI/MXI A16 address space
VI_A24_SPACE - Maps in VXI/MXI A24 address space
VI_A32_SPACE - Maps in VXI/MXI A32 address space
A pointer to the address space where the memory was mapped is
returned in the address parameter. If the device specified by vi does not
have memory in the specified address space, an error is returned. Some
sample viMapAddress function calls follow.
/* Maps to A32 address space */
viMapAddress(vi, VI_A32_SPACE, 0x000, 0x100,
VI_FALSE,
VI_NULL,&address);
viPeek16(vi, addr, val16); Reads 16 bits of data from address specified.
viPeek32(vi, addr, val32); Reads 32 bits of data from address specified.
viPoke8(vi, addr, val8); Writes 8 bits of data to address specified.
viPoke16(vi, addr, val16); Writes 16 bits of data to address specified.
viPoke32(vi, addr, val32); Writes 32 bits of data to address specified.
viUnmapAddress(vi); Unmaps memory space previously mapped.
Table 21 Summary of Low-Level Memory Functions (continued)