Making A Frequency Measurement (Quickbasic) - Keysight 53147A Operating And Programming Manual

Microwave frequency counter/power meter/dvm
Table of Contents

Advertisement

3
Programming

Making a Frequency Measurement (QuickBASIC)

'This program configures the instrument to make 10 frequency measurements
'on channel 2.
'The results are printed on the computer monitor.
'Data is sent in ASCII format to preserve resolution.
'
'The SUB sendhp sends commands to the instrument
DECLARE SUB sendhp (code$)
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")
CALL sendhp(":CONF:FREQ DEFAULT,DEFAUTL,(@2)
CLS
FOR i = 1 TO samples
CALL sendhp("INIT:IMM")
CALL sendhp("READ?")
CALL IOENTERS(source&ng, freqs(i), 23, actf%)
PRINT "Frequency"; i; "= "; freqs(i)
NEXT i
END
' Subroutine to send command to Keysight 5314xA/
SUB sendhp (code$)
CALL iooutputs(source, code$, LEN(code$))
END SUB
204
Keysight 53147A/148A/149A Operating and Programming Guide
'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.
'instrument at address 3
'Select code 7
'Used in IOEOI
'Clear screen
'Make sure EOI enabled
'Clear the instrument and interface
'Reset instrument and stop autotrig
'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
'questionablestatus structures
'Set to measasure frequency in Band 2
'Clear computer screen
'Initiate a measurement and
'get the result
'Read the ASCII characters

Advertisement

Table of Contents
loading

This manual is also suitable for:

53148a53149a

Table of Contents