Memory Access (MEMACC) Resource
This topic describes the Memory Access (MEMACC) Resource that is provided to encapsulate the address space of a memory-mapped bus, such as the VXIbus.
MEMACC Resource Overview
The Memory Access (MEMACC) Resource encapsulates the address space of a memory-mapped bus such as the VXIbus. A VISA Memory Access Resource, like any other resource, starts with the basic operations and attributes of the VISA Resource Template. For example, modifying the state of an attribute is done via the operation viSetAttribute.
Although the MEMACC resource does not have viSetAttribute listed in its operations, it provides the operation because it is defined in the VISA Resource Template. From this basic set, each resource adds its specific operations and attributes that allow it to perform its dedicated task, such as reading a register or writing to a memory location.
The MEMACC Resource lets a controller interact with the interface associated with this resource. It does this by providing the controller with services to access arbitrary registers or memory addresses on memory-mapped buses.
MEMACC Resource Attributes
Note: AP = Access Privileges
Attribute Name |
AP |
Data Type |
Range |
Default |
|||||||||||||||||||||||||||||||||||||||||||
Generic MEMACC Resource Attributes |
|||||||||||||||||||||||||||||||||||||||||||||||
RW |
Local |
ViBoolean |
VI_TRUE |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViString |
N/A |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViUInt16 |
0 to FFFFh |
0 |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViUInt16 |
VI_INTF_VXI |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RW |
Local |
ViUInt32 |
VI_TMO_IMMEDIATE |
2000 msec. |
|||||||||||||||||||||||||||||||||||||||||||
VXI and GPIB-VXI and PXI Specific MEMACC Resource Attributes |
|||||||||||||||||||||||||||||||||||||||||||||||
RW |
Local |
ViInt32 |
0 to 1 |
1 |
|||||||||||||||||||||||||||||||||||||||||||
RW |
Local |
ViInt32 |
0 to 1 |
1 |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Local |
ViUInt16 |
VI_NMAPPED |
VI_NMAPPED |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Local |
ViBusAddress |
N/A |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Local |
ViBusAddress64 |
N/A |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Local |
ViBusSize |
N/A |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Local |
ViBusSize64 |
N/A |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
VXI and GPIB-VXI Specific MEMACC Resource Attributes
* For VISA 2.2, the attributes VI_ATTR_WIN_BYTE_ORDER and VI_ATTR_WIN_ACCESS_PRIV are RW (readable and writeable) when the corresponding session is not mapped ( VI_ATTR_WIN_ACCESS = = VI_NMAPPED). When the session is mapped, these attributes are RO (read only). VXI and GPIB-VXI Specific MEMACC Resource Attributes |
|||||||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViUInt16 |
0 to 30, VI_NO_SEC_ADDR |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViUInt16 |
0 to 30 |
N/A |
|||||||||||||||||||||||||||||||||||||||||||
RO |
Global |
ViUInt16 |
0 to FFFFh |
N/A |
MEMACC Resource Attribute Descriptions
Attribute Name |
Description |
Generic MEMACC Resource Attributes |
|
VI_ATTR_DMA_ALLOW_EN |
This attribute specifies whether I/O accesses should use DMA ( VI_TRUE VI_FALSE). In some implementations, this attribute may have global effects even though it is documented to be a local attribute. Since this affects performance and not functionality, that behavior is acceptable. |
VI_ATTR_INTF_INST_NAME |
Human-readable text describing the given interface. |
VI_ATTR_INTF_NUM |
Board number for the given interface. |
VI_ATTR_INTF_TYPE |
Interface type of the given session. |
VI_ATTR_TMO_VALUE |
Minimum timeout value to use, in milliseconds. A timeout value of VI_TMO_IMMEDIATE means that operations should never wait for the device to respond. A timeout value of VI_TMO_INFINITE disables the timeout mechanism. |
VXI and GPIB-VXI and PXI Specific MEMACC Resource Attributes |
|
VI_ATTR_DEST_INCREMENT |
This is used in the viMoveOutXX operation to specify how much the destination offset is to be incremented after every transfer. The default value of this attribute is 1 (that is, the destination address will be incremented by 1 after each transfer), and the viMoveOutXX operation moves into consecutive elements. If this attribute is set to 0, the viMoveOutXX operation will always write to the same element, essentially treating the destination as a FIFO register. |
VI_ATTR_SRC_INCREMENT |
This is used in the viMoveInXX operation to specify how much the source offset is to be incremented after every transfer. The default value of this attribute is 1 (that is, the source address will be incremented by 1 after each transfer), and the viMoveInXX operation moves from consecutive elements. If this attribute is set to 0, the viMoveInXX operation will always read from the same element, essentially treating the source as a FIFO register. |
VI_ATTR_WIN_ACCESS |
Modes in which the current window may be accessed: not currently mapped, through operations viPeekXX and viPokeXX only, or through operations and/or by directly dereferencing the address parameter as a pointer. |
VI_ATTR_WIN_BASE_ADDR_32 |
Base address of the interface bus to which this window is mapped. |
VI_ATTR_WIN_SIZE_32 |
Size of the region mapped to this window. |
GPIB-VXI Specific MEMACC Resource Attributes |
|
VI_ATTR_GPIB_PRIMARY_ADDR |
Primary address of the GPIB-VXI controller used by the given session. |
VI_ATTR_GPIB_SECONDARY_ADDR |
Secondary address of the GPIB-VXI controller used by the given session. |
VI_ATTR_INTF_PARENT_NUM |
Board number of the GPIB board to which the GPIB-VXI is attached. |
MEMACC Resource Events
This resource defines the following event for communication with applications, where AP = Access Privilege.
VI_EVENT_IO_COMPLETION - Notification that an asynchronous operation has completed.
Event Attribute |
Description |
AP |
Data Type |
Range |
Address of a buffer that was used in an asynchronous operation. |
RO |
ViBuf |
N/A |
|
Unique logical identifier of the event. |
RO |
ViEventType |
VI_EVENT_IO_COMPLETION |
|
|
Job ID of the asynchronous operation that has completed. |
RO |
iJobId |
N/A |
Name of the operation generating the event. |
RO |
iString |
N/A |
|
Return code of the asynchronous I/O operation that has completed. |
RO |
iStatus |
N/A |
|
Actual number of elements that were asynchronously transferred. |
RO |
ViBus Size |
* |
|
Actual number of elements that were asynchronously transferred. |
RO |
ViUInt32 |
0 to FFFFFFFFh |
|
Actual number of elements that were asynchronously transferred. |
RO |
ViUInt64 |
0 to FFFFFFFF FFFFFFFFh |
*The data type is defined in the appropriate VPP 4.3.x framework specification.
**Defined only for operating systems that are 64-bit native.
MEMACC Resource Operations
viIn8 (vi, space, offset, val8)
viIn16 (vi, space, offset, val16)
viIn32 (vi, space, offset, val32)
viIn64 (vi, space, offset, val64)
viMapAddress (vi, mapSpace, mapBase, mapSize, access, suggested, address)
viMapAddressEx (vi, mapSpace, mapBase64, mapSize, access, suggested, address)
viMemAlloc(vi, size, offset)
viMemFree(vi, offset)
viMemAllocEx(vi, size, offset64)
viMemFreeEx(vi, offset64)
viMove (vi, srcSpace, srcOffset, srcWidth, destSpace, destOffset, destWidth, length)
viMovEx (vi, srcSpace, srcOffset64, srcWidth, destSpace, destOffset64, destWidth, length)
viMoveAsync (vi, srcSpace, srcOffset, srcWidth, destSpace, destOffset, destWidth, length, jobId)
viMoveAsyncEx (vi, srcSpace, srcOffset64, srcWidth, destSpace, destOffset64, destWidth, length, jobId)
viMoveIn8 (vi, space, offset, length, buf8)
viMoveIn16 (vi, space, offset, length, buf16)
viMoveIn32 (vi, space, offset, length, buf32)
viMoveIn64 (vi, space, offset, length, buf64)
viMoveIn8Ex (vi, space, offset64, length, buf8)
viMoveIn16Ex (vi, space, offset64, length, buf16)
viMoveIn32Ex (vi, space, offset64, length, buf32)
viMoveIn64Ex (vi, space, offset64, length, buf64)
viMoveOut8 (vi, space, offset, length, buf8)
viMoveOut16 (vi, space, offset, length, buf16)
viMoveOut32 (vi, space, offset, length, buf32)
viMoveOut64 (vi, space, offset, length, buf64)
viMoveOut8Ex (vi, space, offset64, length, buf8)
viMoveOut16Ex (vi, space, offset64, length, buf16)
viMoveOut32Ex (vi, space, offset64, length, buf32)
viMoveOut64Ex (vi, space, offse64, length, buf64)
viOut8 (vi, space, offset, val8)
viOut16 (vi, space, offset, val16)
viOut32 (vi, space, offset, val32)
viOut64 (vi, space, offset, val64)