
96
Agilent VISA User’s Guide
4
Programming via GPIB and VXI
/* Maps to A24 address space */
viMapAddress(vi, VI_A24_SPACE, 0x00, 0x80,
VI_FALSE,
VI_NULL,&address);
Reading and Writing to Device Registers
When you have mapped the memory space, use the VISA low-level
memory functions to access the device's registers. First, determine
which device register you need to access. Then, you need to know the
register's offset. See the applicable instrument’s user manual for a
description of the registers and register locations. You can then use this
information and the VISA low-level functions to access the device
registers.
Sample: Using
viPeek16
A code sample using
viPeek16
follows.
ViSession defaultRM, vi;
ViUInt16 value;
ViAddr address;
ViUInt16 value;
.
.
viOpenDefaultRM(&&defaultRM);
viOpen(defaultRM, "VXI::24::INSTR", VI_NULL,
VI_NULL,
&vi);
viMapAddress(vi, VI_A16_SPACE, 0x00, 0x04,
VI_FALSE,
VI_NULL, &address);
viPeek16(vi, addr, &value)
Unmapping Memory Space
Make sure you use the
viUnmapAddress
function to unmap the
memory space when it is no longer needed. Unmapping memory space
makes the window available for the system to reallocate.
Содержание E2094S
Страница 6: ...6 Agilent VISA User s Guide ...
Страница 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Страница 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Страница 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...
Страница 144: ...144 Agilent VISA User s Guide Glossary ...