# File: vc2_obs_v03.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "vc2_obs_v03.ips"
descr "Loads IP queue instructions"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; FILE:    vc2_obs_v03.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)
#;
#QPROG_VC2_OBS::
#    BRANCHEQ R3072   1 &FRM01
tcblock mbipcmd 0x0091 0x1685   0x01AE 0x0C00 0x0001 0x169A 
#    BRANCHEQ $IPRL_MAG_DLPAGES 0xA000 &DO_OBS		;no stored data to
tcblock mbipcmd 0x0091 0x1689   0x01AE 0x1250 0xA000 0x16E8 
#    BRANCHEQ R3072   5 &FRM05				;issue the downlink commands for
tcblock mbipcmd 0x0091 0x168D   0x01AE 0x0C00 0x0005 0x16D1 
#    BRANCHEQ R3072   9 &FRM09				;issue the downlink of the IP Re
tcblock mbipcmd 0x0091 0x1691   0x01AE 0x0C00 0x0009 0x16DB 
#    BRANCHEQ R3072  10 &FRM10				;issue the downlink commands for
tcblock mbipcmd 0x0091 0x1695   0x01AE 0x0C00 0x000A 0x16E2 
#    END
tcblock mbipcmd 0x0091 0x1699   0x01FC 
#
#FRM01:
#    CALLQUE  $QSR_MAG_STORD_PG				;find out if there is stored da
tcblock mbipcmd 0x0091 0x169A   0x01F8 0x15E3 
#
#    BRANCHEQ $IPRL_MAG_DLPAGES 0xA000 &DO_OBS		;no stored data to
tcblock mbipcmd 0x0091 0x169C   0x01AE 0x1250 0xA000 0x16E8 
#
#    SETREG   $IPRL_HDECODE_PARAM+1 0x8000		;give it a legitimate 
tcblock mbipcmd 0x0091 0x16A0   0x0140 0x114B 0x8000 
#    COPYREG  $IPRL_MAG_DLPAGES   $IPRL_HDECODE_PARAM	;temporarily
tcblock mbipcmd 0x0091 0x16A3   0x0142 0x1250 0x114A 
#    CALLQUE  $QSR_DO_HDECODE
tcblock mbipcmd 0x0091 0x16A6   0x01F8 0x1010 
#
#SETUP_PAGE1:
#    COPYRI2D $IPRP_HDECODE_ADDR $IPRL_HEAD_WORK 10      ;copy the
tcblock mbipcmd 0x0091 0x16A8   0x01AC 0x1151 0x1155 0x000A 
#    COPYREG  $IPRL_MAG_PGLEN1   $IPRL_HEAD_WORK+8	;set the length
tcblock mbipcmd 0x0091 0x16AC   0x0142 0x1252 0x115D 
#    COPYREG  $IPRL_MAG_PGLEN1+1 $IPRL_HEAD_WORK+9	;set the length
tcblock mbipcmd 0x0091 0x16AF   0x0142 0x1253 0x115E 
#    SETREG   $IPRL_HEAD_WORK+3 0xE5			;set the compression
tcblock mbipcmd 0x0091 0x16B2   0x0140 0x1158 0x00E5 
#    COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR 10      ;copy the
tcblock mbipcmd 0x0091 0x16B5   0x01AA 0x1155 0x1151 0x000A 
#
#    BRANCHEQ $IPRL_MAG_DLPAGES+1 0xFFFF &SETUP_DONE	;only one pag
tcblock mbipcmd 0x0091 0x16B9   0x01AE 0x1251 0xFFFF 0x16D0 
#
#SETUP_PAGE2:
#
#    COPYREG  $IPRL_MAG_DLPAGES+1 $IPRL_HDECODE_PARAM    ;temporar
tcblock mbipcmd 0x0091 0x16BD   0x0142 0x1251 0x114A 
#    CALLQUE  $QSR_DO_HDECODE  
tcblock mbipcmd 0x0091 0x16C0   0x01F8 0x1010 
#
#    COPYRI2D $IPRP_HDECODE_ADDR $IPRL_HEAD_WORK 10      ;copy the
tcblock mbipcmd 0x0091 0x16C2   0x01AC 0x1151 0x1155 0x000A 
#    COPYREG  $IPRL_MAG_PGLEN2   $IPRL_HEAD_WORK+8 	;set the lengt
tcblock mbipcmd 0x0091 0x16C6   0x0142 0x1254 0x115D 
#    COPYREG  $IPRL_MAG_PGLEN2+1 $IPRL_HEAD_WORK+9	;set the length
tcblock mbipcmd 0x0091 0x16C9   0x0142 0x1255 0x115E 
#    COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR 10      ;copy the
tcblock mbipcmd 0x0091 0x16CC   0x01AA 0x1155 0x1151 0x000A 
#
#SETUP_DONE:
#    END
tcblock mbipcmd 0x0091 0x16D0   0x01FC 
#
#FRM05:
#    BRANCHEQ $IPRL_MAG_DLPAGES+1 0xFFFF &DONE		;if there is only 
tcblock mbipcmd 0x0091 0x16D1   0x01AE 0x1251 0xFFFF 0x16EF 
#
#    COPYREG  $IPRL_MAG_DLPAGES+1 $IPRL_DL_PARAM		;otherwise downl
tcblock mbipcmd 0x0091 0x16D5   0x0142 0x1251 0x11D0 
#    CALLQUE  $QSR_DL_1PAGE
tcblock mbipcmd 0x0091 0x16D8   0x01F8 0x10D6 
#    END
tcblock mbipcmd 0x0091 0x16DA   0x01FC 
#
#FRM09:
#    BRANCHNE $IPRL_MAG_DLPAGES+1 0xFFFF &DONE		;if there are 2 pa
tcblock mbipcmd 0x0091 0x16DB   0x01B0 0x1251 0xFFFF 0x16EF 
#    CALLQUE  $QSR_DUMP_IPREG
tcblock mbipcmd 0x0091 0x16DF   0x01F8 0x11DC 
#    END
tcblock mbipcmd 0x0091 0x16E1   0x01FC 
#
#FRM10:
#    COPYREG  $IPRL_MAG_DLPAGES   $IPRL_DL_PARAM
tcblock mbipcmd 0x0091 0x16E2   0x0142 0x1250 0x11D0 
#    CALLQUE  $QSR_DL_1PAGE
tcblock mbipcmd 0x0091 0x16E5   0x01F8 0x10D6 
#
#    END
tcblock mbipcmd 0x0091 0x16E7   0x01FC 
#
#;----------------------------------------------------------------
#
#DO_OBS:							;make the HR Magnetogram observable
#
#    BRANCHEQ R3072   10 &OBS_FRM10
tcblock mbipcmd 0x0091 0x16E8   0x01AE 0x0C00 0x000A 0x16ED 
#END
tcblock mbipcmd 0x0091 0x16EC   0x01FC 
#
#OBS_FRM8:
#OBS_FRM10:
#    CALLQUE  $QSR_DUMP_IPREG
tcblock mbipcmd 0x0091 0x16ED   0x01F8 0x11DC 
#
#DONE:
#    END
tcblock mbipcmd 0x0091 0x16EF   0x01FC 
#
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
