To Measure The Statistics Of 50 Measurements (Hp Basic) - HP 53131A/132A 225 MHz Programming Manual

225 mhz universal counter
Table of Contents

Advertisement

10
! This program instructs the counter to take 50 period measurements.
20
! The counter is put into SINGLE measurement mode. The number of
30
! measurements to take is programmed using ":CALC3:AVER:COUNT 50"
40
! The counter is told to stop after 50 measurements using
50
! ":TRIG:COUNT:AUTO ON"
60
! At the end of 50 measurements, the statistics are calculated and
70
! sent to the computer.
80
! ASCII format is used to preserve resolution.
90
! In this example, the status reporting structure is used to alert
100
! the program that the statistics are ready.
110
! The "*OPC" command and the "*ESE 1 " command are used together
120
! to generate an output from the Event Status Register when
130
! the measurement is complete. The output of this register is
140
! used as an input to the Service Request Register. In order for the
150
! Service Request Register to be able to use that input, the "*SRE 32"
160
! command must be used. This enables the Service Request Register to
170
! assert the SRQ line when the measurement is complete.
180
! Note, that the *OPC command must be sent prior to every measurement
190
! in order to enable the OPC bit.
200
INTEGER I,Num_meas
210
DIM Sdev$[22],Mean$[22],Minimum$[22],Maximum$[22]
220
Num_meas=50
230
ASSIGN @Count TO 703
240
CLEAR 703
250
OUTPUT @Count;"*RST"
260
OUTPUT @Count;"*CLS"
270
OUTPUT @Count;"*SRE 0 "
280
OUTPUT @Count;"*ESE 0 "
290
OUTPUT @Count;":STAT:PRES" ! Preset enable registers and transition
300
310
320
OUTPUT @Count;":FUNC 'PER 1'"
330
340
350
360
370
OUTPUT @Count;":FREQ:ARM:STAR:SOUR IMM" ! These three lines enable
380
OUTPUT @Count;":FREQ:ARM:STOP:SOUR TIM" ! time arming with a 0.01
390
OUTPUT @Count;":FREQ:ARM:STOP:TIM .01"
400
OUTPUT @Count;":DISP:TEXT:FEED 'CALC3'" ! Display statistics
410
OUTPUT @Count;":CALC3:AVER:TYPE SDEV"
420
OUTPUT @Count;":CALC3:AVER ON"
430
OUTPUT @Count;":CALC3:AVER:COUNT ";Num_meas ! Do statistics on num_meas
440
450
OUTPUT @Count;":TRIG:COUNT:AUTO ON "
460
OUTPUT @Count;"*ESE 1"
470
480
OUTPUT @Count;"*SRE 32"
490
ON INTR 7 GOTO Get_averages ! Goto Get_averages on interrupt.
500
ENABLE INTR 7;2
510
PRINT "Waiting for measurement to complete"
Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples
To Measure the Statistics of 50 Measurements
(HP BASIC)
! Statistics based on Num_meas measurements
! Clear the counter and interface
! Reset the counter
! Clear event registers and error queue
! Clear service request enable register
! Clear event status enable register
! filters for operation and questionable
! status structures.
! "*ESE 1" is used so bit 5
!of the service request register will allow
! an SRQ when measurement complete.
! Enable interrupt on counter SRQ.
3-64
See Line # 520.
! Measure Period on channel 1.
! Note that the functions must be
! a quoted string. The actual
! string sent to the counter
! is 'PER 1'.
! second gate time.
!Display the standard deviation
! Enable statistics
! measurements.
!Take Num_meas measurements
Programming Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

53131a53132a

Table of Contents