[D
	/LoadSW [P
		[A LoadFlag ]	% LoadFlag = False -> Check only if Files are existing 	
		
		/Result #1 def
		/MissingFile '' def	
		
		% MCU1
		/SWFile_1 FilePath SafetyFWSel.SafetyFWDir add '\' add SafetyFWSel.FWFileName add SafetyFWSel.MCU1FWSWTypeExt add def
		/SWFile_1 SWFile_1 '_V' add SafetyFWSel.FWVersion cvs add 'S' add SafetyFWSel.FWSubVersion cvs add def 
		SafetyFWSel.FWBetaInfo '' ne [B
			/SWFile_1 SWFile_1 '_' add SafetyFWSel.FWBetaInfo add def
		] if
		/SWFile_1 SWFile_1 '.HX3' add def
		
		% MCU1
		/SWFile_2 FilePath SafetyFWSel.SafetyFWDir add '\' add SafetyFWSel.FWFileName add SafetyFWSel.MCU2FWSWTypeExt add def
		/SWFile_2 SWFile_2 '_V' add SafetyFWSel.FWVersion cvs add 'S' add SafetyFWSel.FWSubVersion cvs add def 
		SafetyFWSel.FWBetaInfo '' ne [B
			/SWFile_2 SWFile_2 '_' add SafetyFWSel.FWBetaInfo add def
		] if
		/SWFile_2 SWFile_2 '.HX3' add def
		

		% check if files are existing
		Result [B
			SWFile_1 FileExist not [B
				/Result #0 def 
				/MissingFile SWFile_1 def
			] if
		] if
		
		Result [B
			SWFile_2 FileExist not [B
				/Result #0 def 
				/MissingFile SWFile_2 def
			] if
		] if
		
		Result LoadFlag and [B
			'Downloading SM02 FW...' log
			%'Putting MCU1 into Bootstrap mode and erasing FW...' log     
				$23 chr $00 chr add $00 chr add $00 chr add $AB chr add TalkIntf.GenericCmd
				10000 wait

			%'Downloading MCU1 FW...' log
				'Downloading ' SWFile_1 add log
				SWFile_1 dup loadobj exch PackInst:DownloadHX3File   

			%'Putting MCU2 into Bootstrap mode and erasing FW...' log     
				$23 chr $00 chr add $00 chr add $00 chr add $AC chr add TalkIntf.GenericCmd
				10000 wait

			%'Downloading MCU2 FW...' log
				'Downloading ' SWFile_2 add log
				SWFile_2 dup loadobj exch PackInst:DownloadHX3File   
				
		] if
		[A /MissingFile /Result]
	]
]