1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#include "visa.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("Hello");
ViSession defaultRM, vi;
char buf [256] = {0};
/* Open session to GPIB device at address 22 */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::20::INSTR", VI_NULL,VI_NULL, &vi);
/* Initialize device */
viPrintf (vi, "*RST\n");
/* Send an *IDN? string to the device */
viPrintf (vi, "*IDN?\n");
/* Read results */
viScanf (vi, "%t", &buf);
/* Print results */
printf ("Instrument identification string: %s\n", buf);
/* Close session */
viClose (vi);
viClose (defaultRM);
getch();
return (0);
} |
Partager