User`s guide
104 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.