# This is the channel n Veto Width register which is register 0x1nd4 for {set i 0} {$i < $NumChans} {incr i} { variable Ch$i.VetoWidth 0 variable Ch$i.VetoWidthB0015 0 variable Ch$i.VetoWidthB1617 0 } proc GetVetoWidth {} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { variable Ch$i.VetoWidth variable Ch$i.VetoWidthB0015 variable Ch$i.VetoWidthB1617 set Ch$i.VetoWidth [ReadRegister Ch$i.VetoWidth] set Ch$i.VetoWidthB0015 [expr [set Ch$i.VetoWidth] & 0x0000ffff] set Ch$i.VetoWidthB1617 [expr ([set Ch$i.VetoWidth] >> 16) & 3] } } proc SetVetoWidth {Ch w vl} { variable NumChans variable $Ch.VetoWidth variable $Ch.VetoWidthB0015 variable $Ch.VetoWidthB1617 set $Ch.$w $vl set $Ch.VetoWidth [expr [set $Ch.VetoWidthB0015] | ([set $Ch.VetoWidthB1617] << 16)] WriteRegister $Ch.VetoWidth [set $Ch.VetoWidth] puts " WriteRegister $Ch.VetoWidth [set $Ch.VetoWidth]" } proc SaveVetoWidth {} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { DBSetValue Ch$i.VetoWidth [ReadRegister Ch$i.VetoWidth] } } proc RestVetoWidth {} { variable NumChans variable Name for {set i 0} {$i < $NumChans} {incr i} { set value [DBGetValue Ch$i.VetoWidth] if {$value == "Error!"} { InsertLog "Unable to restore value for Ch$i.VetoWidth" } else { variable Ch$i.VetoWidth set Ch$i.VetoWidth $value set rc [catch {WriteRegister Ch$i.VetoWidth $value} m] if {$rc != 0} {InsertLog "Unable to restore value for Ch$i.VetoWidth"} } } } proc DrawVetoWidth {} { variable NumChans variable Name set html "" append html "
" append html "
| Channel | " append html "Channel n Veto Width | " append html "Channel n Veto Width Step | " append html "
| $i | " append html "" append html "" append html " | " append html "" append html "" append html " | " append html "