# File: dynpage.src
#
# This procedure dumps IP memory using the same commands as the 
# TSTOL m_fl_dynpage.prc
#
program "@(#) MODULE: dynpage.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/dynpage_v04.src"
descr " dynpage - Runs GSE version of TSTOL m_fl_dynpage" 

#**************************************************************************
#	****PROCEDURE HEADER****
#
# 	1.0 	Introduction
#
#		1.1	FOT Name:    m_fl_dynpage
#		   	Experiment Name:	m_dynpage  	 
#		   	SUM Issue:  OCD # 413
#			Simulator Validation Status:
#
#		1.2	Date Created:  11-05-96
#			    Revision:  1.	11-15-96	GP
#						2.	11-16-96  JP
#						3. 	12-02-96	GP
#						4.	19-FEB-97	RCJ
#		1.3	Change Description:	
#
#			1.	Added data word 0004 immediately after 
#				MBIPLDIN command.
#			2.	Replace all occurrences of 0226, 9811 with 
#				0001, 4000 per
#				MOCR request.
#			3.	Replaced all data word 0008 by 9999 per 
#				OCD 434 request.
#			4.	Corrected data words in /MBIPLDIN as per 
#				OCD #494.  Also correct the TM check for HR 
#				data.
#
#		1.4	Point of Contact:	RRowe	
#			FOT Author:  RRowe	ATSC/SOHO	286-4799
#
#**************************************************************************
#	2.0	Description
#
#		2.1	Narrative Description
#
#		This procedure performs checks the interval counter to avoid 
#		the period and then dumps the MDI IP register and list 
#		memory pages in the sci160K high data channel.  The 10 page 
#		dumps take 60 seconds each.
#
#		2.2	Intended Use:
#
#		Perform MDI LOI buffer dump campaign.
#
#		2.3	Duration:	12 min
#
#		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 preferred, 
#			but not required.
#**************************************************************************
#	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 > 79 then
   display "Wait for alt to complete, maximum of 23 minutes"
   wait until getint(mksqintc) < 80
   if !LI2 < 8 then
      display "Wait for alt to complete, maximum of 23 minutes"
      wait until getint(mksqintc) > 7
   end if
end if

# dumps the following ip pages during pure dynamics
# 	page 12:	0, 39999, 73332, acccb, e6664 (all 5 pieces)
#	page 14:	0, 39999
#	page 16:	0, 39999, 73332

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x0 0x6000   ## page 12 0x
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 3

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x9999 0x6003   ## page 12 0x39999
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 6

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x3332 0x6007   ## page 12 0x73332
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 9

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0xcccb 0x600a   ## page 12 0xacccb
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 12

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x6664 0x600e   ## page 12 0xe6664
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 15

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x0 0x7000   ## page 14 0x
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 18

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x9999 0x7003   ## page 14 0x39999
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 21

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x0 0x8000   ## page 16 0x0
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 24

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x9999 0x8003   ## page 16 0x39999
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 27

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

wait time 60 

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

tcblock mbipldin 0x1b2 0x744 0x4 0x1 0x4000 0x7332 0x8007   ## page 16 0x77332
tcblock mbipldin 0x1b2 0x748 0x5 0x9999 0x3 0x0 0x6500 0x0
tcblock mbipldin 0x140 0x70c 0x1

set !LI3 = !LI1 + 30

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

wait time 60 

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







