<root>
<document scada='0' schema='102' license='1,Roy Stephen Baker,PNYMMB' title='' description='' fcversion='524802' target='PIC16.24F.24FV32KA304' >
	<config data='!0,ffff!10,ffff!20,ffd9!30,ffbf!40,ff5f!50,ffff!60,ffff!70,ffff%0,1%1,7%10,1%11,1%20,1%25,0%26,1%27,1%30,3%32,1%33,3%35,1%36,2%40,f%44,1%45,0%46,1%50,3%52,1%53,1%54,1%55,3%57,1%60,3%67,1%70,f%74,1%76,1%77,1' clkspd='12000000' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='MAP1_VOLTS' />
		<watch expr='MAP2_VOLTS' />
		<watch expr='MAP3_VOLTS' />
		<watch expr='MAP4_VOLTS' />
		<watch expr='map2_flag' />
		<watch expr='map3_flag' />
		<watch expr='map4_flag' />
		<watch expr='map1_flag' />
		<watch expr='calling_map' />
		<watch expr='test_5v' />
		<watch expr='dac_out' />
		<watch expr='FILTER_EMA' />
		<watch expr='DEMA_F' />
		<watch expr='OLDMAP1_VOLTS' />
		<watch expr='OLDMAP2_VOLTS' />
		<watch expr='OLDMAP_VOLTS' />
		<watch expr='Filter_volts_old' />
		<watch expr='Filter_volts' />
		<watch expr='EMA_APHIA' />
		<watch expr='Filter' />
		<watch expr='Filter_index' />
		<watch expr='EMA_APHIA' />
	</debug>
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='14' />
			<data name='CalculatedCommsDelay' value='14' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='ffba683c-3821-433d-b16b-d170fe6a74e4' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' 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' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='map3_flag' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Data_ready' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='First_read' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='task' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC_delay' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Filter' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' >
						<array size='15' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAP4_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='map1_flag' type='u8' description='map1 data ready flag' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OLDMAP2_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FILTER_EMA' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</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='OLDMAP1_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EMA_APHIA' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC_Samples' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Volts_diff' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dac_out' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='NEWMAP_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAP3_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Filter_volts_old' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Filter_index' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='map4_flag' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='test_5v' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DEMA_OLD' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Filter1_active' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='map2_flag' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OLDMAP_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EMA_COUNTER' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EMA_OLD' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAP2_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OLD_CALLING_MAP' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DEMA' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DEMA_F' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAP1_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='VARIANCE_VOLTS' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='calling_map' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Filter_volts' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='EMA_FILTER' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='EMA_COUNTER = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='FILTER_EMA = EMA_APHIA * Filter_volts + ((1.0 - EMA_APHIA) * Filter_volts_old)' />
									<exp exp='EMA_OLD = FILTER_EMA' />
									<exp exp='EMA_COUNTER = 1' />
									<exp exp='DEMA = EMA_APHIA * FILTER_EMA + ((1.0 - EMA_APHIA) * EMA_OLD)' />
									<exp exp='DEMA_F = 2 * FILTER_EMA - DEMA' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='0' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' />
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' />
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='dac_out = DEMA_F' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
							<argument exp='dac_out' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='Filter_volts_old = Filter_volts' />
							<exp exp='EMA_OLD = FILTER_EMA' />
							<exp exp='DEMA_OLD = DEMA_F' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='WOT_OUT' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='C Code' ccode='/*
  Enter C code below this comment
*/' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='MAP1_VOLTS = 0' />
							<exp exp='MAP2_VOLTS = 0' />
							<exp exp='MAP3_VOLTS = 0' />
							<exp exp='MAP4_VOLTS = 0' />
							<exp exp='ADC_Samples = 2' />
							<exp exp='ADC_delay = 40' />
							<exp exp='map1_flag = 0' />
							<exp exp='map2_flag = 0' />
							<exp exp='map3_flag = 0' />
							<exp exp='map4_flag = 0' />
							<exp exp='test_5v = 128' />
							<exp exp='dac_out = 0' />
							<exp exp='EMA_APHIA = 0.90' />
							<exp exp='' />
							<exp exp='EMA_APHIA = fround (EMA_APHIA,2)' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='' />
						</command>
						<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='Filter[0] = 1.0' />
							<exp exp='Filter[1] = 1.0' />
							<exp exp='Filter[2] = 0.95' />
							<exp exp='Filter[3] = 0.9' />
							<exp exp='Filter[4] = 0.85' />
							<exp exp='Filter[5] = 0.8' />
							<exp exp='Filter[6] = 0.75' />
							<exp exp='Filter[7] = 0.7' />
							<exp exp='Filter[8] = 0.65' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='RotarySwitch1' macro='GetPosition' >
							<return exp='Filter_index' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='EMA_APHIA = Filter[Filter_index]' />
							<exp exp='EMA_APHIA = fround (EMA_APHIA,2)' />
							<exp exp='' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='Enable' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
							<argument exp='test_5v' />
						</command>
						<command class_type='label' title='Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' labelid='0' labelname='A' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='1' exp='Data_ready = 1' start='0' >
							<flowline >
								<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='16' exp='map1_flag' />
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='map1_flag = 0' swap='0' >
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='pot_color_cap1' macro='GetAverageByte' >
											<return exp='MAP1_VOLTS' />
											<argument exp='ADC_Samples' />
											<argument exp='ADC_delay' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Data_ready = 1' />
											<exp exp='calling_map = 1' />
											<exp exp='NEWMAP_VOLTS = MAP1_VOLTS' />
										</command>
									</flowline>
									<flowline >
										<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048577' mask='16' exp='map2_flag' />
										<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='map2_flag = 0' swap='0' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='pot_color_cap2' macro='GetAverageByte' >
													<return exp='MAP2_VOLTS' />
													<argument exp='ADC_Samples' />
													<argument exp='ADC_delay' />
												</command>
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='Data_ready = 1' />
													<exp exp='calling_map = 2' />
													<exp exp='NEWMAP_VOLTS = MAP2_VOLTS' />
												</command>
											</flowline>
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='1' exp='map3_flag' />
												<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='map3_flag = 0' swap='0' >
													<flowline >
														<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='pot_color_cap3' macro='GetAverageByte' >
															<return exp='MAP3_VOLTS' />
															<argument exp='ADC_Samples' />
															<argument exp='ADC_delay' />
														</command>
														<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
															<exp exp='Data_ready = 1' />
															<exp exp='calling_map = 3' />
															<exp exp='NEWMAP_VOLTS = MAP3_VOLTS' />
														</command>
													</flowline>
													<flowline >
														<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='2' exp='map4_flag' />
														<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='map4_flag = 0' swap='0' >
															<flowline >
																<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='pot_color_cap4' macro='GetAverageByte' >
																	<return exp='MAP4_VOLTS' />
																	<argument exp='ADC_Samples' />
																	<argument exp='ADC_delay' />
																</command>
																<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
																	<exp exp='Data_ready = 1' />
																	<exp exp='calling_map = 4' />
																	<exp exp='NEWMAP_VOLTS = MAP4_VOLTS' />
																</command>
															</flowline>
															<flowline />
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='First_read &lt;= 3' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='First_read = 0' swap='1' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='First_read = 1' swap='1' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='dac_out = NEWMAP_VOLTS' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
													<argument exp='dac_out' />
												</command>
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='First_read = First_read + 1' />
													<exp exp='OLDMAP2_VOLTS = OLDMAP1_VOLTS' />
													<exp exp='OLDMAP1_VOLTS = OLDMAP_VOLTS' />
													<exp exp='OLDMAP_VOLTS = NEWMAP_VOLTS' />
													<exp exp='Filter_volts_old = NEWMAP_VOLTS' />
													<exp exp='OLD_CALLING_MAP = calling_map' />
													<exp exp='calling_map = 0' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='dac_out = NEWMAP_VOLTS' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
													<argument exp='dac_out' />
												</command>
												<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='First_read = First_read + 1' />
													<exp exp='OLDMAP2_VOLTS = OLDMAP1_VOLTS' />
													<exp exp='OLDMAP1_VOLTS = OLDMAP_VOLTS' />
													<exp exp='OLDMAP_VOLTS = NEWMAP_VOLTS' />
													<exp exp='Filter_volts_old = NEWMAP_VOLTS' />
													<exp exp='OLD_CALLING_MAP = calling_map' />
													<exp exp='calling_map = 0' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='dac_out = NEWMAP_VOLTS' />
										</command>
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
											<argument exp='dac_out' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='First_read = First_read + 1' />
											<exp exp='OLDMAP_VOLTS = NEWMAP_VOLTS' />
											<exp exp='OLDMAP1_VOLTS = NEWMAP_VOLTS' />
											<exp exp='OLDMAP2_VOLTS = NEWMAP_VOLTS' />
											<exp exp='Filter_volts_old = NEWMAP_VOLTS' />
											<exp exp='OLD_CALLING_MAP = calling_map' />
											<exp exp='calling_map = 0' />
										</command>
									</flowline>
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='NEWMAP_VOLTS &lt;= OLDMAP_VOLTS' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Filter1_active = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Filter_volts = NEWMAP_VOLTS' />
										</command>
										<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='EMA_FILTER' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='dac_out = NEWMAP_VOLTS' />
										</command>
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='DAC_Output1' macro='SetOutput' >
											<argument exp='dac_out' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='VARIANCE_VOLTS = NEWMAP_VOLTS - OLDMAP_VOLTS' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='VARIANCE_VOLTS &gt;= Volts_diff' swap='0' >
									<flowline >
										<command class_type='call' title='WOT_OUT' cmdcolor='1879295' cmdcolor_sec='5751039' macro='' />
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='pot_color_cap1' x='-46.6597' y='9.40836' z='0' xsz='25.1419' ysz='25.1419' zsz='18.55' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='12' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='12' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='pot_color_cap2' x='-46.6413' y='31.0924' z='0' xsz='25.1419' ysz='25.1419' zsz='18.55' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='11' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='12' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='pot_color_cap3' x='-47.7958' y='51.622' z='0' xsz='25.1419' ysz='25.1419' zsz='18.55' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='10' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='12' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='3' vmaj='1' codename='pot_color_cap4' x='-48.2503' y='74.0245' z='0' xsz='25.1419' ysz='25.1419' zsz='18.55' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='9' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='12' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c6c91999-1fe0-414e-b6aa-0a7ddc9a6417' vmin='1' vmaj='1' codename='sw_toggle_mtl_pcb1' x='-21.7511' y='9.92985' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.4' />
					<value target='polarity' data='001' />
					<value target='debounce' data='0' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c6c91999-1fe0-414e-b6aa-0a7ddc9a6417' vmin='1' vmaj='1' codename='sw_toggle_mtl_pcb2' x='-22.2239' y='29.7895' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTB.4' />
					<value target='polarity' data='001' />
					<value target='debounce' data='0' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c6c91999-1fe0-414e-b6aa-0a7ddc9a6417' vmin='1' vmaj='1' codename='sw_toggle_mtl_pcb3' x='-24.1153' y='51.0678' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.0' />
					<value target='polarity' data='001' />
					<value target='debounce' data='10' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c6c91999-1fe0-414e-b6aa-0a7ddc9a6417' vmin='1' vmaj='1' codename='sw_toggle_mtl_pcb4' x='-25.5339' y='74.7103' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.1' />
					<value target='polarity' data='001' />
					<value target='debounce' data='0' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='70a3bead-e66d-4a76-bc7b-fb1baa86d2e6' vmin='0' vmaj='1' codename='DAC_Output1' x='2.55332' y='64.1978' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='DAC_IC' data='000' />
					<value target='DisPullDown' data='001' />
					<value target='VRef' data='000' />
					<value target='GainOP' data='001' />
					<value target='VrefVol' data='5.000000' />
					<value target='Steps' data='256' />
					<value target='BITS' data='8' />
					<value target='Res' data='1:256' />
					<value target='VoltRes' data='0.019608' />
					<value target='AddrBits' data='000' />
					<value target='cal_i2c1::CHANNEL' data='001' />
					<value target='cal_i2c1::SDA' data='$PORTB.9' />
					<value target='cal_i2c1::SDAPins' data='000' />
					<value target='cal_i2c1::SCL' data='$PORTB.8' />
					<value target='cal_i2c1::SCLPins' data='001' />
					<value target='cal_i2c1::StopDel' data='0' />
					<value target='cal_i2c1::BAUD_LIST' data='001' />
					<value target='cal_i2c1::BAUD' data='100000' />
					<value target='enabled' data='0' />
					<value target='ScopeTraces' data='0' />
					<value target='cal_i2c1::ScopeTraces' data='1' />
					<value target='cal_i2c1::ConsoleData' data='1' />
					<value target='cal_i2c1::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9306f758-06af-49f8-8b09-d10d2b4374dd' vmin='0' vmaj='1' codename='RotarySwitch1' x='-17.9341' y='142.328' z='25.4355' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='NumPositions' data='016' />
					<value target='Common' data='000' />
					<value target='Pin1' data='$PORTC.7' />
					<value target='Pin2' data='$PORTC.6' />
					<value target='Pin4' data='$PORTC.9' />
					<value target='Pin8' data='$PORTC.8' />
					<value target='angle_start' data='0.000000' />
					<value target='angle_sweep' data='360.000000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='-6.44833' ye='71.227' ze='180.096' xt='-6.44833' yt='71.227' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAXAYAAN4CAAA' zoom='75' scrollx='0' scrolly='226' flags='0' />
		<view type='0' name='EMA_FILTER' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAXAYAAN4CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='WOT_OUT' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAAXAYAAN4CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
