High-Level Memory Functions: Sample Programs - Agilent Technologies E2094S User Manual

For io libraries suite 15.5
Table of Contents

Advertisement

4
Programming via GPIB and VXI

High-Level Memory Functions: Sample Programs

90
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
and
viMoveIn
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.
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.
viMoveOut
Agilent VISA User's Guide

Advertisement

Table of Contents
loading

Table of Contents