viMapAddressEx
Note: This function is not currently supported in Agilent VISA.
Syntax
viMapAddressEx(ViSession vi, ViUInt16 mapSpace, ViBusAddress64 mapBase64, ViBusSize mapSize, ViBoolean access, ViAddr suggested, ViPAddr address);
Description
This VISA 4.0 (and later) function maps in a specified memory space. The memory space that is mapped is dependent on the type of interface specified by the vi parameter and the mapSpace parameter (see the following table). The address parameter returns the address in your process space where memory is mapped. The values for the mapSpace parameter are:
Value |
Description |
VI_A16_SPACE |
Map the A16 address space of VXI/MXI bus. |
VI_A24_SPACE |
Map the A24 address space of VXI/MXI bus. |
VI_A32_SPACE |
Map the A32 address space of VXI/MXI bus. |
VI_A64_SPACE |
Address the A64 address space of VXI/MXI bus. |
VI_PXI_CFG_SPACE |
Address the PCI configuration space. |
VI_PXI_BAR0_SPACE – VI_PXI_BAR5_SPACE |
Address the specified PCI memory or I/O space. |
VI_PXI_ALLOC_SPACE |
Access physical locally allocated memory. |
If the viSession parameter (vi) refers to an INSTR session, the mapBase parameter specifies a relative offset in the instrument’s mapSpace. If the ViSession parameter (vi) refers to a MEMACC session, the mapBase parameter is an absolute offset from the start of the VXI mapSpace.
Note: For a given session, you can only have one map at one time. If you need to have multiple maps to a device, you must open one session for each map needed.
The mapBase parameter specified in the viMapAddressEx operation for an INSTR resource is the offset address relative to the device's allocated address base for the corresponding address space specified.
For example, if mapSpace specifies VI_A16_SPACE, mapBase64 specifies the 64-bit offset from the logical address base address of the VXI device specified. If mapSpace specifies VI_A24_SPACE, VI_A32_SPACE, or VI_A32_SPACE, mapBase specifies the offset from the base address of the VXI device's memory space allocated by the VXI Resource Manager within VXI A24, A32, or A64 space.
Parameters
Name |
Dir |
Type |
Description |
vi |
IN |
ViSession |
Unique logical identifier to a session. |
mapSpace |
IN |
ViUInt16 |
Specifies the address space to map. |
mapBase64 |
IN |
ViBusAddress64 |
64-bit offset (in bytes) of the memory to be mapped. |
mapSize |
IN |
ViBusSize |
Amount of memory to map (in bytes). |
access |
IN |
ViBoolean |
VI_FALSE. |
suggested |
IN |
ViAddr |
If suggested parameter is not VI_NULL, the operating system attempts to map the memory to the address specified in suggested. There is no guarantee, however, that the memory will be mapped to that address. This function may map the memory into an address region different from suggested. |
address |
OUT |
ViPAddr |
Address in your process space where the memory was mapped. |
Return Values
Type ViStatus |
This is the function return status. It returns either a completion code or an error code as follows. |
Completion Code |
Description |
VI_SUCCESS |
Map successful. |
Error Codes |
Description |
VI_ERROR_ALLOC |
Unable to allocate window of at least the requested size. |
VI_ERROR_INV_ACC_MODE |
Invalid access mode. |
VI_ERROR_INV_OFFSET |
Invalid offset specified. |
VI_ERROR_INV_SESSION |
The given session or object reference is invalid (both are the same value). |
VI_ERROR_INV_SETUP |
Unable to start operation because the setup is invalid (due to attributes being set to an inconsistent state). |
VI_ERROR_INV_SIZE |
Invalid size of window specified. |
VI_ERROR_INV_SPACE |
Invalid mapSpace specified. |
VI_ERROR_NSUP_OFFSET |
Specified region is not accessible from this hardware. |
VI_ERROR_NSUP_OPER |
The given vi does not support this operation. |
VI_ERROR_RSRC_LOCKED |
Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. |
VI_ERROR_TMO |
viMapAddress could not acquire resource or perform mapping before the timer expired. |
VI_ERROR_WINDOW_MAPPED |
The specified session already contains a mapped window. |
See Also