Ibm Pc, Microsoft Basic, Via Gpib - Stanford Research Systems SR510 Manual

Lock-in amplifier
Table of Contents

Advertisement

Program Example 4:
IBM PC,Microsoft Basic,
via GPIB
This program requires the Capital Equipment
Corporation GPIB card for the IBM PC or XT. It
has firmware in ROM to interface high level
languages to the GPIB.
Subroutine calls in Microsoft BASIC are done to
memory locations specified by the name of the
subroutine. The address is relative to the segment
address specified by the DEF SEG statement
preceding CALL.
10 '
EXAMPLE PROGRAM TO READ THE SR510 OUTPUT AND RAMP THE X6 ANALOG OUTPUT
20 '
USING IBM PC BASICA AND THE CAPITAL EQUIPMENT CORP. GPIB INTERFACE CARD
30 '
40 '
50 '
ON THE SR510 REAR PANEL, SET SWITCHES #4 AND #6 ON SW1 TO DOWN (DEVICE
60 '
ADDRESS = 23, RS232 ECHO ON) AND SWITCH # 1 ON SW2 TO DOWN (RS232 BAUD
70 '
RATE = 9600). ALL OTHER SWITCHES SHOULD BE UP.
80 '
NOTE THAT THE RS232 ECHO IS FOR DEBUGGING AND DEMOSTRATION PURPOSES,
90 '
UNDER NORMAL CONDITIONING, SWITCH # 6 OF SW1 SHOULD BE UP SINCE THE RS232
100 ' ECHO SLOWS DOWN THE GPIB INTERFACE.
110 '
120 DEF SEG = &HC000
130 INIT=0: TRANSMIT=3: RECV=6:
140 ADDR%=21: SYS%=0
150 INZ$ = "IFC UNT UNL MTA LISTEN 23 DATA 'Z' 13"
160 '
170 Q$ = "IFC MTA LISTEN 23 DATA 'Q' 13"
180 X6$ = "IFC MTA LISTEN 23 DATA 'X6,"
190 LISN$ = "IFC UNT UNL MLA TALK 23"
200 '
210 '
220 CALL INIT(ADDR%,SYS%)
230 CALL TRANSMIT(INZ$,STATUS%)
240 GOSUB 540
250 '
'INIT X6 OUTPUT TO ZERO
260 X = 0
270 '
280 CALL TRANSMIT(Q$,STATUS%)
290 GOSUB 540
300 GOSUB 450
310 V1 = VAL(ANS$)
320 '
330 '
340 PRINT "OUTPUT = ";V1
350 '
360 X = X + .0025
370 IF X>10 THEN X
380 X$ = X6$ + STR$(X) + "' 13"
'BASE ADDRESS OF CEC CARD
'ADDRESSES OF CEC FIRM WARE ROUTINES
'CONTROLLER ADDRESS
'INIT X6 OUTPUT TO ZERO
'RESET SR510
'CHECK TRANSMIT STATUS
'READ OUTPUT
'GET RESULT
'INTO V1
'INCREMENT X6 OUTPUT BY 2.5 MV
'RESET RAMP
0
'MAKE X6 COMMAND STRING
In this program, the CEC card's ROM starts at
OC0000H, the system controller's address is 21,
and the SR530 has been assigned as GPIB
address 23.
To monitor the GPIB activity with an RS232
terminal, SW1-6 should be down, and the ASCII
terminal should be attached to the rear panel
RS232 connector.
47

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents