Agilent Technologies E2094S Guía de usuario Pagina 97

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 146
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 96
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);
Vista de pagina 96
1 2 ... 92 93 94 95 96 97 98 99 100 101 102 ... 145 146

Comentarios a estos manuales

Sin comentarios