Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples
3-88
Programming Guide
To Use Macros (QuickBASIC)
'This program is useful for writing macros for the counter. Softkeys
'are available at the bottom of the computer screen to help determine
'the status of the macros.
'The SUB sendhp sends commands to the HP 53131A
DECLARE SUB sendhp (code$)
REM $INCLUDE: 'QBSETUP.BAS' 'Required by HP 82335A
DIM SHARED source AS LONG 'Address and select code
DIM maxlength AS INTEGER
DIM actual AS INTEGER
DIM length AS INTEGER
maxlength = 6400
DIM answer AS STRING
DIM namemacro AS STRING
DIM commandmacro AS STRING
DIM results AS STRING * 6400
DIM macros AS STRING
source = 703 'HP 53131A at address 3
isc& = 7 'Select code 7
state% = 1
CLS
CALL IOEOI(isc&, state%) 'Make sure EOI enabled
CALL sendhp("*RST") 'Reset the 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 register
CALL sendhp(":STAT:PRES") 'Preset enable registers and transition
'filters for operation and questionable
'status structures.
CALL sendhp(":INIT:CONT OFF") 'Put counter in Single
KEY 1, "Free"
KEY 2, "Enable"
KEY 3, "Display"
KEY 4, "Query"
KEY 5, "Define"
KEY 6, "Delete1"
KEY 7, "Purge"
KEY 8, "Disable"
KEY 9, "Send"
KEY 10, "QUIT"
FOR i = 1 TO 10
KEY(i) ON
NEXT i
KEY ON
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 ...