<root>
<document schema='101' license='1,University of Cambridge MSM department,VYWE3X' title='Gas Switching System Management Software' description='' target='PIC.18F.MIAC V2' >
	<config data='' clkspd='48000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='1' />
			<data name='speed' value='4' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='2' />
			<data name='clkbit' value='4' />
			<data name='dataport' value='0' />
			<data name='databit' value='5' />
			<data name='ghostype' value='1' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='S1' />
		<watch expr='S2' />
		<watch expr='S3' />
		<watch expr='S4' />
		<watch expr='S5' />
		<watch expr='S6' />
		<watch expr='Flow_meter_1' />
		<watch expr='Flow_meter_2' />
		<watch expr='Keypad_value' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='outgoing' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='9' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='old_keypress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S6' type='T8' description='Solenoid Valve 6' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Keypad_value' type='u8' description='represent the number of the button pressed by the operator' isconst='0' isinit='1' usrinit='255' setinit='255' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S5' type='T8' description='Solenoid Valve 5' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='experiment_duration' type='s16' description='it the experiment lenght in seconds' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S4' type='T8' description='Solenoid Valve 4' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S3' type='T8' description='Solenoid Valve 3' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='key_read_idx' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S2' type='T8' description='Solenoid Valve 2' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='minimumO2_inside_furnace' type='s16' description='This is the percentage of O2 in ppm  tollerated in the furnace at all time' isconst='1' isinit='1' usrinit='200' setinit='200' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='S1' type='T8' description='Solenoid Valve 1' isconst='0' isinit='1' usrinit='&quot;OFF&quot;' setinit='&quot;OFF&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='counter3' type='u8' description='just a counter' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='room_temperature' type='s16' description='It is the room temperature' isconst='1' isinit='1' usrinit='30' setinit='30' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='max_pressure_allowed' type='f32' description='It is the maximum gas pressure allowed in the system' isconst='1' isinit='1' usrinit='1.7999999523162842' setinit='1.8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='counter2' type='u16' description='just acounter' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='counter1' type='u16' description='it is just a counter' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='O2_Alarm_Aquarium' type='b1' description='Report the alarm from the O2 meter in the acquarium' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='experiment_pressure' type='f32' description='It is the value of the pressure of Argon in the furnace during the experiment' isconst='1' isinit='1' usrinit='1.5' setinit='1.5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Temp' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='max_furnace_heating_time' type='s16' description='It is the max time that the furnace take to go up to the experiment temperature' isconst='1' isinit='1' usrinit='120' setinit='120' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='O2_Alarm_Rapidox' type='b1' description='0 no alarm, 1 alarm' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='experiment_temperature' type='s16' description='It is the experiment temperature inside the furnace' isconst='1' isinit='1' usrinit='1000' setinit='1000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Key_idx' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Pressure_2' type='f32' description='Report the measurement from the Pressure Transmitter 2 in atm using ADC 34' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Machine_State' type='u16' description='it is an integeger which carry the machine state when the PLC is automatic' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Pressure_1' type='f32' description='Report the measurement from the Pressure Transmitter 1  in atm using ADC 3' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='max_furnace_cooling_down_time' type='s16' description='It is the time required for the furnace to cool down' isconst='1' isinit='1' usrinit='500' setinit='500' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='incoming' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='O2_rapidox' type='f32' description='Report the measurement from the O2 rapidox meter in % using ADC5' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_Lockout' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='out_len' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Error_number' type='u8' description='Error management' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in_len' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Flow_meter_2' type='f32' description='Report the measurement from the Flow Meter 2 in  l/min using ADC2' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='next_key' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Flow_meter_1' type='f32' description='Report the measurement from the Flow Meter 1 in  l/min using ADC1' isconst='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='keypress_buffer' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Error_Number_bis' type='s16' description='It is the number of the error' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Procedure_result' type='b1' description='1 is the procedure has been successful 0 if it has failed' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='max_purge_time' type='s16' description='Time required to purge the system from O2 (in sec)' isconst='1' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='current_keypress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='minimum_gas_flow_rate' type='f32' description='Minimum gas flow rate incoming from the House or bottle suppliers' isconst='1' isinit='1' usrinit='0.5' setinit='0.5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='furnace_previous_temperature' type='s16' description='just an intermidiate variable' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='furnace_temperature' type='s16' description='It is the temperature inside the furnace' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Control_Solenoid_Valve' description='It open or close the 6 solenoids valves' >
						<command class_type='decision' title='Solenoid Valve 1' exp='Compare$ (S1,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputON' >
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputOFF' >
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Solenoid Valve 2' exp='Compare$ (S2,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputON' >
									<argument exp='2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputOFF' >
									<argument exp='2' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Solenoid Valve 3' exp='Compare$ (S3,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputON' >
									<argument exp='3' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputOFF' >
									<argument exp='3' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Solenoid Valve 4' exp='Compare$ (S4,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputON' >
									<argument exp='4' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='OutputOFF' >
									<argument exp='4' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Solenoid Valve 5' exp='Compare$ (S5,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayON' >
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
									<argument exp='1' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Solenoid Valve 6' exp='Compare$ (S6,&quot;OFF&quot;,0)' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayON' >
									<argument exp='2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
									<argument exp='2' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Error_Management' description='It manage the errors when it is required by the program' >
						<command class_type='call' title='Call Macro' macro='Pressure_Critical_Alarm_1' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='switch' title='Error Management' textarea='36,25,36,25' exp='Error_number' >
							<case >
								<flowline />
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='comment' title='' comment='GAS Bottle not available
' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E1=House GAS and&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;GAS bottle BOTH&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;NOT AVAILABLE&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='comment' title='' comment='Gas OUT1 obstructed!' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E2 ArgonNOTflowing&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;OUT of the furnace!!!&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;Check GAS OUT1&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='comment' title='' comment='Not possible to purge O2 under the expected level' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E=2, I cannot take&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;the O2 level&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;below threshold&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='comment' title='' comment='MAX Pressure Sensor 1 Alarm' textarea='12,0,12,0' />
									<command class_type='call' title='Call Macro' macro='Pressure_Critical_Alarm_1' />
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='comment' title='' comment='MAX Pressure Sensor 2 Alarm' textarea='12,0,12,0' />
									<command class_type='call' title='Call Macro' macro='Pressure_Critical_Alarm_2' />
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='comment' title='' comment='O2 Acquarium Alarm ' textarea='12,0,12,0' />
									<command class_type='call' title='Call Macro' macro='Critical_O2_acquarium_alarm' />
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='comment' title='' comment='O2 in the furnace ABOVE threshold' textarea='12,0,12,0' />
									<command class_type='call' title='Call Macro' macro='Critical_O2_furnace_alarm' />
								</flowline>
							</case>
							<case exp='8' >
								<flowline >
									<command class_type='comment' title='' comment='The Furnace is not heating UP' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='3' />
									</command>
									<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='4' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E=8, I cannot take&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;furnace temp&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;to target&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
							<case exp='9' >
								<flowline >
									<command class_type='comment' title='' comment='The furnace is taking too long to heat up' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='3' />
									</command>
									<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='4' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E=9,It takes too&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;long to heat&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;the furnace!&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
							<case exp='10' >
								<flowline >
									<command class_type='comment' title='' comment='The furnace is not cooling down' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='3' />
									</command>
									<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='4' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E=10,I cannot take&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;the furnace temp&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;to room temperature&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='Error Management' textarea='36,25,36,25' exp='Error_Number_bis' >
							<case >
								<flowline />
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='comment' title='' comment='The furnace is taking too long to cool down' textarea='12,0,12,0' />
									<command class_type='calculation' title='Configuration of the Solenoid Valves' >
										<exp exp='S1 = &quot;OFF&quot;' />
										<exp exp='S2 = &quot;OFF&quot;' />
										<exp exp='S3 = &quot;OFF&quot;' />
										<exp exp='S4 = &quot;OFF&quot;' />
										<exp exp='S5 = &quot;OFF&quot;' />
										<exp exp='S6 = &quot;OFF&quot;' />
									</command>
									<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
									<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='3' />
									</command>
									<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
										<argument exp='4' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='0' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;E=11, It takes too&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='1' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;long to cool&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='2' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;the furnace!&quot;' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
										<argument exp='0' />
										<argument exp='3' />
									</command>
									<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
										<argument exp='&quot;PROGRAM ENDS!&quot;' />
									</command>
								</flowline>
							</case>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Inst_and_alarms_reading' description='reads the measurements from the Flow Meter 1 &amp; 2, Pressure Sensor 1 &amp; 2, O2 meter Rapidox, O2 alarm from the acquarium' >
						<local name='ADC1' type='u8' description='value from ADC1' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='ADC2' type='u8' description='value from ADC2' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='ADC3' type='u8' description='value from ADC3' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='ADC4' type='u8' description='value from ADC4' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='ADC5' type='u8' description='value from ADC5' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Input1' type='b1' description='Alarm value from the acquarium O2 detector' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='Reading the flow rate in l/min measurement from Flow Meter 1 SMC' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='flow_meter1' macro='GetVoltage' >
							<return exp='Flow_meter_1' />
						</command>
						<command class_type='comment' title='' comment='Reading the flow rate in l/min measurement from Flow Meter 2 SMC' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='flow_meter2' macro='GetVoltage' >
							<return exp='Flow_meter_2' />
						</command>
						<command class_type='comment' title='' comment='Reading the Pressure measurement from Pressure Sensor 1 GEMS' textarea='46,5,46,5' />
						<command class_type='call' title='Call Component Macro' component='pres_tras2' macro='GetVoltage' >
							<return exp='Pressure_1' />
						</command>
						<command class_type='comment' title='' comment='Reading the Pressure measurement from Pressure Sensor 2 GEMS' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='pres_tras2' macro='GetVoltage' >
							<return exp='Pressure_2' />
						</command>
						<command class_type='comment' title='' comment='Alarm reading from the O2 sensor of the RAPIDOX' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='sw_slide_sub_pcb1' macro='ReadState' >
							<return exp='O2_Alarm_Rapidox' />
						</command>
						<command class_type='comment' title='' comment='Alarm reading from the O2 sensor in the acquarium' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='sw_slide_sub_pcb2' macro='ReadState' >
							<return exp='O2_Alarm_Rapidox' />
						</command>
						<command class_type='comment' title='' comment='Reading the furnace temperature
' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='EBM008_Thermocouple1' macro='GetTypeKTemperature' >
							<return exp='furnace_temperature' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Purge_the_System' description='Before the beginning of the test the gas lines needs to be purged from any possible oxygen' >
						<return name='Return' type='b1' description='Has the purge procedure been successful?' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Initial User Messages' textarea='12,0,12,0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='Procedure_result = 1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;PURGING O2 out&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;of the system&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;IN PROGRESS...&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;HOUSE ARGON ON&quot;' />
						</command>
						<command class_type='comment' title='' comment='Open S1 and let the House argon gas flowing into the system' textarea='12,0,12,0' />
						<command class_type='calculation' title='Configuration of the Solenoid Valves' >
							<exp exp='S1 = &quot;ON&quot;' />
							<exp exp='S2 = &quot;OFF&quot;' />
							<exp exp='S3 = &quot;ON&quot;' />
							<exp exp='S4 = &quot;OFF&quot;' />
							<exp exp='S5 = &quot;OFF&quot;' />
							<exp exp='S6 = &quot;ON&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='call' title='Reading the status of the gas switching system' macro='Inst_and_alarms_reading' />
						<command class_type='delay' title='Delay' exp='3' type='2' />
						<command class_type='decision' title='Is the House gas supply present?' exp='Flow_meter_1 &gt; minimum_gas_flow_rate' swap='0' >
							<flowline />
							<flowline >
								<command class_type='comment' title='' comment='Close S1 (House gas) and open S2 (bottle gas) ' textarea='12,0,12,0' />
								<command class_type='calculation' title='Configuration of the Solenoid Valves' >
									<exp exp='S1 = &quot;OFF&quot;' />
									<exp exp='S2 = &quot;ON&quot;' />
									<exp exp='S3 = &quot;ON&quot;' />
									<exp exp='S4 = &quot;OFF&quot;' />
									<exp exp='S5 = &quot;OFF&quot;' />
									<exp exp='S6 = &quot;ON&quot;' />
								</command>
								<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='3' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;BOTTLE ARGON ON&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay' exp='3' type='2' />
						<command class_type='decision' title='Is the Bottle gas supply present?' exp='Flow_meter_1 &gt; minimum_gas_flow_rate' swap='0' >
							<flowline />
							<flowline >
								<command class_type='comment' title='' comment='I cannot have gas neither from the house nor from the bottle!!!!' textarea='56,13,56,13' />
								<command class_type='comment' title='' comment='Close ALL the solenoid valves ande stop the program and raise ERROR=1
' textarea='12,0,12,0' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='Procedure_result = 0' />
									<exp exp='Error_number = 1' />
								</command>
								<command class_type='call' title='Call Macro' macro='Error_Management' />
								<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
							</flowline>
						</command>
						<command class_type='delay' title='Delay' exp='3' type='2' />
						<command class_type='decision' title='Is the Argor coming out from the furnace?' exp='Flow_meter_2 &gt; minimum_gas_flow_rate' swap='0' >
							<flowline />
							<flowline >
								<command class_type='comment' title='' comment='Close ALL the solenoid valves ande stop the program and raise ERROR=2' textarea='12,0,12,0' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='Procedure_result = 0' />
									<exp exp='Error_number = 2' />
								</command>
								<command class_type='call' title='Call Macro' macro='Error_Management' />
								<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
							</flowline>
						</command>
						<command class_type='loop' title='Has all O2 been pushed out of the FURNACE?' textarea='500,-5,500,-5' type='1' exp='O2_rapidox &lt;= minimumO2_inside_furnace' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='Inst_and_alarms_reading' />
								<command class_type='comment' title='' comment='Critical Alarms checking' textarea='12,0,12,0' />
								<command class_type='decision' title='Check the O2 rapidox alarm' exp='O2_Alarm_Rapidox = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Procedure_result = 0' />
											<exp exp='Error_number = 7' />
										</command>
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Check the O2 alarms' exp='O2_Alarm_Aquarium = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Procedure_result = 0' />
											<exp exp='Error_number = 6' />
										</command>
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Check Pressure ' exp='Pressure_1 &gt; max_pressure_allowed' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Procedure_result = 0' />
											<exp exp='Error_number = 4' />
										</command>
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Check Pressure ' exp='Pressure_2 &gt; max_pressure_allowed' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Procedure_result = 0' />
											<exp exp='Error_number = 5' />
										</command>
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
								<command class_type='comment' title='' comment='End of critical alarm checking' textarea='12,0,12,0' />
								<command class_type='decision' title='Does it take too long to push the O2 out?' exp='counter1 &gt; max_purge_time' swap='1' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='counter1 = counter1 + 1' />
										</command>
										<command class_type='delay' title='Delay' exp='1' type='2' />
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Close ALL the solenoid valves ande stop the program and raise ERROR=3' textarea='36,17,36,17' />
										<command class_type='calculation' title='Calculation' >
											<exp exp='Procedure_result = 0' />
											<exp exp='Error_number = 3' />
										</command>
										<command class_type='call' title='Call Macro' macro='Error_Management' />
										<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='END PURGE PROC' />
						<command class_type='decision' title='Decision' comment='Is the Purge Procedure successful?' exp='Procedure_result = 1' swap='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;PURGE&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;procedure&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='2' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;FAILED!!!&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='3' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;PROGRAMS ENDS!&quot;' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Procedure_result = 0' />
								</command>
								<command class_type='comment' title='' comment='Abort the purge procedure, stop the system' textarea='12,0,12,0' />
							</flowline>
							<flowline >
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;PURGING proc&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
									<argument exp='&quot;successful&quot;' />
								</command>
								<command class_type='calculation' title='Configuration of the Solenoid Valves' >
									<exp exp='S1 = &quot;OFF&quot;' />
									<exp exp='S2 = &quot;OFF&quot;' />
									<exp exp='S3 = &quot;OFF&quot;' />
									<exp exp='S4 = &quot;OFF&quot;' />
									<exp exp='S5 = &quot;OFF&quot;' />
									<exp exp='S6 = &quot;OFF&quot;' />
								</command>
								<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
								<command class_type='comment' title='' comment='Close of the Solenoid valves and move to the next state' textarea='74,10,74,10' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Furnace_Temperature_Alarm' description='This macro manage the scenario when the temperature of the furnace is not raising ' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;Temperature&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;of the furnace&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;NOT raising&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;Shutting Down&quot;' />
						</command>
						<command class_type='calculation' title='Close all the solenoid valves' >
							<exp exp='S1 = &quot;OFF&quot;' />
							<exp exp='S2 = &quot;OFF&quot;' />
							<exp exp='S3 = &quot;OFF&quot;' />
							<exp exp='S4 = &quot;OFF&quot;' />
							<exp exp='S5 = &quot;OFF&quot;' />
							<exp exp='S6 = &quot;OFF&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='3' />
						</command>
						<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Critical_O2_furnace_alarm' description='This macro manage the scenario when the alarm is raised by the Rapidox to indicate that there is too much O2 in the furnace' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;E7 TOO MUCH O2&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;in the furnace!&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;O2value CRITICAL!&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;AG FLOODING ON&quot;' />
						</command>
						<command class_type='calculation' title='Close all the solenoid valves' >
							<exp exp='S1 = &quot;ON&quot;' />
							<exp exp='S2 = &quot;ON&quot;' />
							<exp exp='S3 = &quot;ON&quot;' />
							<exp exp='S4 = &quot;ON&quot;' />
							<exp exp='S5 = &quot;ON&quot;' />
							<exp exp='S6 = &quot;ON&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='3' />
						</command>
						<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Pressure_Critical_Alarm_2' description='This macro manage the scenario when the pressure of the system detected by PT1 is too much ' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;TOO MUCH pressure&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;in the system&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;Press Sensor 2&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;DEPRESSURISING!&quot;' />
						</command>
						<command class_type='calculation' title='Close all the solenoid valves' >
							<exp exp='S1 = &quot;OFF&quot;' />
							<exp exp='S2 = &quot;OFF&quot;' />
							<exp exp='S3 = &quot;ON&quot;' />
							<exp exp='S4 = &quot;ON&quot;' />
							<exp exp='S5 = &quot;ON&quot;' />
							<exp exp='S6 = &quot;ON&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='3' />
						</command>
						<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Pressure_Critical_Alarm_1' description='This macro manage the scenario when the pressure of the system detected by PT1 is too much ' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;TOO MUCH pressure&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;in the system&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;Press Sensor 1&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;DEPRESSURISING!&quot;' />
						</command>
						<command class_type='calculation' title='Close all the solenoid valves' >
							<exp exp='S1 = &quot;OFF&quot;' />
							<exp exp='S2 = &quot;OFF&quot;' />
							<exp exp='S3 = &quot;ON&quot;' />
							<exp exp='S4 = &quot;ON&quot;' />
							<exp exp='S5 = &quot;ON&quot;' />
							<exp exp='S6 = &quot;ON&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='3' />
						</command>
						<command class_type='comment' title='' comment='Send SMSs to Michele' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='The main program starts up the USB and then 
waits forever in a loop for incoming data.' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayStart' />
						<command class_type='interrupt' title='Interrupt' comment='This interrupt serves the O2 depletion Sensor Alarm.' enable='1' name='INT2' call='Critical_O2_acquarium_alarm' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='1' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
							</settings>
						</command>
						<command class_type='call' title='Call Macro' macro='Purge_the_System' />
						<command class_type='decision' title='Stop the program?' exp='Procedure_result = 0' swap='0' >
							<flowline >
								<command class_type='goto' title='STOP the program jump to connection point A' labelid='0' labelname='' />
								<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Purge procedure is finished' >
									<exp exp='Machine_State = 2' />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Connection Point' labelid='0' labelname='END of MAIN PROGRAM' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Critical_O2_acquarium_alarm' description='This macro manage the scenario when the alarm is raised by the O2 depletion sensor located in the acquarium ' >
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;E6 Acquarium&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;O2 depletion&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;CRITICAL ALARM&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='PrintString' >
							<argument exp='&quot;SHUTTING DOWN!&quot;' />
						</command>
						<command class_type='calculation' title='Close all the solenoid valves' >
							<exp exp='S1 = &quot;OFF&quot;' />
							<exp exp='S2 = &quot;OFF&quot;' />
							<exp exp='S3 = &quot;OFF&quot;' />
							<exp exp='S4 = &quot;OFF&quot;' />
							<exp exp='S5 = &quot;OFF&quot;' />
							<exp exp='S6 = &quot;OFF&quot;' />
						</command>
						<command class_type='call' title='Call Macro' macro='Control_Solenoid_Valve' />
						<command class_type='comment' title='' comment='Switch the furnace off' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='3' />
						</command>
						<command class_type='comment' title='' comment='Send SMSs to Nathan, Fox, Michele, Me and university security' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='v5__miac0' macro='RelayOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='d69543a8-f38b-488a-b905-9fa2d5970beb' vmin='4' vmaj='1' codename='v5__miac0' x='72' y='32' z='0.57143' xsz='104' ysz='64' zsz='1.14286' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='LCD_X' data='0' />
					<value target='LCD_Y' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='flow_meter1' x='-104' y='-24' z='5' xsz='8' ysz='56' zsz='10' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='2960685' />
					<value target='mark_col' data='255' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='0' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='000' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='flow_meter2' x='-88' y='-8' z='5' xsz='8' ysz='56' zsz='10' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='2960685' />
					<value target='mark_col' data='255' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='1' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='000' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='press_tras1' x='-72' y='8' z='5' xsz='8' ysz='56' zsz='10' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='2960685' />
					<value target='mark_col' data='255' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='2' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='000' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='pres_tras2' x='-56' y='24' z='5' xsz='8' ysz='56' zsz='10' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='2960685' />
					<value target='mark_col' data='255' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='3' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='000' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7a287a58-cba5-42ad-b8a5-58694d7f678a' vmin='2' vmaj='1' codename='sw_slide_sub_pcb1' x='-24' y='40' z='1.75' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.1' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label1' x='-96' y='-48' z='0' xsz='4.35045' ysz='8' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='FL1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label2' x='-80' y='-32' z='0' xsz='5.22054' ysz='8' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='FL2' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label3' x='-64' y='-16' z='0' xsz='5.22054' ysz='8' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='P1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label4' x='-48' y='0' z='0' xsz='5.22054' ysz='8' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='P2' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label6' x='-8' y='40' z='0' xsz='8' ysz='8' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='O2 Aq' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7a287a58-cba5-42ad-b8a5-58694d7f678a' vmin='2' vmaj='1' codename='sw_slide_sub_pcb2' x='-32' y='16' z='1.75' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label5' x='-8' y='16' z='0' xsz='8' ysz='8' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='O2 Rapidox' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d5c30cea-62de-4a55-9783-9bf9d104e3ec' vmin='0' vmaj='1' codename='EBM008_Thermocouple1' x='16' y='-40' z='0.55' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='TYPEK_CHANNEL' data='7' />
					<value target='NTC_CHANNEL' data='8' />
					<value target='VDD' data='000' />
					<value target='KADC_BITS' data='10' />
					<value target='label' data='EBM 008' />
					<value target='max_temp_typeK' data='250.000000' />
					<value target='min_temp_typeK' data='0.000000' />
					<value target='scale_divisions_typeK' data='11' />
					<value target='temperature_typeK' data='250.000000' />
					<value target='max_temp_NTC' data='125.000000' />
					<value target='min_temp_NTC' data='-25.000000' />
					<value target='scale_divisions_NTC' data='7' />
					<value target='temperature_NTC' data='24.885593' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='1' lighting='2' brightness='76' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='39' />
		<camera xe='0' ye='0' ze='378.359' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Purge_the_System' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAOgUAACADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAOgUAACADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
