Chapter 3 Programming Your Universal Counter for Remote Operation

Elements of SCPI Commands

To Optimize Throughput (HP BASIC)

10! This program shows how to set up the counter to transfer data at the

20! fastest possible rate. Note that the arming mode is AUTO. This mode

30! provides the least resolution of all arming modes.

40! The program comments discuss the meaning of each command.

50! ASCII result format is to preserve resolution.

60!

70CLEAR SCREEN

80INTEGER I

90DIM A$(200)[22],Dummy$[22]

100ASSIGN @Count TO 703

110

CLEAR 703

! Clear the counter and interface

120

OUTPUT @Count;"*RST"

! Reset the counter

130

OUTPUT @Count;"*CLS"

! Clear event registers and error queue

140

OUTPUT @Count;"*SRE 0"

! Clear service request enable register

150OUTPUT @Count;"*ESE 0" ! Clear event status enable register

160OUTPUT @Count;":STAT:PRES" ! Preset enable register and transition

170

!

filters for operation and questionable

180

!

status structures.

190! The following lines will provide the highest throughput, regardless

200! of the state of the counter before these lines are executed.

210OUTPUT @Count;":FORMAT ASCII" ! ASCII format for fastest throughput

220OUTPUT @Count;":FUNC 'FREQ 1'" ! Select frequency

230 OUTPUT @Count;":EVENT1:LEVEL 0"

! Set Ch 1 trigger level to 0 volts

240OUTPUT @Count;":FREQ:ARM:STAR:SOUR IMM" ! These two lines enable the

250OUTPUT @Count;":FREQ:ARM:STOP:SOUR IMM" ! AUTO arming mode.

260

OUTPUT @Count;":ROSC:SOUR INT"

! Use internal oscillator. If

270

 

! you want to use an external

280

 

! timebase, you must select it

290

 

! and turn off the automatic

300

 

! detection using:

310

 

! :ROSC:EXT:CHECK OFF

320

 

!

330

OUTPUT @Count;":DIAG:CAL:INT:AUTO OFF" ! Disable automatic interpolater

340

 

! calibration. The most recent

350

 

! calibration values are used in

360

 

! the calculation of frequency

370

OUTPUT @Count;":DISP:ENAB OFF"

! Turn off the counter display

380

 

! This greatly increases

390

 

! measurement throughput.

400OUTPUT @Count;":CALC:MATH:STATE OFF" ! Disable any post processing.

410OUTPUT @Count;":CALC2:LIM:STATE OFF"

420OUTPUT @Count;":CALC3:AVER:STATE OFF"

430

OUTPUT @Count;":HCOPY:CONT OFF"

! Disable any printing operation

440

OUTPUT @Count;"*DDT #15FETC?"

! Define the Trigger command

450

 

! This means the command FETC?

460

 

! does not need to be sent for

470

 

! every measurement, decreasing

480

 

! the number of bytes

490

 

! transferred over the bus.

Programming Guide

3-73