
Chapter 5 329
Programming
Generating Plots and Prints Remotely
Line 10 queries the plotter for its P1 and P2 coordinates.
Line 20 enters the P1 and P2 coordinate values into variables.
Line 30 sends the spectrum analyzer PLOT command and the plotter
coordinates.
Line 40 sends the following statements over the GPIB interface: UNL
sets all instruments on the GPIB to unlisten mode; LISTEN 5 sets only
the plotter to listen mode; TALK 18 specifies the spectrum analyzer as
the talker, which can then send its display contents to the plotter.
Because the controller GPIB interface must not interfere with the plot,
the DATA statement puts the controller GPIB interface on standby and
sets the attention line low. Example 1 illustrates the statements
required to generate a plot. However, there is no provision to indicate to
the controller when the plot is finished. Example 2 uses a spectrum
analyzer "command complete" service request to indicate when the plot
is done. (Service requests are discussed later in this chapter.) When the
spectrum analyzer PLOT command is finished, a "command complete"
service request is triggered and signals that the plot is done. E
XAMPLE 2
10 OUTPUT 705;"OP;"
20 ENTER 705;P1x,P1y,P2x,P2y
30 ON INTR 7 GOTO Done
40 ENABLE INTR 7;2
50 OUTPUT 718;"RQS 16;"
60 OUTPUT 718;"PLOT ";P1x;",";P1y;",";P2x;",";P2y;";"
70 SEND 7;UNL LISTEN 5 TALK 18 DATA
80 Idle: GOTO Idle
90 Done: S_poll=SPOLL(718)
100 OUTPUT 718;"RQS 0;"
110 PRINT "COMMAND IS COMPLETE"
120 END
Lines 10 and 20 obtain the P1 and P2 coordinates, as in the previous
example.
Line 30 commands the controller to go to the subroutine Done when an
interrupt occurs.
Line 40 enables the controller to receive service request interrupts.
Line 50 The RQS command specifies that a "command complete"
condition will generate a service request.
Lines 60 and 70 plot the display contents.
Line 80 keeps the controller on Line 80 of the program until the plot is
finished and the PLOT command satisfies the "command complete"
condition. When the plot is finished, the controller continues to the
subroutine Done. Done performs a serial poll on the spectrum analyzer
and reads the generated service request. This also clears the analyzer
of this request.
Comments to this Manuals