<root>
<document schema='101' license='1,University of Cambridge MSM department,VYWE3X' 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 />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='a27065b6-ee45-4747-84cd-5e35bace72f9' 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='duty_cycle_string' type='T8' description='it is the value of the duty cycle in string' isconst='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='duty_cycle' type='u8' description='it is the duty cycle of the PWM' isconst='0' isinit='1' usrinit='100' setinit='100' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='keypad' type='u8' description='read which button has been pressed and return a number' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state' type='u8' description='describe the state of the system' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state_run_end_limitswitchM2' type='u8' description='it is the state of the limit microswitch at the end of the run of motor1' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state_run_end_limitswitchM1' type='u8' description='state of the limit switch at the end of the run of motor1' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state_run_start_limitswitchM2' type='u8' description='state of the limit switch at the start of the run of motor2' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='state_run_start_limitswitchM1' type='u8' description='state of the limit switch at the start of the run of motor1' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='run_end_message' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;end RUN!&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='2' type='2' />
					</flowline>
				</macro>
				<macro >
					<flowline name='menu_txt' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='Enable' />
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='ChangePeriod' >
							<argument exp='255' />
							<argument exp='16' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='SetDutyCycle' >
							<argument exp='duty_cycle' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='Enable' />
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='ChangePeriod' >
							<argument exp='255' />
							<argument exp='16' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='SetDutyCycle' >
							<argument exp='duty_cycle' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputON' >
							<argument exp='2' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='display_run' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;R&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;U&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;N&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot; &quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='display_initial_text' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayStart' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;Motor Controller&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;Job number 278&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;ver 1.0&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='2' type='2' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;F1start F2stop&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;UP &gt; faster&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;LOW &gt; slower&quot;' />
						</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;speed=&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='7' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintNumber' >
							<argument exp='duty_cycle' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='motors_off' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='Disable' />
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='Disable' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
							<argument exp='4' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='run_start_message' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayClear' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;start RUN!&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='2' type='2' />
					</flowline>
				</macro>
				<macro >
					<flowline name='display_menu' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;F1start F2stop&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;UP &gt; faster&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;LOW &gt; slower&quot;' />
						</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;speed=&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='7' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintNumber' >
							<argument exp='duty_cycle' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='mom' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='GetKeypad' >
							<return exp='keypad' />
						</command>
						<command class_type='delay' title='Delay' exp='100' type='1' />
						<command class_type='decision' title='Speed UP' exp='keypad = 5' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='duty_cycle = duty_cycle + 1' />
								</command>
								<command class_type='decision' title='Limit duty cycle to 200' exp='duty_cycle &gt; 245' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='duty_cycle = 245' />
										</command>
									</flowline>
									<flowline />
								</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;speed=&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
									<argument exp='7' />
									<argument exp='3' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='duty_cycle_string = ToString$ (duty_cycle)' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
									<argument exp='duty_cycle_string' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Speed UP' exp='keypad = 3' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='duty_cycle = duty_cycle - 1' />
								</command>
								<command class_type='decision' title='Limit duty cycle to 200' exp='duty_cycle &lt; 10' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='duty_cycle = 10' />
										</command>
									</flowline>
									<flowline />
								</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;speed=&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
									<argument exp='7' />
									<argument exp='3' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='duty_cycle_string = ToString$ (duty_cycle)' />
								</command>
								<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
									<argument exp='duty_cycle_string' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='display_stop' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;S&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;T&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;O&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
							<argument exp='15' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
							<argument exp='&quot;P&quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Macro' macro='display_initial_text' />
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='ChangePeriod' >
							<argument exp='255' />
							<argument exp='16' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM1' macro='SetDutyCycle' >
							<argument exp='128' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='ChangePeriod' >
							<argument exp='255' />
							<argument exp='16' />
						</command>
						<command class_type='call' title='Call Component Macro' component='PWM2' macro='SetDutyCycle' >
							<argument exp='128' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='miac1' macro='GetKeypad' >
									<return exp='keypad' />
								</command>
								<command class_type='delay' title='Delay' exp='100' type='1' />
								<command class_type='decision' title='waiting for the start to be presse' exp='keypad = 2' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' macro='display_run' />
										<command class_type='loop' title='Loop' type='0' exp='1' >
											<flowline >
												<command class_type='call' title='Call Component Macro' component='miac1' macro='GetKeypad' >
													<return exp='keypad' />
												</command>
												<command class_type='delay' title='Delay' exp='100' type='1' />
												<command class_type='decision' title='Waiting for the stop to be [ressed' exp='keypad = 0' swap='1' >
													<flowline >
														<command class_type='switch' title='Switch' textarea='36,25,36,25' exp='state' >
															<case >
																<flowline />
															</case>
															<case exp='1' >
																<flowline >
																	<command class_type='comment' title='' comment='M1 goes forward
M2 stationary at the
start of the run' textarea='12,0,12,0' />
																	<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
																		<argument exp='12' />
																		<argument exp='3' />
																	</command>
																	<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
																		<argument exp='&quot;S1&quot;' />
																	</command>
																	<command class_type='comment' title='' comment='M1 Forward' textarea='12,0,12,0' />
																	<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputON' >
																		<argument exp='2' />
																	</command>
																	<command class_type='delay' title='Delay' exp='10' type='1' />
																	<command class_type='call' title='Call Component Macro' component='PWM1' macro='Enable' />
																	<command class_type='calculation' title='Calculation' >
																		<exp exp='state = 2' />
																	</command>
																</flowline>
															</case>
															<case exp='2' >
																<flowline >
																	<command class_type='call' title='Checking if M1 has reached the end of the run' component='run_end_m1' macro='ReadState' >
																		<return exp='state_run_end_limitswitchM1' />
																	</command>
																	<command class_type='decision' title='If the M1 has reached the end of the run then' exp='state_run_end_limitswitchM1 = 1' swap='0' >
																		<flowline >
																			<command class_type='comment' title='' comment='M1 stops at the 
end of the run
M2 goes Forward' textarea='12,0,12,0' />
																			<command class_type='comment' title='' comment='M1 OFF' textarea='12,0,12,0' />
																			<command class_type='call' title='Call Component Macro' component='PWM1' macro='Disable' />
																			<command class_type='comment' title='' comment='M2 FORWARD' textarea='12,0,12,0' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputON' >
																				<argument exp='4' />
																			</command>
																			<command class_type='delay' title='Delay' exp='10' type='1' />
																			<command class_type='call' title='Motor2 off' component='PWM2' macro='Enable' />
																			<command class_type='calculation' title='Calculation' >
																				<exp exp='state = 3' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
																				<argument exp='12' />
																				<argument exp='3' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
																				<argument exp='&quot;S3&quot;' />
																			</command>
																		</flowline>
																		<flowline />
																	</command>
																</flowline>
															</case>
															<case exp='3' >
																<flowline >
																	<command class_type='call' title='Call Component Macro' component='run_end_m2' macro='ReadState' >
																		<return exp='state_run_end_limitswitchM2' />
																	</command>
																	<command class_type='decision' title='If M2 has reached the end of the run' exp='state_run_end_limitswitchM2 = 1' swap='0' >
																		<flowline >
																			<command class_type='comment' title='' comment='M2 stops at 
the end of the run
M1 goes Backward' textarea='159,53,515,53' />
																			<command class_type='comment' title='' comment='M2 OFF' textarea='12,0,12,0' />
																			<command class_type='call' title='Motor2 off' component='PWM2' macro='Disable' />
																			<command class_type='comment' title='' comment='M1 BACKWARD' textarea='12,0,12,0' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
																				<argument exp='2' />
																			</command>
																			<command class_type='delay' title='Delay' exp='10' type='1' />
																			<command class_type='call' title='Call Component Macro' component='PWM1' macro='Enable' />
																			<command class_type='calculation' title='Calculation' >
																				<exp exp='state = 4' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
																				<argument exp='12' />
																				<argument exp='3' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
																				<argument exp='&quot;S4&quot;' />
																			</command>
																		</flowline>
																		<flowline />
																	</command>
																</flowline>
															</case>
															<case exp='4' >
																<flowline >
																	<command class_type='call' title='Call Component Macro' component='run_start1_m1' macro='ReadState' >
																		<return exp='state_run_start_limitswitchM1' />
																	</command>
																	<command class_type='decision' title='Has the motor1 arrived at the start of its run?' exp='state_run_start_limitswitchM1 = 1' swap='0' >
																		<flowline >
																			<command class_type='comment' title='' comment='M1 stops at 
the start of the run
M2 goes Backward' textarea='48,143,48,143' />
																			<command class_type='comment' title='' comment='M1 OFF' textarea='12,0,12,0' />
																			<command class_type='call' title='Motor1 off' component='PWM1' macro='Disable' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
																				<argument exp='1' />
																			</command>
																			<command class_type='comment' title='' comment='M2 BACKWARD' textarea='12,0,12,0' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
																				<argument exp='4' />
																			</command>
																			<command class_type='delay' title='Delay' exp='10' type='1' />
																			<command class_type='call' title='Call Component Macro' component='PWM2' macro='Enable' />
																			<command class_type='calculation' title='Calculation' >
																				<exp exp='state = 5' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
																				<argument exp='12' />
																				<argument exp='3' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
																				<argument exp='&quot;S5&quot;' />
																			</command>
																		</flowline>
																		<flowline />
																	</command>
																</flowline>
															</case>
															<case exp='5' >
																<flowline >
																	<command class_type='call' title='Call Component Macro' component='run_start_m2' macro='ReadState' >
																		<return exp='state_run_start_limitswitchM2' />
																	</command>
																	<command class_type='decision' title='Has motor2 arrived at the start of its run?' exp='state_run_start_limitswitchM2 = 1' swap='0' >
																		<flowline >
																			<command class_type='comment' title='' comment='M2 stops at the start
of the run
M1 goes Forward' textarea='45,134,45,134' />
																			<command class_type='comment' title='' comment='M2 OFF' textarea='12,0,12,0' />
																			<command class_type='call' title='Motor2 off' component='PWM2' macro='Disable' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputOFF' >
																				<argument exp='3' />
																			</command>
																			<command class_type='comment' title='' comment='M1 FORWARD' textarea='12,0,12,0' />
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='OutputON' >
																				<argument exp='2' />
																			</command>
																			<command class_type='delay' title='Delay' exp='10' type='1' />
																			<command class_type='call' title='Call Component Macro' component='PWM1' macro='Enable' />
																			<command class_type='calculation' title='Calculation' >
																				<exp exp='state = 2' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='DisplayCursor' >
																				<argument exp='12' />
																				<argument exp='3' />
																			</command>
																			<command class_type='call' title='Call Component Macro' component='miac1' macro='PrintString' >
																				<argument exp='&quot;S2&quot;' />
																			</command>
																		</flowline>
																		<flowline />
																	</command>
																</flowline>
															</case>
														</command>
													</flowline>
													<flowline >
														<command class_type='call' title='Call Macro' macro='motors_off' />
														<command class_type='call' title='Call Macro' macro='display_menu' />
														<command class_type='call' title='Call Macro' macro='display_stop' />
														<command class_type='goto' title='Goto Connection Point' labelid='0' labelname='' />
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='label' title='Connection Point' labelid='0' labelname='A' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='d69543a8-f38b-488a-b905-9fa2d5970beb' vmin='4' vmaj='1' codename='miac1' x='-16' y='8' z='28.75' xsz='133' ysz='98.5' zsz='57.5' 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='14' />
					<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='run_start_m2' x='16' y='72' z='3.9' 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='$PORTA.3' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
					<value target='color' data='65298' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='run_end_m1' x='-72' y='88' z='3.9' 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='$PORTA.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='0' />
					<value target='operation' data='000' />
					<value target='color' data='8388863' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label1' x='-40' y='88' 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='END run motor1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label2' x='-32' y='72' 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='START run motor1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM1' x='-32' y='-72' z='0.941333' xsz='1.06667' ysz='1.06667' zsz='1.06667' 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='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTC.2' />
					<value target='RemapPin' data='' />
					<value target='timer' data='2' />
					<value target='period' data='255' />
					<value target='prescale' data='4' />
					<value target='period_calc' data='341.333344' />
					<value target='frequency_calc' data='2.929688' />
					<value target='pwm_prescale' data='16' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM2' x='32' y='-72' z='0.8825' 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='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTC.2' />
					<value target='RemapPin' data='' />
					<value target='timer' data='2' />
					<value target='period' data='255' />
					<value target='prescale' data='4' />
					<value target='period_calc' data='341.333344' />
					<value target='frequency_calc' data='2.929688' />
					<value target='pwm_prescale' data='16' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='run_start1_m1' x='-72' y='72' z='3.9' 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='$PORTA.1' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
					<value target='color' data='65298' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='fc04a65f-f03d-40c8-9f69-0d23d2daac29' vmin='1' vmaj='1' codename='run_end_m2' x='16' y='88' z='3.9' 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='$PORTA.2' />
					<value target='polarity' data='000' />
					<value target='debounce' data='0' />
					<value target='operation' data='000' />
					<value target='color' data='8388863' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label3' x='52' y='88' z='0' xsz='7.55245' 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='END run motor2' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label4' x='56' y='72' 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='START run motor2' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='15335401' 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='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' 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---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='2072' scrolly='1296' flags='0' />
		<view type='0' name='display_run' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='display_stop' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='display_initial_text' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='motors_off' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='mom' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAdAAAA4QQAAHkDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
