Chapter 3 Programming Your Universal Counter for Remote Operation
Elements of SCPI Commands
Programming Guide
3-85
To Read and Store Calibration Data (QuickBASIC)
'Before calibrating the counter, it is a good idea to read
'and store the current calibration values in case something goes wrong with
'the calibration.
'This program reads the cal values, and stores them in a file on the computer
'hard drive. It then reads the data from the file and sends it back to
'the counter.
'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 CALDATA AS STRING * 61 'Strings to be read
source& = 703 'Counter at address 3
isc& = 7 'Select code 7
state% = 1
CLS 0
CALL IOEOI(isc&, state%) 'Make sure EOI enabled
CALL IOCLEAR(source&) 'Clear the counter and interface
CALL sendhp("*RST") 'Reset HP 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.
PRINT "Reading Calibration Data"
CALL sendhp(":CAL:DATA?")
CALL ioenters(source&, CALDATA, 61, actf%) 'Read the ASCII characters
OPEN "CALDATA.DAT" FOR BINARY AS #1 'Store the cal data in a file
PUT #1, 1, CALDATA
CLOSE #1
'The following lines show how to open a file with calibration data
'and send it back to the counter.
PRINT
PRINT "Sending calibration data to counter"
OPEN "CALDATA.DAT" FOR BINARY AS #1
GET #1, 1, CALDATA
CLOSE #1
CALL sendhp(":CAL:DATA " + CALDATA) 'Send the data just read to counter
END
SUB sendhp (code$)
CALL iooutputs(source, code$, LEN(code$))
END SUB
Содержание 53131A
Страница 1: ...Programming Guide HP 53131A 132A 225 MHz Universal Counter ...
Страница 2: ......
Страница 13: ...1 1 Before You Start ...
Страница 24: ...Chapter 1 Before You Start Related Documentation 1 12 Programming Guide ...
Страница 25: ...2 2 Command Summary A Quick Reference ...
Страница 68: ...Chapter 2 Command Summary RST Response 2 44 Programming Guide ...
Страница 69: ...3 3 Programming Your Universal Counter for Remote Operation ...
Страница 167: ...4 4 Command Reference A Dictionary ...
Страница 172: ...Chapter 4 Command Reference CALCulate Subsystems 4 6 Programming Guide Figure 4 1 The CALCulate Subsystems ...
Страница 310: ...Chapter 4 Command Reference WAI Wait to Continue Command 4 144 Programming Guide ...
Страница 311: ...5 5 Errors ...
Страница 329: ......
Страница 330: ...H Manual Part Number 53131 90044 Printed in U S A NOVEMBER 1996 ...