To Make A Frequency Measurement (Quickbasic) - HP 53131A/132A 225 MHz Programming Manual

225 mhz universal counter
Table of Contents

Advertisement

'This program sets up the counter to make 10 frequency measurements
'on channel 1 using a 0.1 second gate time.
'The results are printed on the computer CRT.
'Data is sent in ASCII format to preseve resolution.
'
'The SUB sendhp sends commands to the counter
DECLARE SUB sendhp (code$)
REM $INCLUDE: 'QBSETUP.BAS'
DIM SHARED source AS LONG
DIM i AS INTEGER
DIM samples AS INTEGER
samples = 10
DIM freqs(10) AS STRING * 23
source& = 703
isc& = 7
state% = 1
CLS
CALL IOEOI(isc&, state%)
CALL IOCLEAR(source&)
CALL sendhp("*RST")
CALL sendhp("*CLS")
CALL sendhp("*SRE 0")
CALL sendhp("*ESE 0")
CALL sendhp(":STAT:PRES")
CALL sendhp(":func " + CHR$(34) + "FREQ 1" + CHR$(34)) 'Measure frequency
CALL sendhp(":FREQ:ARM:STAR:SOUR IMM")
CALL sendhp(":FREQ:ARM:STOP:SOUR TIM")
CALL sendhp(":FREQ:ARM:STOP:TIM .1")
CLS
FOR i = 1 TO samples
CALL sendhp("READ:FREQ?")
CALL IOENTERS(source&, freqs(i), 23, actf%)
PRINT "Frequency"; i; "= "; freqs(i)
NEXT i
END
SUB sendhp (code$)
CALL iooutputs(source, code$, LEN(code$))
END SUB
Chapter 3 Programming Your Universal Counter for Remote Operation
Elements of SCPI Commands

To Make a Frequency Measurement (QuickBASIC)

Programming Guide
'Required by HP 82335A
'Address and select code
'i is used for loops
'Number of measurements
'String to be read
'Reading ASCII formatted data
'gives results to the correct
'resolution. Must be read into
'a string. The maximum number
'of characters that can ever be
'sent is 20 per measurement.
'Counter at address 3
'Select code 7
'Used in IOEOI
'Clear screen
'Make sure EOI enabled
'Clear the counter and interface
'Reset counter
'Clear event registers and error queue
'Clear service request enable register
'Clear event status enable register
'Preset enable registers and transition
'filters for operation and questionable
'status structures
'These 3 lines enable using
'time arming with a 0.1 second
'gate time
'Clear computer screen
'Initiate a measurement and
'get the result
'Read the ASCII characters
3-77

Advertisement

Table of Contents
loading

This manual is also suitable for:

53131a53132a

Table of Contents