# This is the channel Invert Input register which is DPP_CTRL 0x1n80 [16] # also called Pulse Polarity 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 < $NumChans && $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 "
| Channel | " append html "Channel n Invert Input | " append html "
| $i | " append html "" append html "" append html " | " append html "