
76
Chapter 5
Starting a Measurement (Trigger) and Detecting the Completion of a Measurement
(End of Sweeps)
Waiting for the Completion of One or More Sweeps (Detecting the
Completion of a Measurement)
Using the *OPC? command
The “SING” command on page 437 and “NUMG” command on page 364 are overlap
commands whose executions are finished at the completion of one or more sweeps.
Therefore, if you start one or more sweeps with these commands, you can detect their
completion with the following command.
•
“*OPC?” on page 259
Example 5-2 shows a sample program to detect the completion of a sweep by using the
“*OPC?” command. This program is stored on the sample program disk with the
swp_opc.bas filename.
This program starts a sweep from the “SING” command, waits for the completion of this
command’s execution with the “*OPC?” command (the completion of a single sweep),
displays a message at the completion of the sweep, and then finishes.
Lines 20 to 60
Identifies the external controller and Instrument BASIC and sets the
GPIB address.
Line 80
Sets the trigger source to the internal trigger.
Lines 90
Starts a single sweep.
Lines 110 to 120 Executes the “*OPC?” command and waits for 1 to be returned (the
completion of the sweep).
Line 130
Displays the sweep completion message.
Example 5-2
Detecting the completion of a sweep using the “*OPC?” command
10 DIM Buff$[9]
20 IF SYSTEM$("SYSTEM ID")="HP4294A" THEN
30 ASSIGN @Hp4294a TO 800
40 ELSE
50 ASSIGN @Hp4294a TO 717
60 END IF
70 !
80 OUTPUT @Hp4294a;"TRGS INT"
90 OUTPUT @Hp4294a;"SING"
100 PRINT "Waiting..."
110 OUTPUT @Hp4294a;"*OPC?"
120 ENTER @Hp4294a;Buff$
130 PRINT "Sweep Complete"
140 END
Inserting a wait
You can use a setting to make the controller wait for the completion of one or more sweeps
performed by the Agilent 4294A (for example, using the WAIT command of HP BASIC).
This method is simple, but if you set an inappropriate wait, unexpected errors could occur.
Summary of Contents for 4294A
Page 4: ...4 ...
Page 18: ...18 Contents ...
Page 24: ...24 Chapter1 To make effective use of this manual Other manuals attached to this unit ...
Page 94: ...94 Chapter6 Reading Writing Measurement Data Reading Writing Data ...
Page 110: ...110 Chapter7 Processing Measurement Results Analyzing Measurement Results ...
Page 136: ...136 Chapter10 Handling Errors Sample program for error handling ...
Page 246: ...246 13 Application Sample Programs File Transfer Function ...
Page 254: ...254 Chapter15 Setting the Display LCD Sample program for setting the LCD screen ...
Page 507: ...Index Index 507 Index ...
Page 508: ...508 Index Index ...
Page 509: ...Index Index 509 Index ...
Page 510: ...510 Index Index ...
Page 511: ...Index Index 511 Index ...
Page 512: ...512 Index Index ...
Page 513: ...Index Index 513 Index ...
Page 514: ...514 Index Index ...
Page 515: ...Index Index 515 Index ...
Page 516: ...516 Index Index ...
Page 517: ...Index Index 517 Index ...
Page 518: ...518 Index Index ...