HP 53150A Series Programming Manual page 97

Microwave frequency counter
Table of Contents

Advertisement

Chapter 3 Programming Your Counter for Remote Operation
Programming Examples
Making a Frequency Measurement (QuickBASIC)
'This program configures the counter to make 10 frequency measurements
'on channel 2.
'The results are printed on the computer monitor.
'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&p; = 7
state% = 1
CLS
CALL IOEOI(isc&p;, state%)
CALL IOCLEAR(source&)
CALL sendhp("*RST")
CALL sendhp("*CLS")
CALL sendhp("*SRE 0")
CALL sendhp("*ESE 0")
CALL sendhp(":STAT:PRES")
transition
CALL sendhp(":func " + CHR$(34) + "FREQ 2" + CHR$(34)) 'Measure frequency
CLS
FOR i = 1 TO samples
CALL sendhp("INIT;*WAI;:DATA?")
CALL IOENTERS(source&ng, freqs(i), 23, actf%)
PRINT "Frequency"; i; "= "; freqs(i)
NEXT i
END
'
Subroutine to send command to HP 5315xA/
SUB sendhp (code$)
CALL iooutputs(source, code$, LEN(code$))
END SUB
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 and stop autotriggering
'Clear event registers and error queue
'Clear service request enable register
'Clear event status enable register
'Preset enable registers and
'filters for operation and questionable
'status structures
'Clear computer screen
'Initiate a measurement and
'get the result
'Read the ASCII characters
3-57

Advertisement

Table of Contents
loading

This manual is also suitable for:

53152a series53151a series

Table of Contents