Specifications

SR400 with the RS-232 Interface
52
c reset PORT1 value to zero
x=0.0
c reset and start new count period
10 call txstr('CR;CS$')
c read counter A data into string str1
20 call txstr('QA1$')
call rxstr(str1)
c convert into integer variable n1
read(str1,1000) n1
1000 format (bn,i15)
c if data not ready yet, loop and try again
if (n1.lt.0) goto 20
c ramp PORT1 by 5 mV
x = x + .005
if (x.gt.10) x = 0.0
c make PORT1 command string
write(str2,2000) x
2000 format('PL1,',f7.3,'$')
call txstr(str2)
c print data
write(*,3000) n1,x
3000 format(' Counter A = ',I15,'PORT1 = ',F7.3)
c and loop forever
goto 10
end
c **********************************************
subroutine nocom
c in case of timeout error, this routine runs.
c put your error handler here.
write (*,*) char(7)
write (*,*) ' RS-232 Error'
stop
end