Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples
3-82
Programming Guide
To Use Limits to Filter Data Before Measuring Stats
(QuickBASIC)
'This program sets up the counter to determine the statistics of
'50 period measurements that are within limits defined by the variables
''UPPER' and 'LOWER'. Periods that are outside of the limits are not
'included in the statistics. The Limit graph is displayed so you can see if
'measurements are in limit.
'To alert the program that the statistics are ready, bit 8 in the Operation
'Status register is used. When statistics are being calculated, this bit
'is high, when they are complete, the bit goes low. By using the transition
'filters, an SRQ can be generated when statistics are complete.
'The SUB sendhp sends commands to the counter
DECLARE SUB sendhp (code$)
REM $INCLUDE: 'QBSETUP.BAS' 'Required by HP 82335A
DIM SHARED source AS LONG 'Address and select code
DIM status AS INTEGER 'Status byte variable
DIM complete AS INTEGER 'Variable used in the program
DIM statusbyte AS INTEGER 'Status Byte variable
DIM maximum AS STRING * 23 'Strings used to enter stats
DIM minimum AS STRING * 23
DIM mean AS STRING * 23
DIM sdev AS STRING * 23
DIM nummeas AS INTEGER 'Number of measurements
DIM lower AS SINGLE 'Lower limit
DIM upper AS SINGLE 'Upper limit
nummeas = 50 'Number of statistics measurements
lower = .0000005 'Limit values
upper = .000001
actual% = 0 'Used in IOENTERS
maxelem% = 23 'Used in IOENTERS
source& = 703 'Counter at address 3
isc& = 7 'Select code 7
complete = 0 'Used to check if stats received
state% = 1 'Used in IOEOI
priority% = 1 'Used in IOPEN
CLS
CALL IOEOI(isc&, state%) 'Make sure EOI enabled
CALL IOCLEAR(source&) 'Reset counter and interface
CALL sendhp("*RST") 'Reset counter
CALL sendhp("*CLS") 'Clear event registers and error queue
CALL sendhp("*SRE 0") 'Clear service request enable register
CALL sendhp("*ESE 0") 'Clear event status enable registers
CALL sendhp(":STAT:PRES") 'Preset filters for Operation and
'Questionable Status structures
CALL sendhp(":FUNC " + CHR$(34) + "PER 1" + CHR$(34)) 'Measure period
'The function must be a quoted string. The actual string sent to the
'counter is "PER 1"
Summary of Contents for 53131A
Page 1: ...Programming Guide HP 53131A 132A 225 MHz Universal Counter ...
Page 2: ......
Page 13: ...1 1 Before You Start ...
Page 24: ...Chapter 1 Before You Start Related Documentation 1 12 Programming Guide ...
Page 25: ...2 2 Command Summary A Quick Reference ...
Page 68: ...Chapter 2 Command Summary RST Response 2 44 Programming Guide ...
Page 69: ...3 3 Programming Your Universal Counter for Remote Operation ...
Page 167: ...4 4 Command Reference A Dictionary ...
Page 310: ...Chapter 4 Command Reference WAI Wait to Continue Command 4 144 Programming Guide ...
Page 311: ...5 5 Errors ...
Page 329: ......
Page 330: ...H Manual Part Number 53131 90044 Printed in U S A NOVEMBER 1996 ...