Programming Examples
Block Measurements (Example #2)
4-4
Sample program to perform fast measurements on the instrument using block
measurements. Written for National AT-GPIB/TNT for Windows NT and later.
/*
**
** Sample program to perform fast measurements on the instrument
** 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 instrument, const char *string);
void sleep (long mswait);
time_t StartMain, Start, Stop, StopMain;
void main() {
int address = 10;
int i, j, instrument; /* file descriptor for instrument */
charbigbuf[30000], *pbuf; charbuf[100];
char Status;
printf ("Connecting to the instrument on address %d using National Instruments
GPIB card.\n", address);
if ((instrument = ibdev(0, address, 0, T10s, 1, 0)) < 0) {
printf("Could not connect to instrument");
exit(1);
}
ibclr(instrument);
do {
ibwrite(instrument, "syst:err?");
ibrd(instrument, buf, 100L); buf[ibcnt]=0;
printf("Errors before start: %s\n", buf);
} while (atoi(buf)!=0);
ibwrite(instrument, "*idn?");
ibrd(instrument, buf, 100L); buf[ibcnt]=0; printf("instrument identification
string: %s\n", buf);
printf("Setup\n");
// Reset instrument to known state
ibwrite(instrument, "*rst;*cls");
// Setup for period measurement
ibwrite(instrument, "FUNC 'PER 1'");
// Some settings...
ibwrite(instrument, "INP:LEV:AUTO OFF;:INP:LEV 0;COUP DC");
ibwrite(instrument, "TRIG:COUNT 1000;:ARM:COUNT 1");
ibwrite(instrument, "DISP:ENAB ON"); ibwrite(instrument, "FORMAT
ASCII;:FORMAT:TINF OFF");
FCA3000, FCA3100, MCA3000 Series Programmer Manual
Need help?
Do you have a question about the FCA3000 and is the answer not in the manual?