##########################                                            ##-#
#                                                                     ##-#
# Assembled by checkpoint, 1.18.2 (23-Sep-99).                        ##-#
# (EDIT THE ORIGINAL SOURCE, NOT THIS FILE!)                          ##-#
# Date-assembled: Fri Jan 15 09:58:05 EST 2010                        ##-#
# Orig-source: /mdisw/cfl/flight/src/stop_iss_v03.src                 ##-#
#                                                                     ##-#
##########################                                            ##-#
# File: stop_iss.src
#
# Written  96.01.29  D Mathur
#	 1-Feb-96 (MDM) - Added call to perf reset
#	16-Mar-97 (CED) - Updated to use the latest version of resettel
#
program "@(#) MODULE: stop_iss.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/q_stop_iss_v03.src"
descr "q_stop_iss - Stops DEP iss mode"
                                                                      ##-#
#=#=#=#=#=#=#=#=#=#=# src ln 11.  (Open Log file)                     ##-#
if !GS9 = "" then                                                     ##-#
  display "Opening logfile from q_stop_iss_v03"                       ##-#
  perf openlog                                                        ##-#
end if                                                                ##-#
write !GS9 "%s q_stop_iss_v03:" !TIME                                 ##-#
writen !GS9 "Starting..."                                             ##-#
#=#=#=#=#=#=#=#=#=#=#+ src ln 13.  Block 0  Next line is #27          ##-#
 display "Running block 0 of q_stop_iss_v03."                         ##-#
set !LI0 = getint(mktccnt)                                            ##-#
display "Terminates DEP iss mode"

tcb mbdpmod 1		 ## Set DEP to iss mode
#=#=#=#=#=#=#=#=#=#=#- src ln 14.  Block 0   Cmds:1   Total:1         ##-#
wait time 8 ## Wait for hk packet                                     ##-#
set !LI2 = !LI0 + 1                                                   ##-#
if !LI2 > 255 then                                                    ##-#
 set !LI1 = !LI2 - 256                                                ##-#
else                                                                  ##-#
 set !LI1 = !LI2                                                      ##-#
end if                                                                ##-#
set !LI2 = getint(mktccnt)                                            ##-#
if !LI1 <> !LI2 then                                                  ##-#
 write !GS9 "%s q_stop_iss_v03:" !TIME                                ##-#
 writen !GS9  "CMD CT ERR in block 0. cmd ctr: %d" !LI2               ##-#
 writen !GS9  "      (Sent 1 cmds; expected cmd ctr: %d)" !LI1        ##-#
 writen !GS9  "      Halted.  (restart at line 27)"                   ##-#
 display "ERR: q_stop_iss_v03 blk 0: cmd ctr isnt %d. (CONT 27)" !LI1 ##-#
 halt                                                                 ##-#
 write !GS9 "%s q_stop_iss_v03:" !TIME                                ##-#
 writen !GS9  "Override.  Continuing past block 0..."                 ##-#
else                                                                  ##-#
 write !GS9 "%s q_stop_iss_v03:" !TIME                                ##-#
 writen !GS9  "Block 0 completed OK."                                 ##-#
display "Completed block 0 of q_stop_iss_v03."                        ##-#
end if                                                                ##-#
#################### END of BLOCK 0 ####################              ##-#
perf q_reset_v05
write !GS9 "%s q_stop_iss_v03:" !TIME                                 ##-#
writen !GS9 "returning from procedure 'q_stop_iss_v03'"               ##-#
return
write !GS9 "%s q_stop_iss_v03:" !TIME                                 ##-#
writen !GS9 "Falling off the bottom."                                 ##-#
