Appendix C
Application Examples
©
National Instruments Corporation
C-3
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-A, the data transfer should
complete in a few seconds.
Connecting a HP7475 GPIB Plotter to a PC Serial Port
Many software packages provide printing and plotting utilities which use
your computer’s serial port. If GPIB support is not specifically provided in
the package, you cannot communicate with a GPIB device. By using the
GPIB-232CV-A, you can avoid this situation because the GPIB-232CV-A
allows communication between the serial port and GPIB devices.
For example, an IBM PC running AUTOCAD sends data to the plotter by
transferring data through the computer's serial port. It cannot send data to a
GPIB plotter such as the HP7475 GPIB plotter. Because AUTOCAD
supports the HP7475 serial plotter, you can use the GPIB-232CV-A to
convert the serial data from AUTOCAD into GPIB data for the plotter. The
GPIB-232CV-A automatically takes care of the GPIB addressing and
transparently converts the data from one format to the other. To use the
GPIB-232CV-A in this way, follow these steps:
1.
Start AUTOCAD and select Configure AUTOCAD from the Main
Menu. Select the HP7475 plotter and configure the rest of the
operating parameters that you need.
2.
Configure your GPIB-232CV-A. Set it to operate in C mode with
timeout termination. Set the GPIB address of the plotter using the