# File: dynloil.src
#
# This procedure downlinks the LOI buffers and a line-depth second image
# using the same commands as the TSTOL m_fl_dynloil.prc
#
program "@(#) MODULE: dynloil.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/dynloil_v04.src"
descr " dynloil - Runs GSE version of TSTOL m_fl_dynloil" 

#**************************************************************************
#	****PROCEDURE HEADER****
#
# 	1.0 	Introduction
#
#		1.1	FOT Name: m_fl_dynloil     
#		   	MMS-F Name: m_dynloil 	 
#		   	SUM Issue:  N/A 	
#			Simulator Validation Status:  N/A
#
#		1.2	Date Created: 11-14-96  
#			    Revision:  1:  15-NOV-96  CG
#                                     2:  17-NOV-96  JP
#		1.3	Change Description:	
#
#			1.  Added data word 0004 to all /MBIPLDIN commmands.
#                      2.  Change timed wait after cmd for D/L LINE-DEPTH
#                          IP REG 1683 to 120 sec.
#
#		1.4	Point of Contact: H. Benefield	
#			Author:  Paul Beckwith    ATSC/SOHO      286-4799
#
#**************************************************************************
#	2.0	Description
#
#		2.1	Narrative Description
#
#			This procedure dumps the LOI circular Velocity and
#			continuum buffers and downlinks a 30s line depth 
#			in parallel with 30s dopplergrams.
#
#		2.2	Intended Use:
#			
#			Perform MDI LOI buffer dump during dynamics mode 
#			continous contact with nominal continuum intensity 
#			images.
#
#		2.3	Duration:	 
#			
#			5mn (Up to 9mn wait to avoid ALT sequence)
#
#		2.4	References:
#
#**************************************************************************
#	3.0	Instructions for Use:
#
#		3.1	Parameters Required
#
#			None
#
#		3.2	Critical Activities
#
#			None
#
#		3.3	Special Constraints or Activities
#
#			MDI in safe or higher mode. High rate telemetry 
#			support required for duration of DEP/IP configuration 
#			and campaign execution.  VC2 support is perferred but 
#			not required.  Should be executed with 
#			6 < MKSQINTC < 95 to avoid ALT period	
#     		
#**************************************************************************
#	4.0	STEPS:

# WAIT FOR MKTCCNT TO UPDATE AND STORE DEP COMMAND COUNTER

wait time 10
set !LI1 = getint(mktccnt)

set !LI2 = getint(mksqintc)
if !LI2 > 94 then
   display "Wait for alt to complete, maximum of nine minutes"
   wait until getint(mksqintc) < 95
   if !LI2 < 7 then
      display "Wait for alt to complete, maximum of nine minutes"
      wait until getint(mksqintc) > 6
   end if
end if

tcblock mbipldin 0x140 0x693 0x1 ## d/l line-depth, ip reg 1683
wait time 120                    ## wait for continuum d/l

tcblock mbipldin 0x140 0x70a 0x1 ## d/l loi-cb-v, ip reg 1802
tcblock mbipldin 0x140 0x70b 0x1 ## d/l loi-cb-i, ip reg 1803
tcblock mbipldin 0x140 0x693 0x0 ## back to d/l continuum, ip reg 1683

set !LI3 = !LI1 + 4

if !LI3 > 255 then
   set !LI3 = !LI3 - 256
end if

# verify command receipt by dep
wait until !LI3 = getint(mktccnt)



