
Programming via GPIB and VXI
4
Agilent VISA User’s Guide
97
Low-Level Memory Functions: Code Samples
Two sample programs follow that use the low-level memory functions
to read the ID and Device Type registers of the device at VXI logical
address 24. The contents of the registers are then printed out. The first
program uses the VXI interface and the second program uses the
GPIB-VXI interface to access the VXI backplane. These two programs
are identical except for the string passed to
viOpen
.
Sample: Using the VXI Interface (Low-Level) Memory
Functions
This program uses low-level memory functions and the VXI interface to
read the ID and Device Type registers of a device at VXI0::24.
/*vxill.c
This example program uses the low-level memory
functions to read the id and device type
registers of the device at VXI0::24. Change this
address if necessary. The register contents are
then displayed.*/
#include <visa.h>
#include <stdlib.h>
#include <stdio.h>
void main () {
ViSession defaultRM, dmm;
ViAddr address;
unsigned short id_reg, devtype_reg;
/* Open session to VXI device at address 24 */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "VXI0::24::INSTR", VI_NULL,
VI_NULL, &dmm);
/* Map into memory space */
viMapAddress(dmm, VI_A16_SPACE, 0x00, 0x10,
VI_FALSE,VI_NULL, &address);
/* Read instrument id register contents */
viPeek16(dmm, address, &id_reg);
Содержание 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 ...