# File: ip5ktst.src
#
# Tests sci5k science data downlink
#
program "@(#) MODULE: ip5ktst.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/ip5ktst.src"
descr " ip5ktst - Test sci5k science data from IP"

display "Executing procedure ip5ktst."
write  !GS9 "Executing procedure ip5ktst :"
write  !GS9 " %s" !DATE
writen !GS9 " %s" !TIME
writen !GS9 " "

# Verify SCI5K

display "in winterm type: idl<cr> mon_sci5k"
#display "in winterm type: mdisci -s3 -v80 -c00 -i12"
halt

# disable macro queue and load vector 11

tcblock mbipldin 0x154
tcblock mbipcmd 0x0091 0x0011 0x1CD7

wait time 10
display "Verify IP error 1000:       %04x" getint(mkiperst)

tcblock  mbipldin 0x136                  ## Enable macro queue

# Verify IP error 1000=>3000

wait time 10
display "Verify IP error 1000=>3000: %04x" getint(mkiperst)
halt

tcblock mbipldin 0x134                  ## DEP interrupts enabled
tcblock mbdpmod 3                       ## set DEP to mode 3 (science)
tcblock mbipldin 0x152 0x1C43 		## jump to comp5kfill macro

# Watch sci5k/winterm and verify data downlink
# At end (60 seconds) set DEP back to engineering mode:

wait time 60

tcblock mbcmhdr1 0x4040 0x4040 0 1 11

tcblock mbcmtp1r 0xFFFF 0x2222 4000

wait time 90

tcblock mbdpmod 1			## set DEP to mode 1 (engineering)

tcblock mbcmhdr1 0x4040 0x4040 0 1 0

writen !GS9 "Finished procedure ip5ktst: %s" !TIME
writen !GS9 " "

return
