Agilent Technologies FS2010 User's Guide Page 56

  • Download
  • Add to my manuals
  • Print
  • Page
    / 160
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 55
56 Agilent VISA User’s Guide
3 Programming with VISA
#include <visa.h>
#include <stdio.h>
void main () {
ViSession defaultRM, vi;
char strres [20];
unsigned long actual;
/* Open session to GPIB device at address 22 */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "GPIB0::22::INSTR",
VI_NULL,VI_NULL, &vi);
/* Initialize device */
viWrite(vi, (ViBuf)"*RST\n", 5, &actual);
/* Set up device and take measurement */
viWrite(vi, (ViBuf)"CALC:DBM:REF 50\n", 16,
&actual);
viWrite(vi, (ViBuf)"MEAS:VOLT:AC? 1, 0.001\n",
23, &actual);
/* Read results */
viRead(vi, (ViBuf)strres, 20, &actual);
/* NULL terminate the string */
strres[actual]=0;
/* Print results */
printf("Measurement Results: %s\n", strres);
/* Close session */
viClose(vi);
viClose(defaultRM);
}
Page view 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 159 160

Comments to this Manuals

No comments