Appendix C
Application Examples
© National Instruments Corp.
C-3
GPIB-232CV User Manual
/* FASTPRINT - dumps specified data file out GPIB
to device named printer */
#include "decl.h"
#include <stdio.h>
main (argc, argv)
char **argv;
{
char fname [16],*filename;
int f;
/* prompt for file name if not provided */
if (argc <=1) {
printf ("Enter filename: ");
gets (fname);
filename = fname;
}
else
filename = argv[1]
/* find device printer */
if ((f = ibfind ("printer"))<0) {
fprintf(stderr, "Can't find printer\n");
exit(1);
}
/* write file */
if (ibwrtf(f, filename) & ERR) {
fprintf(stderr, "Can't open %s\n", argv[1]);
exit(1);
}
}
After the program is compiled and linked, you can run it just like the DOS
print routine. Then, as long as you are not sending an amount of data
greater than the buffer size of the GPIB-232CV, the data transfer should
complete in a few seconds.
Содержание GPIB-232CV
Страница 55: ......