Agilent Technologies E2094S Guide de l'utilisateur Page 91

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 146
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 90
Programming via GPIB and VXI 4
Agilent VISA User’s Guide 91
The first program uses the VXI interface; the second program accesses
the backplane with the GPIB-VXI interface. These two programs are
identical except for the string passed to viOpen.
Sample: Using VXI Interface (High-Level) Memory
Functions
This program uses high-level memory functions and the VXI interface
to read the ID and Device Type registers of a device at VXI0::24.
/* vxihl.c
This example program uses the high-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;
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);
/* Read instrument id register contents */
viIn16(dmm, VI_A16_SPACE, 0x00, &id_reg);
/* Read device type register contents */
viIn16(dmm, VI_A16_SPACE, 0x02,
&devtype_reg);
/* Print results */
printf ("ID Register = 0x%4X\n", id_reg);
printf ("Device Type Register = 0x%4X\n",
devtype_reg);
Vue de la page 90
1 2 ... 86 87 88 89 90 91 92 93 94 95 96 ... 145 146

Commentaires sur ces manuels

Pas de commentaire