<root>
<document schema='101' license='1,Martin Whitlock,JQE1YE' title='' 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='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<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='Closed' />
		<watch expr='Opened' />
		<watch expr='trigger' />
		<watch expr='trigger2' />
		<watch expr='trigger3' />
		<watch expr='trigger4' />
	</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='Closed' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='trigger4' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='trigger3' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='trigger2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Opened' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='trigger' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='Initialise the LCD' component='miac1' macro='DisplayStart' />
						<command class_type='call' title='Display instructions' component='miac1' macro='PrintString' >
							<argument exp='&quot;OPEN I1 CLOSE I2&quot;' />
						</command>
						<command class_type='loop' title='Loop forever' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Open sw input' component='miac1' macro='InputDIGITAL' >
									<return exp='trigger' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Close sw input' component='miac1' macro='InputDIGITAL' >
									<return exp='trigger2' />
									<argument exp='2' />
								</command>
								<command class_type='call' title='Micro sw 1' component='miac1' macro='InputDIGITAL' >
									<return exp='trigger3' />
									<argument exp='8' />
								</command>
								<command class_type='call' title='Micro sw 2' component='miac1' macro='InputDIGITAL' >
									<return exp='trigger4' />
									<argument exp='7' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
									<argument exp='0' />
									<argument exp='3' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
									<argument exp='&quot;Ram is:&quot;' />
								</command>
								<command class_type='decision' title='Decision' exp='trigger3' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Opened = 2' />
											<exp exp='Closed = 0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
											<argument exp='&quot;OPEN  &quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='trigger4' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='Opened = 0' />
													<exp exp='Closed = 2' />
												</command>
												<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
													<argument exp='&quot;CLOSED&quot;' />
												</command>
											</flowline>
											<flowline >
												<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
													<argument exp='&quot;?&quot;' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='I1 is pressed' exp='(trigger = 1) &amp;&amp; (Opened = 0) &amp;&amp; (Closed = 2) //&amp;&amp; = AND' swap='0' >
									<flowline >
										<command class_type='call' title='Clear LCD' component='miac1' macro='DisplayClear' />
										<command class_type='call' title='Opening Text' component='miac1' macro='PrintString' >
											<argument exp='&quot;OPENING&quot;' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='Opened = 1' />
											<exp exp='Closed = 0' />
										</command>
										<command class_type='delay' title='Delay' exp='10' type='1' />
										<command class_type='call' title='Bottom ram forward' component='miac1' macro='RelayON' >
											<argument exp='1' />
										</command>
										<command class_type='delay' title='Delay' exp='6' type='2' />
										<command class_type='loop' title='Loop' type='1' exp='trigger3' start='0' >
											<flowline >
												<command class_type='call' title='Micro sw 1' component='miac1' macro='InputDIGITAL' >
													<return exp='trigger3' />
													<argument exp='8' />
												</command>
												<command class_type='decision' title='Is microswitch 1 on?' exp='trigger3 = 1' swap='0' >
													<flowline >
														<command class_type='call' title='Top ram forward' component='miac1' macro='RelayON' >
															<argument exp='3' />
														</command>
														<command class_type='call' title='Bottom ram stop' component='miac1' macro='RelayOFF' >
															<argument exp='1' />
														</command>
														<command class_type='call' title='Bottom ram reverse start' component='miac1' macro='RelayON' >
															<argument exp='2' />
														</command>
														<command class_type='delay' title='Delay' exp='4' type='2' />
														<command class_type='call' title='Bottom ram stop' component='miac1' macro='RelayOFF' >
															<argument exp='2' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
										<command class_type='delay' title='Delay' exp='4' type='2' />
										<command class_type='call' title='Top ram stop' component='miac1' macro='RelayOFF' >
											<argument exp='3' />
										</command>
										<command class_type='loop' title='Make sure I1 is low' type='0' exp='trigger' start='0' >
											<flowline >
												<command class_type='call' title='Read the I1 input' component='miac1' macro='InputDIGITAL' >
													<return exp='trigger' />
													<argument exp='1' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Clear LCD' component='miac1' macro='DisplayClear' />
										<command class_type='call' title='Open message' component='miac1' macro='PrintString' >
											<argument exp='&quot;OPEN&quot;' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='Opened = 2' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='I2 is pressed' exp='(trigger2 = 1) &amp;&amp; (Opened = 2) &amp;&amp; (Closed = 0)' swap='0' >
											<flowline >
												<command class_type='call' title='Clear LCD' component='miac1' macro='DisplayClear' />
												<command class_type='call' title='Closing Text' component='miac1' macro='PrintString' >
													<argument exp='&quot;CLOSING&quot;' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Closed = 1' />
													<exp exp='Opened = 0' />
												</command>
												<command class_type='delay' title='Delay' exp='10' type='1' />
												<command class_type='call' title='Bottom ram forward' component='miac1' macro='RelayON' >
													<argument exp='1' />
												</command>
												<command class_type='delay' title='Delay' exp='6' type='2' />
												<command class_type='loop' title='Loop' type='1' exp='trigger4' start='0' >
													<flowline >
														<command class_type='call' title='Micro sw 2' component='miac1' macro='InputDIGITAL' >
															<return exp='trigger4' />
															<argument exp='7' />
														</command>
														<command class_type='decision' title='Is microswitch 2 on' exp='trigger4 = 1' swap='0' >
															<flowline >
																<command class_type='call' title='Top ram reverse' component='miac1' macro='RelayON' >
																	<argument exp='4' />
																</command>
																<command class_type='call' title='Bottom ram stop' component='miac1' macro='RelayOFF' >
																	<argument exp='1' />
																</command>
																<command class_type='call' title='Bottom ram reverse start' component='miac1' macro='RelayON' >
																	<argument exp='2' />
																</command>
																<command class_type='delay' title='Delay' exp='4' type='2' />
																<command class_type='call' title='Bottom ram stop' component='miac1' macro='RelayOFF' >
																	<argument exp='2' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
												<command class_type='delay' title='Delay' exp='4' type='2' />
												<command class_type='call' title='Top ram stop' component='miac1' macro='RelayOFF' >
													<argument exp='4' />
												</command>
												<command class_type='loop' title='Make sure I2 is low' type='0' exp='trigger2' start='0' >
													<flowline >
														<command class_type='call' title='Read the I2 input' component='miac1' macro='InputDIGITAL' >
															<return exp='trigger2' />
															<argument exp='2' />
														</command>
													</flowline>
												</command>
												<command class_type='call' title='Clear LCD' component='miac1' macro='DisplayClear' />
												<command class_type='call' title='Closed message' component='miac1' macro='PrintString' >
													<argument exp='&quot;CLOSED&quot;' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Closed = 2' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='delay' title='Delay' exp='100' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='d69543a8-f38b-488a-b905-9fa2d5970beb' vmin='4' vmaj='1' codename='miac1' x='-8' y='-24' z='28.75' xsz='216' ysz='200' zsz='57.5' xang='-41.4926' yang='0' zang='0' xquat='-0.354231' yquat='0' zquat='0' wquat='0.935158' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='LCD_X' data='8' />
					<value target='LCD_Y' data='3' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='pcb_switch1' x='-16' y='96' z='3.9' xsz='1' ysz='1' zsz='1' xang='-53.7172' yang='0' zang='0' xquat='-0.45179' yquat='0' zquat='0' wquat='0.892124' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.1' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
					<value target='color' data='6908265' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='pcb_switch2' x='-40' y='96' z='3.9' xsz='1' ysz='1' zsz='1' xang='-53.7172' yang='0' zang='0' xquat='-0.45179' yquat='0' zquat='0' wquat='0.892124' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
					<value target='color' data='6908265' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='pcb_switch3' x='32' y='96' z='3.9' xsz='1' ysz='1' zsz='1' xang='-53.7172' yang='0' zang='0' xquat='-0.45179' yquat='0' zquat='0' wquat='0.892124' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.2' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='001' />
					<value target='color' data='6908265' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='pcb_switch4' x='8' y='96' z='3.9' xsz='1' ysz='1' zsz='1' xang='-53.7172' yang='0' zang='0' xquat='-0.45179' yquat='0' zquat='0' wquat='0.892124' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTE.2' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='001' />
					<value target='color' data='6908265' />
				</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='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7884836' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAA4wMAAFkDAAA' zoom='75' scrollx='42' scrolly='2237' flags='0' />
	</layout>
</document>
</root>
