Agilent Technologies FS2010 Guía de usuario Pagina 112

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 111
112 Agilent VISA User’s Guide
4 Programming via GPIB and VXI
/* 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);
/* Read device type register contents */
/* ViAddr is defined as a void so we must cast
/* it to something else to do pointer
arithmetic */
viPeek16(dmm, (ViAddr)((ViUInt16 *)address +
0x01),
&devtype_reg);
/* Unmap memory space */
viUnmapAddress(dmm);
/* Print results */
printf ("ID Register = 0x%4X\n", id_reg);
printf ("Device Type Register = 0x%4X\n",
devtype_reg);
/* Close sessions */
viClose(dmm);
viClose(defaultRM);
}
Sample: Using the GPIB-VXI Interface (Low-Level) Memory
Functions
This program uses low- level memory functions and the
GPIB- VXI interface to read the ID and Device Type registers
of a device at GPIB- VXI0::24.
/*gpibvxil.c
This example program uses the low-level memory
functions to read the id and device type
Vista de pagina 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 159 160

Comentarios a estos manuales

Sin comentarios