viPeek8/viPeek16/viPeek32/viPeek64

NI-VISA

viPeek8/viPeek16/viPeek32/viPeek64

Purpose

Reads an 8-bit, 16-bit, 32-bit, or 64-bit value from the specified address.

C Syntax

void viPeek8(ViSession vi, ViAddr addr, ViPUInt8 val8)

void viPeek16(ViSession vi, ViAddr addr, ViPUInt16 val16)

void viPeek32(ViSession vi, ViAddr addr, ViPUInt32 val32)

void viPeek64(ViSession vi, ViAddr addr, ViPUInt64 val64)

Visual Basic Syntax

viPeek8(ByVal vi&, ByVal addr&, val8 as Byte)

viPeek16(ByVal vi&, ByVal addr&, val16%)

viPeek32(ByVal vi&, ByVal addr&, val32&)

Resource Classes

FireWire INSTR, GPIB-VXI INSTR, GPIB-VXI MEMACC, PXI INSTR, PXI MEMACC, VXI INSTR, VXI MEMACC

Parameters

Name Direction Description

vi

IN

Unique logical identifier to a session.

addr

IN

Source address to read the value.

val8, val16, val32, or val64

OUT

Data read from bus (8 bits for viPeek8(), 16 bits for viPeek16(), 32 bits for viPeek32(), and 64 bits for viPeek64()).

Return Values

None

Description

The viPeekXX() operations read an 8-bit, 16-bit, 32-bit value, or 64-bit value, respectively, from the address location specified in addr. The address must be a valid memory address in the current process mapped by a previous viMapAddress() call.

To specify the full 48-bit offset for these methods on a FireWire INSTR session, a call to viSetAttribute using VI_ATTR_FIREWIRE_WIN_UPPER_OFFSET is needed prior to calling these methods. Subsequent calls to viSetAttribute are needed only if the upper 16 bits of the FireWire offset change.

Note Note  If you use NI Spy to debug these operations, enable the Force peek/poke calls to appear in NI Spy option in Measurement & Automation Explorer (Windows), visaconf (Linux), or NI-VISA Configuration (Mac OS X). If you do not enable this option, NI Spy might not log these operations.

Related Topics

INSTR Resource

MEMACC Resource

VI_ATTR_FIREWIRE_WIN_UPPER_OFFSET

VI_ATTR_WIN_ACCESS

viMapAddress/viMapAddressEx

viPoke8/viPoke16/viPoke32/viPoke64