Using The *Opc? Command; Inserting A Wait - Agilent Technologies 4294A Programming Manual

Precision impedance analyzer
Hide thumbs Also See for 4294A:
Table of Contents

Advertisement

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.
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
Line 80
Lines 90
Lines 110 to 120
Line 130
Example 5-2
Detecting the completion of a sweep using the "*OPC?" command
10
20
30
40
50
60
70
80
90
100
110
120
130
140

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.
76
"*OPC?" on page 259
Identifies the external controller and Instrument BASIC and sets the
GPIB address.
Sets the trigger source to the internal trigger.
Starts a single sweep.
Executes the "*OPC?" command and waits for 1 to be returned (the
completion of the sweep).
Displays the sweep completion message.
DIM Buff$[9]
IF SYSTEM$("SYSTEM ID")="HP4294A" THEN
ASSIGN @Hp4294a TO 800
ELSE
ASSIGN @Hp4294a TO 717
END IF
!
OUTPUT @Hp4294a;"TRGS INT"
OUTPUT @Hp4294a;"SING"
PRINT "Waiting..."
OUTPUT @Hp4294a;"*OPC?"
ENTER @Hp4294a;Buff$
PRINT "Sweep Complete"
END
Chapter 5

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents