HP 53131A, 132A manual Statistics

Models: 132A 53131A

1 330
Download 330 pages 55.08 Kb
Page 151
Image 151

Chapter 3 Programming Your Universal Counter for Remote Operation

Elements of SCPI Commands

To Use Limits to Filter Data Before Measuring Stats (QuickBASIC) (Continued)

CALL sendhp(":FREQ:ARM:STAR:SOUR IMM") CALL sendhp(":FREQ:ARM:STOP:SOUR TIM") CALL sendhp(":FREQ:ARM:STOP:TIM .01")

CALL sendhp(":STAT:OPER:ENABLE 256")

CALL sendhp(":STAT:OPER:NTR 256") CALL sendhp(":STAT:OPER:PTR 0")

CALL sendhp("*SRE 128")

'These 3 lines enable time 'arming with a 0.01 second 'gate time.

'Computing statistics bit in 'Operation Status Register.

'When stats are complete, the bit 'will go from high to low, so a 'negative transition is needed to 'enable the bit that is summarized 'in the Status Byte Register. 'This is the bit from the Operation 'Status register that is summarized 'in the Status Byte Register. When 'it goes high, SRQ will be asserted.

CALL sendhp(":CALC3:LFIL:STATE ON")

'Enable statistics filter

CALL sendhp(":CALC3:LFIL:LOWER " + STR$(lower))

'Set lower stats limit

CALL sendhp(":CALC3:LFIL:UPPER " + STR$(upper))

'Set upper stats limit

CALL sendhp(":CALC3:AVER ON")

'Enable statistics

CALL sendhp(":CALC3:AVER:COUNT " + STR$(nummeas))'Set number of measurements

 

'to use in statistics

 

'calculation

CALL sendhp(":CALC2:LIM:STATE ON")

'Enable limit testing. Must

 

'do this to see graph

CALL sendhp(":CALC2:LIM:LOWER " + STR$(lower))

'Set lower limit

CALL sendhp(":CALC2:LIM:UPPER " + STR$(upper))

'Set upper limit

CALL sendhp(":CALC2:LIM:DISP GRAPH")

'Display limit graph

ON PEN GOSUB getstats

'When SRQ happens, go get

PEN ON

'statistics

CALL IOPEN(isc&, priority%)

'Watch for interrupts

PRINT "Making Period measurements"

 

CALL sendhp(":INIT:CONT ON")

'Set counter to run

Loophere:

'Wait here until complete

IF complete THEN GOTO endprogram

'If stats received, then end

GOTO Loophere

 

getstats:

 

complete = 1

'Test bit

CALL IOSPOLL(source&, statusbyte)

'Check status byte

 

'Should be 192

CALL sendhp(":INIT:CONT OFF")

'Put counter in single

Programming Guide

3-83

Page 151
Image 151
HP 53131A, 132A manual Statistics