Appendix I
Programming Steps and Examples
I-10
www.ni.com
170
'Scale the plotting area.
175
WRT$=WRT$ + "PA50,-40;CI30,30;"
180
'Plot absolute, circle=radius
185
'30 degrees, chordangle 30
190
'degrees.
200
CALL IBWRT(PLOTTER%,WRT$)
205
STOP
210
PRINT "An error occurred:"
215
PRINT "status, GPIB-error, serial-error,
220
count:";RD$
230
END
Controlling a Serial Printer with an IBM PC
This example demonstrates how to control a serial printer on the GPIB.
The printer is the Apple Imagewriter. The Controller is an IBM PC with an
AT-GPIB interface installed. The following program example prints the
message
Hello, world
.
Preparing to Program
1.
Set the GPIB-232/485CT-A configuration switch to primary address
18, as shown in Figure I-4.
Figure I-4.
Sample Switch Settings for an IBM PC and Serial Printer
2.
Check the DIP switch settings on the Imagewriter. Switches 2–1 and
2–2 should be closed for 9600 baud rate.
1 2 3 4 5 6 7 8 ON
OFF
S MODE
DATA FORMAT
BAUD RATE
GPIB ADDRESS
G MODE