subroutine butcon(raw,n1,n2,v,h) ! BUTCON SUBROUTINE ORBIT C.ORBIT SBP 94.06.17 !tpl call butcon(raw,n1,n2,v,h) ! INTEGER RAW(4,100) v/h(100) in mm !+ ! Subroutine butcon (raw, n1, n2, v, h) ! ! Subroutine to convert raw button readings to h and v positions in mm. ! ! Input: ! raw(4,120) -- Integer: raw button readings ! n1 -- Integer: Index of first detector to convert ! n2 -- Integer: Index of last detector to convert ! ! Output ! v(120) -- Real(rp): Vertical position im mm. ! h(120) -- Real(rp): Horizontal position in mm. !- use precision_def implicit none ! convert raw butns data to mm integer(4) raw(4,*),n1,n2,n real b1,b2,b3,b4,vm,hm real(rp) v(*),h(*) if((n1 < 1).or.(n2 > 120)) then print *,' butcon illegal button location - return without data ' print *,n1,n2 call csr_bell endif do n=n1,n2 b1=raw(1,n) b2=raw(2,n) b3=raw(3,n) b4=raw(4,n) call poscon(n,b1,b2,b3,b4,vm,hm) v(n)=1000.*vm h(n)=1000.*hm enddo end