viMoveIn8, viMoveIn16, viMoveIn32, and viMoveIn64
This section contains information specific to the Windows product.
Syntax
viMoveIn8(ViSession vi, ViUInt16 space, ViBusAddress offset, ViBusSize length, ViAUInt8 buf8);
viMoveIn16(ViSession vi, ViUInt16 space, ViBusAddress offset, ViBusSize length, ViAUInt16 buf16);
viMoveIn32(ViSession vi, ViUInt16 space, ViBusAddress offset, ViBusSize length, ViAUInt32 buf32);
viMoveIn64(ViSession vi, ViUInt16 space, ViBusAddress offset, ViBusSize length, ViAUInt64 buf64); [VISA 4.0 and later]
Description
This function moves an 8-bit, 16-bit, 32-bit, or 64-bit block of data from the specified memory space (assigned memory base + offset) to local memory. This function reads the 8-bit, 16-bit, 32-bit, or 64-bit value from the address space pointed to by space. The offset must be a valid memory address in the space. These functions do not require viMapAddress to be called prior to their invocation.
If the ViSession parameter (vi) refers to an INSTR session, the offset parameters specify relative offsets from the start of the instrument’s address space. If the ViSession parameter (vi) refers to a MEMACC session, the offset parameters are absolute offsets from the start of memory in the specified VXI address space.
Valid entries for specifying address space:
Value |
Description |
---|---|
VI_A16_SPACE |
Address A16 memory address space of the VXI/MXI bus. |
VI_A24_SPACE |
Address A24 memory address space of the VXI/MXI bus. |
VI_A32_SPACE |
Address A32 memory address space of the 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. |
These functions do a block move of memory from a VXI device if VI_ATTR_SRC_INCREMENT is 1. However, they do a FIFO read of a VXI memory location if VI_ATTR_SRC_INCREMENT is 0 (zero).
The high-level operations viIn8, viIn16, viIn32, and viIn64 operate independently from the low-level operations (viMapAddress, viPeek8, viPeek16, viPeek32, viPeek64, viPoke8, viPoke16, viPoke32, and viPoke64).
The high-level and low-level operations are independent regardless of the configured state of the hardware that is used to perform memory accesses.
For an INSTR resource, the offset is a relative address of the device associated with the given INSTR resource. For a MEMACC resource, the offset parameter specifies an absolute address.
All operations on a PXI MEMACC resource that accept a space parameter to indicate the address space for bus access SHALL accept the following value for the space parameter: VI_PXI_ALLOC_SPACE.
The offset specified in the viMoveIn8, viMoveIn16, and viMoveIn32 operations 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 space specifies VI_A16_SPACE, offset specifies the offset from the logical address base address of the VXI device specified. If space specifies VI_A24_SPACE, VI_A32_SPACE, or VI_A64_SPACE offset 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.
The length specified in the viMoveInXX operations is the number of elements (of the size corresponding to the operation) to transfer, beginning at the specified offset. Therefore, offset + length*size cannot exceed the amount of memory exported by the device in the given space.
The length specified in the viMoveInXX operations is the number of elements (of the size corresponding to the operation) to transfer, beginning at the specified offset. Therefore, offset + length*size cannot exceed the total amount of memory available in the given space.
Parameters
Name |
Dir |
Type |
Description |
---|---|---|---|
vi |
IN |
ViSession |
Unique logical identifier to a session. |
space |
IN |
ViUInt16 |
Specifies the address space. (See the following table.) |
offset |
IN |
ViBusAddress |
Offset (in bytes) of the starting address or register to read from. |
length |
IN |
ViBusSize |
Number of elements to transfer, where the data width of the elements to transfer is 8 bits for viMoveIn8, 16 bits for viMoveIn16, 32 bits for viMoveIn32, and 64 bits for viMoveIn64 . |
buf8, buf16, buf32, or buf64 |
OUT |
ViAUInt8, ViAUInt16, ViAUInt32, or ViAUInt64 |
Data read from bus (8 bits for viMoveIn8, 16 bits for viMoveIn16, 32 bits for viMoveIn32, and 64 bits for viMoveIn64). |
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 |
Operation completed successfully. |
Error Code |
Description |
VI_ERROR_BERR |
Bus error occurred during transfer. |
VI_ERROR_INV_LENGTH |
Invalid length specified. |
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 setup is invalid (due to attributes being set to an inconsistent state). |
VI_ERROR_INV_SPACE |
Invalid address space specified. |
VI_ERROR_NSUP_ALIGN_OFFSET |
The specified offset is not properly aligned for the access width of the operation. |
VI_ERROR_NSUP_OFFSET |
Specified offset is not accessible from this hardware. |
VI_ERROR_NSUP_OPER |
The given vi does not support this function. |
VI_ERROR_NSUP_WIDTH |
Specified width is not supported by this hardware. |
VI_ERROR_RSRC_LOCKED |
Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. |
See Also
viMoveOut8, viMoveOut16, viMoveOut32, viMoveOut64, viIn8, viIn16, viIn32, viIn64