Chapter 7 7-103
Programming Examples
Report Generation Examples
If a problem arises with the plotter, such as no pen or paper, the analyzer cannot detect the
situation because it only has a one-way path of communication. Hence, the analyzer will
attempt to continue plotting until the operator intervenes and aborts the plot by pressing
the analyzer's key.
Pressing will do the following:
• Aborts the plot.
• Causes the warning message CAUTION: PLOT ABORTED.
• Asserts EOI to return control of the bus to the system controller.
Because of possible peripheral malfunctions, it is generally advisable to use pass-control
mode, which allows two way communication between the peripherals and the analyzer.
BASIC Program Listing
10 ! This example shows a plot operation under the control of the
20 ! analyzer. The analyzer is commanded to output plot data, the
30 ! plotter is addressed to listen, and the analyzer to talk. The
40 ! controller watches for EOI at the end of the plot sequence and
50 ! then regains control of the HP-IB operations.
60 !
70 ! EXAMP7A
80 !
90 ASSIGN @Nwa TO 716 ! Assign an I/O path for the analyzer
100 !
110 CLEAR SCREEN
120 ! Initialize analzyer without preset to preserve data
130 ABORT 7 ! Generate an IFC ( Interface Clear)
140 CLEAR @Nwa ! SDC (Selected Device Clear)
150 !
160 OUTPUT @Nwa;”OPC?;SING;” ! Stop sweep and prepare for plot
170 ENTER @Nwa;Reply ! Read in “1” when completed
180 !
190 OUTPUT @Nwa;”OUTPPLOT;” ! Send plot command
200 SEND 7;UNL LISTEN 5 TALK 16 DATA ! Unlisten address devices and plot
210 DISP “Plotting and waiting for EOI”
220 WAIT .5 ! Pause 500 mS to start process
230 !
240 REPEAT ! Loop until EOI detected bit is set
250 STATUS 7,7;Stat ! Read HP-IB interface register 7
260 UNTIL BIT(Stat,11) ! Test bit 11 EOI on HP-IB
270 !
280 End_plot:DISP “End of plot”
290 !
300 OUTPUT @Nwa;”CONT;” ! Restore continuous sweep
310 OUTPUT @Nwa;”OPC?;WAIT;” ! Wait for analyzer to finish
320 ENTER @Nwa;Reply ! Read the 1 when complete
330 LOCAL @Nwa ! Release remote control
340 END
Local
Local