Block Measurements (Ex. #2)
Sample program to perform fast measurements on the '9X' using block measurements.
Written for National AT-GPIB/TNT for Windows NT and later.
/*
**
** Sample program to perform fast measurements on the '9X'
** using block measurements
**
** Written for National AT-GPIB/TNT for Windows NT and later
*/
#include <windows.h>
#include <stdio.h>
#include <time.h>
#include “decl-32.h”
void ibwrite(int counter, const char *string);
void sleep (long mswait);
time_t StartMain, Start, Stop, StopMain;
void main() {
int address = 10;
int i, j, counter; /* file descriptor for counter */
char bigbuf[30000], *pbuf; char buf[100];
char Status;
printf (“Connecting to the '9X' on address %d using
National Instruments GPIB card.\n”, address);
if ((counter = ibdev(0, address, 0, T10s, 1, 0)) < 0) {
printf(“Could not connect to counter”);
exit(1);
}
ibclr(counter);
do {
ibwrite(counter, “syst:err?”);
ibrd(counter, buf, 100L); buf[ibcnt]=0;
printf(“Errors before start: %s\n”, buf);
} while (atoi(buf)!=0);
ibwrite(counter, “*idn?”);
ibrd(counter, buf, 100L); buf[ibcnt]=0; printf(“Counter
identification string: %s\n”, buf);
printf(“Setup\n”);
Programming Examples
Block Measurements (Ex. #2) 4-5