Chapter 3 Programming Your Universal Counter for Remote Operation

Elements of SCPI Commands

:CALC3:AVERAGE ON

:CALC3:AVERAGE:COUNT 50

:TRIG:COUNT:AUTO ON

:INIT

*WAI

:CALC3:AVERAGE:ALL?

Enable statistics.

Base statistics on 50 measurements.

On INIT, take 50 measurements.

Start 50 measurements.

Wait until 50 measurements are complete before Counter executes another command. At this point, commands could be issued to other instruments.

Asks for the statistics. This command, will not be executed until the 50th measurement is complete.

Using the *OPC? Command

This method is useful if you want to hold off execution of the program while you wait for the Counter to complete any pending activity. In the *WAI example above, the line following the *WAI command is accepted by the Counter. However, the Counter does not execute the command because of the preceding *WAI command. If this line had been a command to address another instrument, it would be immediately executed. If you had wanted to hold off the command to another instrument, you would use the *OPC? command instead of the *WAI command.

:CALC3:AVERAGE ON

:CALC3:AVERAGE:COUNT 50

:TRIG:COUNT:AUTO ON

:INIT

*OPC?

Enable statistics.

Base statistics on 50 measurements.

On INIT, take 50 measurements.

Start making measurements.

Tell Counter to put a 1 in the output buffer when 50th measurement is complete.

Read the Counter. The program will wait here until the Counter returns a 1.

:CALC3:AVERAGE:ALL?

Ask for statistics.

Using the *OPC Command to Assert SRQ

This method is recommended when the Counter is on the HP-IB with many other instruments, any of which can assert SRQ. The commands *OPC, *ESE 1 and

Programming Guide

3-47