1. Take One Voltmeter Reading - This example uses the Agilent E1326 Multimeter
OUTPUT 80903;"CONF:VOLT:DC (@100)" ! Setup multimeter to take one reading
OUTPUT 80903;"INIT;:FETCH?" ! Initiate and read data
ENTER 80903;A ! Enter the reading
2. Function Generator is to Output 100 Cycles of a Waveform after an External Trigger - This
example uses the Agilent E1340 Arbitrary Function Generator to output the waveforms after
receiving a trigger signal on its “Aux In” port.
OUTPUT 80910;"ARM:STAR:LAY2:SOUR EXT;"; ! Arm source = Aux In port
OUTPUT 80910;"ARM:STAR:LAY2:COUN INF;"; ! Infinite number of Aux In arms
OUTPUT 80910;"ARM:STAR:LAY1:COUN 1e2" ! Set for 100 cycles
OUTPUT 80910;"INIT" ! Enable everything to begin
Step 7: Check that Coupled Commands are Sent as a Group
Coupled commands are SCPI commands that have parameters which all must be sent to the instrument
before they can be executed. This is necessary to transition from one set of parameters to another set. If
coupled commands are not sent as one, the instrument generates a “Setting conflict” error.
To send coupled commands, each command must be separated by a semicolon. Once the coupled commands
are sent, a normal Line Feed (LF), Line Feed with EOI, or an EOI should be sent to indicate the end of the
coupled commands. Use the following two methods to send coupled commands in BASIC/IBASIC.
1. Send as separate commands, except disable the Line Feed with EOI by placing a semicolon at
then end of the
OUTPUT statement. Note that the last OUTPUT statement sends a Line Feed with
EOI.
OUTPUT 80910;"SOUR:ROSC:SOUR INT;";
OUTPUT 80910;":SOUR:FREQ:MODE FSK;";
OUTPUT 80910;":SOUR:FREQ:FSK 10e3,20e3;"
OUTPUT 80910;":SOUR:FUNC:SHAP SIN;";
OUTPUT 80910;":SOUR:VOLT:LEV:IMM:AMPL 5V"
2. Send all commands in a single command string, shown as follows:
OUTPUT 80910;"SOUR:ROSC:SOUR INT;:SOUR:FREQ:MODE FSK;:SOUR:FREQ:FSK
10e3,20e3;:SOUR:FUNC:SHAP SIN;:SOUR:VOLT:LEV:IMM:AMPL 5V"
Step 8: Check for Command Synchronization
IEEE 488.2 specifies that all instruments have an input buffer and that execution of commands does not start
until a program message terminator is received (i.e., Line Feed, Line Feed with EOI, or EOI). For a single
instrument this causes no problems. However, if a single computer sends commands to more than one
instrument, the second instrument may execute the commands before the first instrument executes the
commands.
C-6 Debugging VXI SCPI Programs