November 1985
Appendix H
Sample Program
National Instruments
This appendix contains general progr
steps and a sample
program. These are meant to be guides for you as you start writing
your programs for the GPIB-MAC.
General Steps
The steps below are general programming steps. The following
pages contain explanations of these steps and show a sample
program.
Step 1
step 2
step 3
step 4
Send stat function to have status information returned
to you after your programming message.
Send serial port initialization functions if you need to
change default serial port settings.
Send GPIB initialization functions if you need to
change default GPIB settings.
Communicate with the device using the rd and
functions, and check status if you requested it.
After you initialize the GPIB-MAC, the rd and
functions may
be the only functions you will need.
Using an HP 7475A Plotter with a Macintosh
This example shows how to write a program on the Macintosh using
Microsoft BASIC to draw a circle using an HP 7475A Plotter.
Getting Ready to Program
Before you start programming, determine the serial port settings you
will use. The settings for this example are: 9600 baud rate, 8 data
123
APPENDIX H
PROGRAM