
Programming Examples
Fast Measurements (Example #3)
Sample program to perform fast measurements on the instrument using GET,
DISP:ENAB OFF and FORMAT REAL. Written for National AT-GPIB/TNT for
Windows NT and later.
/*
**
** Sample program to perform fast measurements on the instrument
** using GET, DISP:ENAB OFF and FORMAT REAL
**
** 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;
typedef union {
double d;
char c[8];
} r2d;
void main() {
int address = 10;
int i, j, instrument; /*
fi
le descriptor for instrument */
char reading[30];
char buf[100];
r2d Result;
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);
}
sleep(100);
ibclr(instrument);
sleep(100);
ibwrite(instrument, “*idn?”);
ibrd(instrument, buf, 100L); buf[ibcnt]=0;
printf(“instrument identi
fi
cation string: %s\n”, buf);
printf(“Setup\n”);
if ((instrument = ibdev(0, address, 0, T3s, 1, 0)) < 0) {
printf(“Could not connect to instrument”);
exit(1);
}
// Reset instrument to known state
ibwrite(instrument, “*rst;*cls”);
4-6
FCA3000, FCA3100, MCA3000 Series Programmer Manual
Содержание FCA3000 Series
Страница 2: ......
Страница 8: ...Preface iv FCA3000 FCA3100 MCA3000 Series Programmer Manual ...
Страница 9: ...Getting Started ...
Страница 10: ......
Страница 14: ...Using the USB Interface 1 4 FCA3000 FCA3100 MCA3000 Series Programmer Manual ...
Страница 15: ...Syntax and Commands ...
Страница 16: ......
Страница 26: ...Command Syntax 2 10 FCA3000 FCA3100 MCA3000 Series Programmer Manual ...
Страница 135: ...Status and Events ...
Страница 136: ......
Страница 156: ...Status and Events 3 20 FCA3000 FCA3100 MCA3000 Series Programmer Manual ...
Страница 157: ...Programming Examples ...
Страница 158: ......
Страница 179: ...Appendices ...
Страница 180: ......
Страница 181: ...Appendix A Character Set FCA3000 FCA3100 MCA3000 Series Programmer Manual A 1 ...
Страница 182: ...Appendix A Character Set A 2 FCA3000 FCA3100 MCA3000 Series Programmer Manual ...
Страница 188: ...Appendix D Reserved Words D 2 FCA3000 FCA3100 MCA3000 Series Programmer Manual ...