46 Programming Examples
SR620 Universal Time Interval Counter
Program Example 3
IBM PC, IBM Basic, CEC GPIB Card
This example takes data in the binary dump mode and converts it into the correct units. This program is
written in IBM BASIC and uses a Capital Equipment Co. GPIB card. The CEC cards DMA input routine is
used to directly put the data into the PC's memory. All of the interface routines to the CEC card reside in
firmware on the card.
10 'program to test TIC binary dump mode- this program will binary dump
20 'samples from the time interval counter and convert the binary values to
30 'numbers in units appropriate to the measurement mode. The program
40 'demonstrates sending and receiving simple commands from the TIC. The
50 'program uses the GPIB interface and a Capital Equipment Co. GPIB interface
60 'card
70 ' This program runs in interpreted IBM PC Basic
80 DIM DAT%(16000),FDATA#(2000),FACTORS#(7),TEMP#(4)
90 DATA 1.05963812934D-14,1.05963812934D-14,1.05963812934D-14
100 DATA 1.24900090270331D-9,1.05963812934D-14,8.3819032D-8,0.00390625D0
110 FOR I =1 TO 7
120 READ FACTORS#(I)
130 NEXT I
140 DEF SEG = &HD000 ' base address of CEC card
150 INIT = 0:TRANSMIT =3:SEND = 9:ENTER = 21:DMA2 = 206 'CEC subroutine offsets
160 ADDR% =21:SYS%=0 'controller address
170 SR620% =16
' TIC address
180 '
190 ' string definitions
200 IN$ = "IFC UNT UNL REN" ' clear interface
210 BD$ = "BDMP"
220 MD$ = "mode?"
230 TALK$ = "UNT UNL MLA TALK 16"
240 EXPD$ = "expd?"
250 '
260 CALL INIT (ADDR%,SYS%) ' init CEC card
270 '
280 PRINT "Enter number of samples (<cr> to quit)";
290 INPUT "->",S$
' get number of samples
300 SAMPLES% = VAL (S$)
310 IF SAMPLES% = 0 THEN STOP
320 IF SAMPLES% > 2000 THEN GOTO 280
330 ' setup dma parameters
340 '
350 MODE% = &H2105
' dma mode
360 COUNT% = 8*SAMPLES%
370 SEGMENT%=-1
380 C$ = BD$ + S$
' TIC command
390 '
400 ' dma data into PC
410 CALL SEND (SR620%,C$,STATUS%) : GOSUB 890 ; SEND COMMAND
420 CALL TRANSMIT (TALK$,STATUS%) :GOSUB 890 ; MAKE TIC A TALKER
430 OFS%=VARPTR(DAT%(1))
440 CALL DMA2 (SEGMENT%,OFS%,COUNT%,MODE%,STATUS%): GOSUB 890
450 '
460 ' get mode so we'll know which conversion factor to use
470 CALL SEND (SR620%,MD$,STATUS%) : GOSUB 890
480 ANS$ = SPACE$(50)
Содержание SR620
Страница 2: ...SR620 Universal Time Interval Counter...
Страница 6: ...iv Table of Contents SR620 Universal Time Interval Counter...
Страница 8: ...vi Safety and Preparation for Use SR620 Universal Time Interval Counter...
Страница 12: ...x Specifications SR620 Universal Time Interval Counter...
Страница 58: ...42 Programming Commands SR620 Universal Time Interval Counter...
Страница 72: ...56 Programming Examples SR620 Universal Time Interval Counter...
Страница 76: ...60 Troubleshooting Tips SR620 Universal Time Interval Counter...
Страница 82: ...66 Performance Test SR620 Universal Time Interval Counter...
Страница 90: ...74 Calibration Procedure SR620 Universal Time Interval Counter...
Страница 102: ...86 Circuit Description SR620 Universal Time Interval Counter...
Страница 124: ...108 Parts List SR620 Universal Time Interval Counter...