# This is the group Channel DC Offset register 0x1n98 (and 0x1na4) for {set i 0} {$i < 4} {incr i} { variable Grp$i.SEL 0 for {set j 0} {$j < 8} {incr j} { variable Grp$i.Ch$j.DAC 0 } } proc GetDAC {} { for {set i 0} {$i < 4} {incr i} { for {set j 0} {$j < 8} {incr j} { WriteRegister Grp$i.DACSel $j variable Grp$i.Ch$j.DAC set Grp$i.Ch$j.DAC [expr [ReadRegister Grp$i.DCOffset] & 0x0000ffff] } variable Grp$i.SEL set Grp$i.SEL [ReadRegister Grp$i.DACSel] } } proc SetDAC {} { for {set i 0} {$i < 4} {incr i} { for {set j 0} {$j < 8} {incr j} { variable Grp$i.Ch$j.DAC WriteRegister Grp$i.DCOffset [expr ($j << 16) + ([set Grp$i.Ch$j.DAC] & 0x0000ffff)] } } } proc SaveDAC {} { for {set i 0} {$i < 4} {incr i} { for {set j 0} {$j < 8} {incr j} { WriteRegister Grp$i.DACSel $j DBSetValue Grp$i.Ch$j.DCOffset [expr [ReadRegister Grp$i.DCOffset] & 0x0000ffff] } } } proc RestDAC {} { for {set i 0} {$i < 4} {incr i} { for {set j 0} {$j < 8} {incr j} { WriteRegister Grp$i.DCOffset [expr ($j << 16) + ([DBGetValue Grp$i.Ch$j.DCOffset] & 0x0000ffff)] } } } proc DrawDAC {} { set html "" append html "

" append html "" append html "" append html "" for {set j 0} {$j < 4} {incr j} { append html "" } append html "" for {set i 0} {$i < 4} {incr i} { append html "" append html "" for {set j 0} {$j < 4} {incr j} { set s [expr ($i * 8) + $j] append html "" } append html "" append html "" append html "" for {set j 4} {$j < 8} {incr j} { set s [expr ($i * 8) + $j] append html "" } append html "" } append html "
GroupCh $j/[expr $j+4]
$i
 
 
 
" append html "" append html "

" return $html }