
90
Agilent VISA User’s Guide
4
Programming via GPIB and VXI
The
val32
parameter is a pointer to where the data read will be stored. If
instead you write to the registers via the
viOut32
function, the
val32
parameter is a pointer to the data to write to the specified registers. If the
device specified by
vi
does not have memory in the specified address
space, an error is returned. The following code sample uses
viIn16
.
ViSession defaultRM, vi;
ViUInt16 value;
.
viOpenDefaultRM(&&defaultRM);
viOpen(defaultRM, "VXI::24", VI_NULL, VI_NULL,
&vi);
viIn16(vi, VI_A16_SPACE, 0x100, &value);
Using
viMoveIn
and
viMoveOut
You can also use the
viMoveIn
and
viMoveOut
high-level memory
functions to move blocks of data to or from local memory. Specifically,
the
viMoveIn
function moves an 8-, 16-, or 32-bit block of data from
the specified offset to local memory, and the
viMoveOut
functions
moves an 8-, 16-, or 32-bit block of data from local memory to the
specified offset. Again, the memory mapping is done for you.
For example, in this function:
viMoveIn32(
vi, space, offset, length, buf32
);
vi
is the session identifier and
offset
is used to indicate the offset of the
memory to be mapped.
offset
is relative to the location of this device's
memory in the given address space. The
space
parameter determines
which memory location to map the space and the
length
parameter
specifies the number of elements to transfer (8-, 16-, or 32-bits).
The
buf32
parameter is a pointer to where the data read will be stored. If
instead you write to the registers via the
viMoveOut32
function, the
buf32
parameter is a pointer to the data to write to the specified
registers.
High-Level Memory Functions: Sample Programs
Two sample programs follow that use the high-level memory functions
to read the ID and Device Type registers of a device at the VXI logical
address 24. The contents of the registers are then printed out.
Summary of Contents for E2094S
Page 6: ...6 Agilent VISA User s Guide ...
Page 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Page 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Page 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...