# File: vc2_obs_v06.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/prep/src/vc2_obs_v06.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#; FILE:    vc2_obs.ips
#; PURPOSE: To downlink the stored magnetograms and LOI circular b
#;	   and to make a Hi Res magnetogram and downlink it if there is
#;	   stored data products to downlink
#; METHOD:
#;	Call MAG_DL_SETUP.IPS routine to get the page numbers to downli
#;	how much to downlink.  See MAG_DL_SETUP.IPS for the table showi
#;	items are downlinked on which minutes.  The items returned by M
#;	are:
#;		$IPRL_MAG_DLPAGES- the two pages to downlink
#;					$IPRL_MAG_DLPAGES   = 0xA000 to indicate "No Mag Page" Cond
#;					$IPRL_MAG_DLPAGES+1 = 0xFFFF if only 1 page is to be downli
#;		$IPRL_MAG_PGLEN1 - the number of words in page 1 (TEMPORARY WO
#;		$IPRL_MAG_PGLEN2 - the number of words in page 2 (TEMPORARY WO
#; NOTES:
#;	At Frame 5	- Downlink the circular queue dataproduct (minutes 1
#;	At Frame 9	- Downlink the IPREG set if (a) not two pages of dow
#;			  minute 3,4,5 or 6) AND (b) there are magnetograms (othewise
#;			  observable creation)
#;	At Frame 10	- Downlink (a) the stored magnetogram, (b) 30 sec V
#;			  or (c) the observable created by this routine
#; HISTORY:
#;	Written 3-Nov-95 by M.Morrison
#;	 6-Nov-95 (MDM) - Modified to have the "OBS" downlink the IP Re
#;			  at frame 8 instead of frame 10
#;	 7-Nov-95 (MDM) - Modified to have the frame list have 10 frame
#;			- Do "OBS" downlink of the IP registers at frame 10
#;			- Do START1HR of circular buffer data at frame 5
#;			- Do START1HR of stored mag or V at frame 10
#;	 7-Nov-95 (MDM) - Patch a conditional (where to look for FFFF)
#;			- Patch to set the compression
#;	16-Nov-95 (MDM) - Placed calls to the newly revised DUMP_IPREG
#;			  subroutine (which now uses DOWNLINK)
#;			- Changed to have "obs" ipreg dump done on frame 10
#;			  (not frame 8).
#;			- Fixed a bug which was causing extraneous data products
#;			  ($IPRL_MAG_DLPAGES reference should have been +1)
#;	21-Nov-95 (MDM) - Added END statements after frame 5 and frame 
#;	11-Dec-95 (MDM) - Modified to not corrupt the Cir-buffer header
#;			  information (DO_HDECODE copies the DPC and N/K
#;			  info for a two parameter call (assumes that it
#;			  was source/destination pair)
#;	18-Jul-96 (MDM) - Modified to call a new HR mag program
#;			  (call hr_m1_ipreg instead of hr_mag)
#;
#QPROG_VC2_OBS::
#    BRANCHEQ R3072   1 &FRM01
tcblock mbipmacl 0x1A7A    0x01AE 0x0C00 0x0001 0x1A8F 
#    BRANCHEQ $IPRL_MAG_DLPAGES 0xA000 &DO_OBS		;no stored data to
tcblock mbipmacl 0x1A7E    0x01AE 0x1250 0xA000 0x1ADD 
#    BRANCHEQ R3072   5 &FRM05				;issue the downlink commands for
tcblock mbipmacl 0x1A82    0x01AE 0x0C00 0x0005 0x1AC6 
#    BRANCHEQ R3072   9 &FRM09				;issue the downlink of the IP Re
tcblock mbipmacl 0x1A86    0x01AE 0x0C00 0x0009 0x1AD0 
#    BRANCHEQ R3072  10 &FRM10				;issue the downlink commands for
tcblock mbipmacl 0x1A8A    0x01AE 0x0C00 0x000A 0x1AD7 
#    END
tcblock mbipmacl 0x1A8E    0x01FC 
#
#FRM01:
#    CALLQUE  $QSR_MAG_STORD_PG				;find out if there is stored da
tcblock mbipmacl 0x1A8F    0x01F8 0x15C9 
#
#    BRANCHEQ $IPRL_MAG_DLPAGES 0xA000 &DO_OBS		;no stored data to
tcblock mbipmacl 0x1A91    0x01AE 0x1250 0xA000 0x1ADD 
#
#    SETREG   $IPRL_HDECODE_PARAM+1 0x8000		;give it a legitimate 
tcblock mbipmacl 0x1A95    0x0140 0x114B 0x8000 
#    COPYREG  $IPRL_MAG_DLPAGES   $IPRL_HDECODE_PARAM	;temporarily
tcblock mbipmacl 0x1A98    0x0142 0x1250 0x114A 
#    CALLQUE  $QSR_DO_HDECODE
tcblock mbipmacl 0x1A9B    0x01F8 0x1010 
#
#SETUP_PAGE1:
#    COPYRI2D $IPRP_HDECODE_ADDR $IPRL_HEAD_WORK 10      ;copy the
tcblock mbipmacl 0x1A9D    0x01AC 0x1151 0x1155 0x000A 
#    COPYREG  $IPRL_MAG_PGLEN1   $IPRL_HEAD_WORK+8	;set the length
tcblock mbipmacl 0x1AA1    0x0142 0x1252 0x115D 
#    COPYREG  $IPRL_MAG_PGLEN1+1 $IPRL_HEAD_WORK+9	;set the length
tcblock mbipmacl 0x1AA4    0x0142 0x1253 0x115E 
#    SETREG   $IPRL_HEAD_WORK+3 0xE5			;set the compression
tcblock mbipmacl 0x1AA7    0x0140 0x1158 0x00E5 
#    COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR 10      ;copy the
tcblock mbipmacl 0x1AAA    0x01AA 0x1155 0x1151 0x000A 
#
#    BRANCHEQ $IPRL_MAG_DLPAGES+1 0xFFFF &SETUP_DONE	;only one pag
tcblock mbipmacl 0x1AAE    0x01AE 0x1251 0xFFFF 0x1AC5 
#
#SETUP_PAGE2:
#
#    COPYREG  $IPRL_MAG_DLPAGES+1 $IPRL_HDECODE_PARAM    ;temporar
tcblock mbipmacl 0x1AB2    0x0142 0x1251 0x114A 
#    CALLQUE  $QSR_DO_HDECODE  
tcblock mbipmacl 0x1AB5    0x01F8 0x1010 
#
#    COPYRI2D $IPRP_HDECODE_ADDR $IPRL_HEAD_WORK 10      ;copy the
tcblock mbipmacl 0x1AB7    0x01AC 0x1151 0x1155 0x000A 
#    COPYREG  $IPRL_MAG_PGLEN2   $IPRL_HEAD_WORK+8 	;set the lengt
tcblock mbipmacl 0x1ABB    0x0142 0x1254 0x115D 
#    COPYREG  $IPRL_MAG_PGLEN2+1 $IPRL_HEAD_WORK+9	;set the length
tcblock mbipmacl 0x1ABE    0x0142 0x1255 0x115E 
#    COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR 10      ;copy the
tcblock mbipmacl 0x1AC1    0x01AA 0x1155 0x1151 0x000A 
#
#SETUP_DONE:
#    END
tcblock mbipmacl 0x1AC5    0x01FC 
#
#FRM05:
#    BRANCHEQ $IPRL_MAG_DLPAGES+1 0xFFFF &DONE		;if there is only 
tcblock mbipmacl 0x1AC6    0x01AE 0x1251 0xFFFF 0x1ADF 
#
#    COPYREG  $IPRL_MAG_DLPAGES+1 $IPRL_DL_PARAM		;otherwise downl
tcblock mbipmacl 0x1ACA    0x0142 0x1251 0x11D0 
#    CALLQUE  $QSR_DL_1PAGE
tcblock mbipmacl 0x1ACD    0x01F8 0x0DA0 
#    END
tcblock mbipmacl 0x1ACF    0x01FC 
#
#FRM09:
#    BRANCHNE $IPRL_MAG_DLPAGES+1 0xFFFF &DONE		;if there are 2 pa
tcblock mbipmacl 0x1AD0    0x01B0 0x1251 0xFFFF 0x1ADF 
#    CALLQUE  $QSR_DUMP_IPREG
tcblock mbipmacl 0x1AD4    0x01F8 0x108B 
#    END
tcblock mbipmacl 0x1AD6    0x01FC 
#
#FRM10:
#    COPYREG  $IPRL_MAG_DLPAGES   $IPRL_DL_PARAM
tcblock mbipmacl 0x1AD7    0x0142 0x1250 0x11D0 
#    CALLQUE  $QSR_DL_1PAGE
tcblock mbipmacl 0x1ADA    0x01F8 0x0DA0 
#
#    END
tcblock mbipmacl 0x1ADC    0x01FC 
#
#;----------------------------------------------------------------
#
#DO_OBS:							;make the HR Magnetogram observable
#    GOTO $QPROG_HR_M1_IPREG
tcblock mbipmacl 0x1ADD    0x0156 0x1A5C 
#
#DONE:
#    END
tcblock mbipmacl 0x1ADF    0x01FC 
#
#=======================================================
#
return
#
#=======================================================
