hi!
This commit is contained in:
126
tecs/test.for
126
tecs/test.for
@@ -1,40 +1,108 @@
|
||||
program test
|
||||
|
||||
real*4 temp(4)
|
||||
character device*32, cmd*80, response*80
|
||||
integer i
|
||||
character device*32, line*80, cmd*16, par*80, response*80
|
||||
integer i,j,k
|
||||
|
||||
call tecs_init(6, ' ')
|
||||
|
||||
call tecs_init(6)
|
||||
print *
|
||||
print *,'s <temp> set temperature'
|
||||
print *,'device <device> set cryo device'
|
||||
print *,'<command> direct command to LSC340'
|
||||
print *,'"empty line" show temperature and device'
|
||||
1 read(*,'(a)',end=9) cmd
|
||||
if (cmd(1:2) .eq. 's') then
|
||||
read(cmd(3:),*) temp(1)
|
||||
call tecs_set_temp(6, temp(1))
|
||||
elseif (cmd(1:2) .eq. 'c') then
|
||||
call tecs_send_cmd(6, cmd(3:), response)
|
||||
print *,response
|
||||
elseif (cmd(1:2) .eq. 'q') then
|
||||
print *,'Tecs Client'
|
||||
print *,'-----------'
|
||||
print *
|
||||
print *,'<empty line> show temperature and device'
|
||||
print *,'set <temp> set temperature'
|
||||
print *,'send <command> direct command to LSC340'
|
||||
print *,'device <device> set cryo device'
|
||||
print *,'<parameter> show parameter'
|
||||
print *,'<parameter> <value> set parameter'
|
||||
print *,'help show list of parameters and cryo devices'
|
||||
print *,'quit close TecsServer and exit'
|
||||
print *,'exit exit, but do not close TecsServer'
|
||||
print *
|
||||
1 print '(x,a,$)','tecs> '
|
||||
read(*,'(a)',end=9) line
|
||||
cmd=' '
|
||||
k=0
|
||||
do j=1,len(line)
|
||||
if (line(j:j) .gt. ' ') then
|
||||
k=k+1
|
||||
cmd(k:k)=line(j:j)
|
||||
if (cmd(k:k) .ge. 'A' .and. cmd(k:k) .le. 'Z') then ! set to lowercase
|
||||
cmd(k:k)=char(ichar(cmd(k:k))+32)
|
||||
endif
|
||||
elseif (k .gt. 0) then ! end of command
|
||||
goto 2
|
||||
endif
|
||||
enddo
|
||||
|
||||
if (k .eq. 0) then ! empty line
|
||||
call tecs_get_temp(6, temp)
|
||||
call tecs_get_par(6, 'device', device)
|
||||
print '(x,3(a,f8.3),2a)','tempX=', temp(2),', tempP=',temp(3)
|
||||
1 ,', tempC=',temp(1), ', device=',device
|
||||
goto 1
|
||||
endif
|
||||
|
||||
print *,'command too long'
|
||||
goto 1
|
||||
|
||||
2 par=' '
|
||||
do i=j,len(line)
|
||||
if (line(i:i) .gt. ' ') then
|
||||
par=line(i:)
|
||||
goto 3
|
||||
endif
|
||||
enddo
|
||||
|
||||
! simple query
|
||||
|
||||
if (cmd .eq. 'quit') then
|
||||
call tecs_quit(6)
|
||||
goto 9
|
||||
elseif (cmd .ne. ' ') then
|
||||
i=index(cmd,' ')
|
||||
if (i .gt. 1) then
|
||||
if (cmd(i+1:) .eq. ' ') then
|
||||
call tecs_get_par(6, cmd(1:i-1), response)
|
||||
print *,response
|
||||
else
|
||||
call tecs_set_par(6, cmd(1:i-1), cmd(i+1:))
|
||||
endif
|
||||
endif
|
||||
elseif (cmd .eq. 'exit') then
|
||||
goto 9
|
||||
elseif (cmd .eq. 'help') then
|
||||
print *
|
||||
print *,'Writeable parameters:'
|
||||
print *
|
||||
print *,'tempC temperature set-point'
|
||||
print *,'device temperature device'
|
||||
print *,'controlMode control on: 0: heat exchanger, '
|
||||
1 ,'1: sample, 2: second loop'
|
||||
print *
|
||||
print *,'Read only parameters:'
|
||||
print *
|
||||
print *,'tempX heat exchanger temperature'
|
||||
print *,'tempP sample temperature'
|
||||
print *,'tempH set-point on regulation'
|
||||
print *,'tLimit temperature limit'
|
||||
print *,'htr heater current percentage'
|
||||
print *,'power heater max. power'
|
||||
print *,'resist heater resistance'
|
||||
print *
|
||||
print *,'Temperature devices:'
|
||||
print *
|
||||
print *,'ill1, ill2, ill3 (cryofurnace), ill4 (focus-cryo), '
|
||||
1 ,'ill5 (maxi)'
|
||||
print *,'cti1, cti2, cti3, cti4, cti5 (maxi), cti6 (focus), apd'
|
||||
print *,'ccr4k (4K closed cycle), hef4c (TriCS 4circle cryo)'
|
||||
print *,'sup4t (supra.magnet 4T)'
|
||||
print *,'rdrn (LTF dilution, 20kOhm), rdrn2 (2kOhm)'
|
||||
print *
|
||||
else
|
||||
call tecs_get_temp(6, temp)
|
||||
print *,' x ', temp(2),' p ',temp(3),' set ',temp(1)
|
||||
call tecs_get_par(6, 'device', device)
|
||||
print *,'device=',device
|
||||
call tecs_get_par(6, cmd, response)
|
||||
print '(7x,3a)',cmd(1:k),'=',response
|
||||
endif
|
||||
goto 1
|
||||
|
||||
3 if (cmd .eq. 'send') then
|
||||
call tecs_send_cmd(6, par, response)
|
||||
print '(7x,2a)','response: ',response
|
||||
else
|
||||
call tecs_set_par(6, cmd, par)
|
||||
print '(7x,3a)',cmd(1:k),':=',par
|
||||
endif
|
||||
goto 1
|
||||
|
||||
9 end
|
||||
|
||||
Reference in New Issue
Block a user