Jason,
Here is a sample code fragment you can revise for an xlt proc. Similar code can by used in an IB tcl proc.
set counter_file
set count [CtrCurrentValue counter_file]
if {$count == 1} {
CtrInitCounter $counter_file file 2 99999
}
set count [CtrNextValue $counter_file]
set xlateOutVals $control_id