viOut8, viOut16, viOut32, and viOut64
This section contains information specific to the Windows product.
Syntax
viOut8(ViSession vi, ViUInt16 space, ViBusAddress offset, ViUInt8 buf8);
viOut16(ViSession vi, ViUInt16 space, ViBusAddress offset, ViUInt16 buf16);
viOut32(ViSession vi, ViUInt16 space, ViBusAddress offset, ViUInt32 buf32);
viOut64(ViSession vi, ViUInt16 space, ViBusAddress offset, ViUInt64 buf64); [VISA 4.0 and later]
Description
This function writes an 8-bit, 16-bit, 32-bit, or 64-bit word to the specified memory space (assigned memory base + offset). This function takes the 8-bit, 16-bit, 32-bit, or 64-bit value and stores its contents to the address space pointed to by space. The offset must be a valid memory address in the space. This function does not require viMapAddress to be called prior to its invocation.
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.
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. |
The high-level operations viOut8, viOut16, viOut32, and viOut64 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 viOut8, viOut16, viOut32, and viOut64 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 starting address or register to write to. |
buf8, buf16, buf32, or buf64 |
IN |
ViUInt8, ViUInt16, ViUInt32, ViUInt64 |
Data written to bus (8 bits for viOut8, 16 bits for viOut16, 32 bits for viOut32, and 64 bits for viOut64). |
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_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
viIn8, viIn16, viIn32, viIn64, viPoke8, viPoke16, viPoke32, viPoke64, viMoveOut8, viMoveOut16, viMoveOut32, viMoveOut64