101
101
Program Examples
10 ' EXAMPLE PROGRAM USING MICROSOFT BASIC AND THE NATIONAL INSTRUMENTS GPIB CARD
20 ' THIS PROGRAM ASSUMES THAT A TTL TRIGGER SOURCE IS CONNECTED TO THE TRIGGER IN-
PUT
30 ' THIS PROGRAM ASSUMES THAT THE SR430 IS INSTALLED AS DEVICE MCS USING IBCONF
40 '
50 ' USE THE FILE DECL.BAS PROVIDED BY NATIONAL INSTRUMENTS TO INITIALIZE THE GPIB DRIV-
ER
60 '
100
CLEAR ,60000! : IBINIT1=60000! : IBINIT2=3 : BLOAD "bib.m",IBINIT1
110
CALL IBINIT1(IBFIND, IBTRG, IBCLR, IBPCT, IBSIC, IBLOC, IBPPC, IBBNA, IBONL, IBRSC, IBSRE,
IBRSV, IBPAD, IBSAD, IBIST, IBDMA, IBEOS, IBTMO, IBEOT, IBRDF, IBWRTF, IBTRAP)
120
CALL IBINIT2(IBGTS, IBCAC, IBWAIT, IBPOKE, IBWRT, IBWRTA, IBCMD, IBCMDA, IBRD, IBRDA,
IBSTOP, IBRPP, IBRSP, IBDIAG, IBXTRC, IBRDI, IBWRTI, IBRDIA, IBWRTIA, IBSTA%, IBERR%, IBCNT%)
130 '
140 ' DONE WITH DECL.BAS
150 '
160 ' OUR PROGRAM STARTS HERE
170 BDNAME$="MCS"
180 CALL IBFIND(BDNAME$, SR430%)
' FIND SR430
190 IF SR430% < 0 GOTO 1000
200 '
210 WRT$="OUTP 1"
' DIRECT SR430 OUTPUT TO GPIB INTERFACE
220 CALL IBWRT(SR430%, WRT$)
230 '
240 WRT$="BREC 1"
' SET RECORD LENGTH TO 1024 BINS
250 CALL IBWRT(SR430%, WRT$)
260 '
270 WRT$="TRLV .5"
' SET TRIGGER LEVEL TO .5 VOLTS
280 CALL IBWRT(SR430%, WRT$)
290 '
300 WRT$="TRLV?
' QUERY TRIGGER LEVEL
320 CALL IBWRT(SR430%, WRT$)
330 '
350 S$=SPACE$(20)
'PRINT TRIGGER LEVEL RESPONSE
360 CALL IBRD(SR430%, S$)
370 PRINT "Trigger Level =";S$
380 '
390 WRT$="CLRS"
' CLEAR DATA MEMORY FOR NEW SCAN
400 CALL IBWRT(SR430%, WRT$)
410 '
420 WRT$="SSCN"
' START SCAN WITH NEXT TRIGGER
430 CALL IBWRT(SR430%, WRT$)
440 '
450 CALL IBRSP(SR430%, SP%)
' CHECK STATUS USING SERIAL POLL
460 IF SP% MOD 2 = 0 GOTO 450
' WHILE SCAN IS IN PROGRESS
470 '
480 WRT$="BINB?"
490 CNT%=2048
500 DIM BUF% (2000)
IBM PC, IBM BASIC using the National Instruments GPIB interface.
Refer to the previous example for a discussion about the National Instruments GPIB interface.
This BASIC program does exactly the same thing as the C program in the previous example. Be sure to use
the file DECL.BAS provided by National Instruments to start your program. DECL.BAS contains the initializa-
tion procedures for the GPIB driver.
Summary of Contents for SR430
Page 2: ......
Page 6: ...4 ...
Page 22: ...20 Guide To Operation ...
Page 26: ...24 Guide To Operation ...
Page 36: ...34 Mode Menu ...
Page 54: ...52 Save Menu ...
Page 60: ...58 Recall Menu ...
Page 70: ...68 Plot Menu ...
Page 74: ...72 Test Menu ...
Page 76: ...74 Info Menu ...
Page 97: ...96 Remote Programming ...
Page 99: ...98 98 Program Examples ...
Page 107: ...106 106 Test and Calibration ...
Page 113: ...112 112 Using Photomultiplier Tubes ...
Page 125: ...124 124 124 Circuit Description ...