Programming Examples 49
SR620 Universal Time Interval Counter
call DMA2 (seg,data,count,mode,status)
call
StatCheck
(address,status)
C get mode so we'll know which conversion factor to use
command (1:30) =' '
command (1:11) = 'MODE?;EXPD?'
call
TxGpib (address,command)
call GetGpib (address,rstring)
read
(rstring,101)tmode,dummy,texpd
C skip semicolon separator
101
format
(I1,A,I1)
C
convert data and print both binary and converted form
call
Convert
(tmode,texpd,samples,data,fdata)
write
(*,*)
write
(*,*)'data'
do 20 i=0,samples-1
write
(*,102)data(4*i+3),data(4*i+2),data(4*i+1),
+
data (4*i),fdata(i)
20
continue
102
format (1X,4Z4,' converted = ',D22.15)
goto
10
11 continue
end
C *******************************************************************
C converts the binary data to real numbers
subroutine Convert (tmode,texpd,samples,data,fdata)
integer*2
tmode,texpd,samples,data(0:19999),sign
integer*4
words(0:4)
real*8
fdata(0:4999)
real*8
factors(0:6)
C conversion factors
data
factors/1.05963812934D-14,1.05963812934D-14,
+
1.05963812934D-14,1.24900090270331D-9,1.05963812934D-14,
+
8.3819032D-8,.00390625/
do 10 i=0,samples-1
sign = 0
fdata(i) = 0.0D0
C get 8 data bytes
do 11 j=0,3
words(j) = data(4*i +j)
C get unsigned magnitude of word
if (words(j) .lt. 0)words(j) = 65536+words(j)
11
continue
C if answer less than 0 change sign and get magnitude
if (data(4*i+3) .lt. 0) then
sign = 1
do 12 j = 0,3
C take 1's complement of number
Содержание 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...