viIn8, viIn16, viIn32, and viIn64

Agilent VISA.NET

viIn8, viIn16, viIn32, and viIn64

Syntax

viIn8(ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt8 val8);

viIn16(ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt16 val16);

viIn32(ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt32 val32);

viIn64(ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt64 val64);   [VISA 4.0 and later]

Description

This operation, by using the specified address space, reads in 8, 16, 32 or 64 bits of data from the specified offset. This operation does not require viMapAddress to be called prior to its invocation. This function reads in an 8-bit, 16-bit, 32-bit or 64-bit value from the specified memory space (assigned memory base + offset). This function takes 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.

If the ViSession parameter (vi) refers to an INSTR session, the offset parameter specifies a relative offset from the start of the instrument’s address space. If the ViSession parameter (vi) refers to a MEMACC session, the offset parameter is an absolute offset from the start of memory in that VXI address space. The valid entries for specifying address space are:

Value

Description

VI_A16_SPACE

Address the A16 address space of VXI/MXI bus.

VI_A24_SPACE

Address the A24 address space of VXI/MXI bus.

VI_A32_SPACE

Address 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.

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. The offset specified in the viIn8, viIn16, viIn32 , and viIn64 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.

 

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 memory to read from.

val8, val16, val32, or val64

OUT

ViPUInt8, ViPUInt16, ViPUInt32, or ViPUInt64

Data read from bus (8 bits for viIn8, 16 bits for viIn16, 32 bits for viIn32, or 64 bits for viIn64).

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_OFFSET

Invalid offset specified.

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

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 operation.

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

viOut8, viOut16, viOut32viOut64, viPeek8, viPeek16, viPeek32viPeek64, viMoveIn8, viMoveIn16, viMoveIn32, viMoveIn64