# This is the channel Pulse Polarity register which is a part of DPP_MISC 0x1n80 [16] for {set i 0} {$i < $NumChans} {incr i} { variable Ch$i.Polarity 0 } proc GetPolarity {} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { variable Ch$i.Polarity set Ch$i.Polarity [ReadRegister Ch$i.Polarity] } } proc SetPolarity {w} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { if {$w < 8 && $w != $i} {continue} variable Ch$i.Polarity WriteRegister Ch$i.Polarity [set Ch$i.Polarity] } } proc SavePolarity {} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { DBSetValue Ch$i.Polarity [ReadRegister Ch$i.Polarity] } } proc RestPolarity {} { variable NumChans for {set i 0} {$i < $NumChans} {incr i} { variable Ch$i.Polarity set Ch$i.Polarity [DBGetValue Ch$i.Polarity] WriteRegister Ch$i.Polarity [DBGetValue Ch$i.Polarity] } } proc DrawPolarity {} { variable NumChans variable Name set html "" append html "

" append html "" append html "" append html "" append html "" append html "" for {set i 0} {$i < $NumChans} {incr i} { append html "" append html "" append html "" append html "" } append html "
ChannelChannel n Pulse Polarity
$i" append html "
" append html "

" return $html }