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

225 mhz universal counter
Table of Contents

Advertisement

'This program instructs the counter to take 50 period measurements
'and return the mean, minimum, maximum and standard deviation.
'The counter is put into SINGLE measurement mode.
'The number of measurements is programmed using ":CALC3:AVER:COUNT 50"
'The counter is set up to take 50 measurements and then stop
'using the ":TRIG:COUNT:AUTO ON" command.
'At the end of the 50 measurements, the statistics are sent to the
'computer. The data is sent in ASCII format to preserve resolution.
'
'When the program has completed, the statistics will be displayed on
'the computer and the standard deviation will be displayed on the
'counter
'
'In this example, the status reporting structure is used to alert the
'program that the statistics are ready.
'The "*OPC" and "*ESE 1" command are used together to generate an output
'from the Event Status Register when the measurement is complete. The
'output of this register is summarized in the Status Byte Register
'In order for the Service Request Register to summarize that input
'the "*SRE 128" command must be used. This enables the Service
'Request Register to assert the SRQ line when the measurement is complete.
'Note that the *OPC command must be sent at the start of every measurement.
'
'The SUB sendhp sends commands to the counter
DECLARE SUB sendhp (code$)
REM $INCLUDE: 'QBSETUP.BAS'
DIM SHARED source AS LONG
DIM samples AS INTEGER
DIM maximum AS STRING * 23
DIM minimum AS STRING * 23
DIM mean AS STRING * 23
DIM sdev AS STRING * 23
maxelem% = 23
actual% = 0
samples = 50
source = 703
isc& = 7
state% = 1
priority% = 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")
Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples

To Measure the Statistics of 50 Measurements (QuickBASIC)

3-80
'Required by HP 82335A
'Address and select code
'Number of measurements
'Strings for statistics
'The maximum number of characters that
'can ever be sent is 23
'Maximum number of characters expected
'Returns actual characters received
'Number of statistics measurements
'Counter at address 3
'Select code 7
'Used in IOEOI
'Used in IOPEN
'Make sure EOI enabled
'Reset the counter and interface
'Reset the 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.
Programming Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

53131a53132a

Table of Contents