63 |
call compdecode(word,flag,tipo,info,errflag) |
call compdecode(word,flag,tipo,info,errflag) |
64 |
|
|
65 |
if(errflag.ne.0.) then |
if(errflag.ne.0.) then |
66 |
print*,'filladc --> ERROR on compdecode' |
if(debug)print*,'filladc --> ERROR on compdecode' |
67 |
iflag=1 |
iflag=1 |
68 |
return |
return |
69 |
endif |
endif |
71 |
if(flag.eq.1) then ! flag: fine messaggio (ladder) |
if(flag.eq.1) then ! flag: fine messaggio (ladder) |
72 |
|
|
73 |
if(info.ne.1.and.info.ne.2.and.info.ne.3) then |
if(info.ne.1.and.info.ne.2.and.info.ne.3) then |
74 |
print*, |
if(debug)print*, |
75 |
$ 'filladc --> wrong end-of-ladder ' |
$ 'filladc --> wrong end-of-ladder ' |
76 |
$ //'in COMPRESSED mode' |
$ //'in COMPRESSED mode' |
77 |
print*, |
if(debug)print*, |
78 |
$ ' info(=ladder) ',info,' type ',tipo |
$ ' info(=ladder) ',info,' type ',tipo |
79 |
iflag=1 |
iflag=1 |
80 |
return |
return |
87 |
newVAL=max(0,newVAL) |
newVAL=max(0,newVAL) |
88 |
newVAL=min(4095,newVAL) |
newVAL=min(4095,newVAL) |
89 |
adc(DSPn,nvk(js),nst(js))=newVAL |
adc(DSPn,nvk(js),nst(js))=newVAL |
90 |
ccc print*,DSPn,nvk(js),nst(js),newval |
c$$$ print*,DSPn,nvk(js),nst(js) |
91 |
|
c$$$ $ ,pedestal_t(DSPn,nvk(js),nst(js)),newval |
92 |
|
c$$$ $ ,pedestal(DSPn,nvk(js),nst(js)) |
93 |
enddo |
enddo |
94 |
|
|
95 |
if(info.eq.3) goto 1000 |
if(info.eq.3) goto 1000 |
116 |
is = iaddr |
is = iaddr |
117 |
prec_ind = 1 |
prec_ind = 1 |
118 |
else |
else |
119 |
print*,'filladc --> address '// |
if(debug)print*,'filladc --> address '// |
120 |
$ 'out of range - iaddr,is',iaddr,is |
$ 'out of range - iaddr,is',iaddr,is |
121 |
iflag=1 |
iflag=1 |
122 |
return |
return |
126 |
if(prec_ind.eq.0) is=is+1 |
if(prec_ind.eq.0) is=is+1 |
127 |
if(info.ge.0.and.info.le.4095) then |
if(info.ge.0.and.info.le.4095) then |
128 |
if(is.gt.3072)then |
if(is.gt.3072)then |
129 |
print*, |
if(debug)print*, |
130 |
$ 'filladc --> strip out of range - DSPn,is' |
$ 'filladc --> strip out of range - DSPn,is' |
131 |
$ ,DSPn,is |
$ ,DSPn,is |
132 |
iflag=1 |
iflag=1 |
139 |
|
|
140 |
oldVAL=newVAL |
oldVAL=newVAL |
141 |
else |
else |
142 |
print*,'filladc --> datum out of range - info',info |
if(debug) |
143 |
|
$ print*,'filladc --> datum out of range - info',info |
144 |
iflag=1 |
iflag=1 |
145 |
return |
return |
146 |
endif |
endif |
180 |
enddo |
enddo |
181 |
idata = idata+1 |
idata = idata+1 |
182 |
if(datatracker(idata).ne.ior(z'1800',i+3)) then |
if(datatracker(idata).ne.ior(z'1800',i+3)) then |
183 |
print*,'filladc --> wrong end-of-ladder in FULL mode' |
if(debug) |
184 |
print*,' word ',datatracker(idata) |
$ print*,'filladc --> wrong end-of-ladder in FULL mode' |
185 |
print*,' should be ',ior(z'1800',i+3) |
if(debug) |
186 |
|
$ print*,' word ',datatracker(idata) |
187 |
|
if(debug) |
188 |
|
$ print*,' should be ',ior(z'1800',i+3) |
189 |
iflag=1 |
iflag=1 |
190 |
return |
return |
191 |
endif |
endif |
219 |
flag=ishft(flag,-12) |
flag=ishft(flag,-12) |
220 |
|
|
221 |
if(flag.ne.0.and.flag.ne.1) then |
if(flag.ne.0.and.flag.ne.1) then |
222 |
print*,'compdecode --> error on uncompression: flag=',flag |
c print*,'compdecode --> error on uncompression: flag=',flag |
223 |
errflag=1. |
errflag=1. |
224 |
endif |
endif |
225 |
if(flag.eq.0) then ! valore ADC |
if(flag.eq.0) then ! valore ADC |
230 |
info=iand(word,z'03ff') |
info=iand(word,z'03ff') |
231 |
tipo=iand(word,z'0c00') |
tipo=iand(word,z'0c00') |
232 |
if(tipo.ne.0.and.tipo.ne.z'0800') then |
if(tipo.ne.0.and.tipo.ne.z'0800') then |
233 |
print*,'compdecode --> error on decompression: tipo=',tipo |
c print*,'compdecode --> error on decompression: tipo=',tipo |
234 |
errflag=1. |
errflag=1. |
235 |
endif |
endif |
236 |
if(tipo.eq.0) then ! indirizzo |
if(tipo.eq.0) then ! indirizzo |