Chapter 3 Programming Your Counter for Remote Operation
Programming Examples
3-56
Programming Guide
3
Making a Frequency Measurement (HP BASIC)
10 ! This program sets up the counter to make 10 frequency
20 ! measurements on channel 2.
30 ! The results are displayed on the computer CRT.
40 ! ASCII format is used to preserve resolution.
50 !
60
INTEGER I
! Declare variables
70
DIM Freq$(10)[22]
! Declare string to enter data
80
!Using strings to enter ASCII format
90
! data yields results formatted to the
100
! correct resolution. ASCII is the
110
! default format for the counter.
120
Samples=10
! Take 10 measurements
130
!
140
ASSIGN @Count TO 703
! Assign I/O path for counter
150
CLEAR 703
! Clear the counter and interface
160
OUTPUT @Count;”*RST”
! Reset the counter
170
OUTPUT @Count;”*CLS”
! Clear event registers and error queue
180
OUTPUT @Count;”*SRE 0”
! Clear service request enable register
190
OUTPUT @Count;”*ESE 0”
! Clear event status enable register
200
OUTPUT @Count;”:STAT:PRES”
! Preset enable registers and
210
! transition filters for operation and
220
! questionable status structures.
230
OUTPUT @Count;”:FUNC ‘FREQ 2’” ! Measure frequency on channel 1
270
!
280
CLEAR SCREEN
! Clear the computer display
290
FOR I=1 TO Samples
! Start making measurements
300
OUTPUT @Count;”INIT:*WAI;:DATA?” ! Start a measurement and
320
ENTER @Count;Freq$(I)
! fetch the data
330
PRINT USING “11A,DD,4A,22A,3A”;”Frequency (“;I;”) = “;Freq$(I);” Hz”
340
NEXT I
350
LOCAL 703
! Return counter to local
360
END
Summary of Contents for 53150A Series
Page 1: ... Programming Guide HP 53150A 151A 152A Microwave Frequency Counter ...
Page 2: ......
Page 10: ...Contents x Programming Guide ...
Page 11: ...1 Before You Start ...
Page 20: ...Chapter 1 Before You Start Related Documentation 1 10 Programming Guide 1 ...
Page 21: ...2 Command Summary A Quick Reference ...
Page 41: ...3 Programming Your Counter for Remote Operation ...
Page 101: ...4 Command Reference A Dictionary ...
Page 162: ...Chapter 4 Command Reference Common Commands 4 62 Programming Guide 4 ...
Page 163: ...5 Errors ...
Page 174: ...Chapter 5 Errors Error Types 5 12 Programming Guide 5 ...
Page 184: ......
Page 186: ... Manual Part Number 53150 90002 Printed in U S A NOVEMBER 1997 ...