pro ssw,val_hex,report ; ; This program decodes the DISR Serial Status Word to produce a report ; (contained in the string variable report) describing the instrument ; status ; ; Inputs: val_hex, the value of the serial status word in hexadecimal ; as a 4-digit string ; ; Outputs: report, a description of the DISR status ; report=strarr(9) report(*)='' hw_msg=['HW error','HW ok'] mode_msg=['Mode Invalid','Mode INIT','Mode Descent','Mode Calibration', $ 'Mode Single Meas','Mode Mem Access','Mode Invalid','Mode Invalid'] prom_msg=['PROM exec not started','PROM exec started'] mem_msg=['Mem test not started','Mem test invalid','Mem test failed', $ 'Mem test ok'] ram_msg=['Execution not transferred to RAM','Execution transferred to RAM'] ada_msg=['Ada kernel execution not begun','Ada kernel execution begun'] init_msg=['INIT not complete','INIT complete'] bp_msg=['Waiting for first BCP','Received first BCP'] meas_id_msg=['Upper half DLI1','Upper half DLI2','Upper half SLI', $ 'Lower half DLI1','Lower half DLI2','Lower half SLI','DLV','ULV','DLIS', $ 'ULIS','IR Combined','IR Long','SLI strip','Solar Aureole','Near Surface DLVS', $ 'DLVS','ULVS','Dark Current','CCD','DLI2','SLI','DLI1'] meas_comp_msg=['Measurement not complete','Measurement complete'] type_msg=['Last command was a load','Last command was a dump'] comp_msg=['Command accepted','Command complete'] val=0 if val_hex eq 'FFFF' then begin report(0)='DISR off' goto,leave endif reads,val_hex,val,format='(z4)' hw=(val and '8000'x) eq '8000'x report(0)=hw_msg(hw) mode=(val and '7000'x)/4096 report(1)=mode_msg(mode) case mode of 0: 1: begin start=(val and '0800'x) eq '0800'x report(2)=prom_msg(start) mem_test=(val and '0600'x)/512 report(3)=mem_msg(mem_test) ram=(val and '0040'x) eq '0040'x report(4)=ram_msg(ram) start_ada=(val and '0020'x) eq '0020'x report(5)=ada_msg(start_ada) init=(val and '0010'x) eq '0010'x report(6)=init_msg(init) bp_wait=(val and '0008'x) eq '0008'x report(7)=bp_msg(bp_wait) end 2: begin cycles=(val and '0fc0'x)/64 report(2)=string(cycles,format='("Cycle ",i3)') meas=(val and '003f'x) report(3)=string(meas,format='("Measurement ",i3)') end 3: begin cycles=(val and '0e00'x)/512 report(2)=string(cycles,format='("Cycle ",i3)') meas=(val and '01fc'x)/4 report(3)=string(meas,format='("Measurement ",i3)') end 4: begin meas=(val and '0fc0'x)/64 report(2)=string(meas,format='("Measurement ",i3)') meas_id=(val and '003e'x)/2 report(3)='Last data set received was '+meas_id_msg(meas_id) meas_comp=(val and '0001'x) report(4)=meas_comp_msg(meas_comp) end 5: begin dumps=(val and '0f80'x)/128 report(2)=string(dumps,format='("No. dumps = ",i2)') loads=(val and '07c0'x)/4 report(3)=string(loads,format='("No. loads = ",i2)') type=(val and '0002'x) eq '0002'x report(4)=type_msg(type) comp=(val and '0001'x) report(5)=comp_msg(comp) end 6: 7: endcase for i=1,8 do if report(i) ne '' then report(i-1)=report(i-1)+',' leave: end