viMove

Agilent VISA.NET

viMove

Syntax

viMove(ViSession vi, ViUInt16 srcSpace, ViBusAddress srcOffset, viUInt16 srcWidth, ViUInt16 destSpace, ViBusAddress destOffset, ViUInt16 destWidth, ViBusSize length);

Description

This operation moves data from the specified source to the specified destination. The source and the destination can either be local memory or the offset of the interface with which this INSTR or MEMACC resource is associated. This operation uses the specified data width and address space.

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_LOCAL_SPACE

Address the process-local memory (using virtual address).

VI_OPAQUE_SPACE

Addresses potentially volatile data (using a virtual address).

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.

Valid entries for specifying widths:

Value

Description

VI_WIDTH_8

Performs an 8-bit (D08) transfer.

VI_WIDTH_16

Performs a 16-bit (D16) transfer.

VI_WIDTH_32

Performs a 32-bit (D32) transfer.

VI_WIDTH_64

Performs a 64-bit (D64) transfer.

The high-level operation viMove operates successfully 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.  

The length specified in the viMove operation 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.

If srcSpace is not VI_LOCAL_SPACE, srcOffset is a relative address of the device associated with the given INSTR resource. Similarly, if destspace is not VI_LOCAL_SPACE, destOffset is a relative address of the device associated with the given INSTR resource. srcOffset and destOffset specified in the viMove operation for a MEMACC resource are absolute addresses. 

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

srcSpace

IN

ViUInt16

Specifies the address space of the source.

srcOffset

IN

ViBusAddress

Offset of the starting address or register from which to read.

srcWidth

IN

ViUInt16

Specifies the data width of the source.

destSpace

IN

ViUInt16

Specifies the address space of the destination.

destOffset

IN

ViBusAddress

Offset of the starting address or register to which to write..

destWidth

IN

ViUInt16

Specifies the data width of the destination.

length

IN

ViBusSize

Number of data elements to transfer, where the data width of the elements to transfer is identical to the source data width.

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 Codes

Description

VI_ERROR_BERR

Bus Error occurred during transfer.

VI_ERROR_INV_LENGTH

Invalid length specified.

VI_ERROR_INV_OFFSET

Invalid source or destination offset specified.

VI_ERROR_INV_SESSION
VI_ERROR_OBJECT

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 source or destination address specified.

VI_ERROR_INV_WIDTH

Invalid source or destination width specified.

VI_ERROR_NSUP_ALIGH_OFFSET

The specified offset is not properly aligned for the access width of the operation.

VI_ERROR_NSUP_OFFSET

Specified source or destination offset is not accessible from this hardware.

VI_ERROR_NSUP_OPER

The given vi does not support this operation.

VI_ERROR_NSUP_VAR_WIDTH

Cannot support source and destination widths that are different.

VI_ERROR_NSUP_WIDTH

Specified width is not supported.

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

viMoveAsync. Also, see the MEMACC Resource description.