# File: dotwavg.src
#
# Executes procedures to construct and downlink time weighted averages
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/dotwavg.src"
descr "dotwavg - test TWA instrucctions"

display "Executing procedure  dotwavg."

# Set 1st IP vector entry to point to EXTRACT procedure
tcblock  mbipldin 0x154
tcblock  mbipcmd  0x91  0 256

# Load the queue
perform twavg

open decom160

tcblock mbcmhdr1 0x4040 0x4040 0 1 0

display "Downlinking central 128x128 image"
tcblock mbcmtp1r 0xffff 0xff15 10000
wait time 8

tcblock mbipldin 0x152 0x12E
wait time 1

for !LI0 = 1 to 12 step 1
    display "Iteration number: %d" !LI0
    tcblock mbcmtp1r 0xffff 0xff15 10000
    wait time 8
    tcblock mbipldin 0x152 0x14C
end for

wait time 5
close decom160

display "Finished procedure dotwavg"
return
