<root>
<document scada='0' schema='102' license='1,Bubthenib,RMFW7Y' title='' description='' fcversion='590080' target='PIC.16F.16F1937' >
	<config data='!0,fe2!10,1eff%0,2%3,0%5,1%6,1%7,1%8,1%9,3%b,1%c,0%d,0%10,3%14,3%18,0%19,1%1a,1%1c,1%1d,0' clkspd='19660800' simspd='0' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<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='9' />
			<data name='CalculatedCommsDelay' value='9' />
			<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='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='235fd689-bfd1-4c4a-a918-6c3c36e9a49f' vstate='40' vmin='0' vmaj='1' srcleaf='ExternalADC_MCP356X.fcfx' visiblename='ADC (MCP356X)' description='An external ADC featuring 2, 4, or 8 channel 24-bit input.
Capable of reading each channel independently or in differential mode.
Communication using an SPI bus up to 20MHz.' category='Analog Input' category2='' category3='' bIs2dOnly='1' catenable='1' author='MatrixTSL' manuname='' manucode='' sysinfo='1061643' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='..\..\icons\components\DAC.png' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<component class_type='root' codename='ADC_MCP356X' 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' comp2dType='0' >
			<resources />
			<properties >
				<property name='Device Configuration' folder='property_4' hidden='0' >
					<property name='Device Type' target='DevType' typeid='16' hidden='0' locked='0' info='' filter='000MCP3561
001MCP3562
002MCP3564' />
					<property name='Device Address' target='DevAddress' typeid='16' hidden='0' locked='0' info='These bits are fixed from the manufacturer and by default are 01.
Used as Bits 6 and 7 of the command byte.
Alternative bits must be requested from the manufacturer.' filter='00000
00101 (Default)
00210
00311' />
					<property name='Clock Selection' target='ClockSelection' typeid='16' hidden='0' locked='0' info='' filter='000External Digital Clock
002Internal Clock No O/P
003Internal Clock With O/P' />
					<property name='Sensor Bias Current' target='BiasCurrent' typeid='16' hidden='0' locked='0' info='' filter='000No Current
0010.9 uA
0023.7 uA
00315 uA' />
					<property name='ADC Bias Current' target='ADCBiasCurrent' typeid='16' hidden='0' locked='0' info='' filter='000Bias Current x 0.5
001Bias Current x 0.66
002Bias Current x 1
003Bias Current x 2' />
					<property name='AMCLK Prescaler' target='Prescaler' typeid='16' hidden='0' locked='0' info='' filter='000MCLK
001MCLK / 2
002MCLK / 4
003MCLK / 8' />
					<property name='Oversampling Ratio' target='OversamplingRatio' typeid='16' hidden='0' locked='0' info='' filter='00032
00164
002128
003256
004512
0051024
0062048
0074096
0088192
00916384
01020480
01124576
01240960
01349152
01481920
01598304' />
					<property name='ADC Gain' target='ADCGain' typeid='16' hidden='0' locked='0' info='' filter='000x1/3
001x1
002x2
003x4
004x8
005x16
006x32
007x64' />
					<property name='IRQ Mode' target='IRQMode' typeid='16' hidden='0' locked='0' info='' filter='000Inactive state high-Z
001Inactive state logic high' />
				</property>
				<property name='Connections' folder='property_1' hidden='0' >
					<property name='Channel' target='cal_spi1::CHANNEL' typeid='16' hidden='0' locked='0' info='SPI Channel selector' filter='000Software
001Channel 1
' />
					<property name='Prescale' target='cal_spi1::PR_SCALE' typeid='16' hidden='0' locked='0' info='Prescale option selector' filter='004Fosc/4
016Fosc/16
064Fosc/64' />
					<property name='MOSI' target='cal_spi1::MOSI' typeid='5' hidden='0' locked='1' info='SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.' />
					<property name='MOSI Remap Pin' target='cal_spi1::MOSIPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MOSI hardware pin functionality.' filter='000$PORTE.5
001$PORTE.7
002$PORTG.6
003$PORTG.8
004$PORTF.4
005$PORTF.5
006$PORTF.3
007$PORTD.0
008$PORTD.1
009$PORTD.2
010$PORTD.3
011$PORTD.4
012$PORTD.5
013$PORTD.6
014$PORTD.7
015$PORTF.0
016$PORTF.1
017$PORTE.0
018$PORTE.2
019$PORTE.4' />
					<property name='MISO' target='cal_spi1::MISO' typeid='5' hidden='0' locked='1' info='SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.' />
					<property name='MISO Remap Pin' target='cal_spi1::MISOPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MISO hardware pin functionality.' filter='085$PORTE.5
086$PORTE.6
087$PORTE.7
118$PORTG.6
119$PORTG.7
120$PORTG.8
121$PORTG.9
037$PORTB.5
036$PORTB.4
035$PORTB.3
034$PORTB.2
033$PORTB.1
032$PORTB.0
038$PORTB.6
039$PORTB.7
040$PORTB.8
041$PORTB.9
042$PORTB.10
043$PORTB.11
044$PORTB.12
045$PORTB.13
046$PORTB.14
047$PORTB.15
100$PORTF.4
101$PORTF.5
099$PORTF.3
072$PORTD.8
073$PORTD.9
074$PORTD.10
075$PORTD.11
064$PORTD.0
061$PORTC.13
062$PORTC.14
065$PORTD.1
066$PORTD.2
067$PORTD.3
068$PORTD.4
069$PORTD.5
070$PORTD.6
071$PORTD.7
096$PORTF.0
097$PORTF.1
080$PORTE.0
081$PORTE.1
082$PORTE.2
083$PORTE.3
084$PORTE.4' />
					<property name='CLK' target='cal_spi1::CLK' typeid='5' hidden='0' locked='1' info='SPI Clock Pin CLK - The Clock signal is driven by the SPI master.' />
					<property name='CLK Remap Pin' target='cal_spi1::CLKPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the CLK hardware pin functionality.' filter='000$PORTE.5
001$PORTE.7
002$PORTG.6
003$PORTG.8
004$PORTF.4
005$PORTF.5
006$PORTF.3
007$PORTD.0
008$PORTD.1
009$PORTD.2
010$PORTD.3
011$PORTD.4
012$PORTD.5
013$PORTD.6
014$PORTD.7
015$PORTF.0
016$PORTF.1
017$PORTE.0
018$PORTE.2
019$PORTE.4' />
					<property name='CS / SS' target='cal_spi1::SS' typeid='5' hidden='0' locked='0' info='Chip Select / Slave Select Pin 
Master Mode: General purpose output pin used to select the remote SPI device.
Slave Mode: Hardware chip select pin input used to select the SPI device.
' />
					<property name='Use IRQ' target='UseIRQ' typeid='7' hidden='0' locked='0' info='No: Use polling of the status register to determine when an ADC sample is complete.
Yes: Use the IRQ interrupt pin to determine when an ADC sample is complete.' />
					<property name='IRQ Pin' target='IRQPin' typeid='5' hidden='0' locked='0' info='Connected to the IRQ pin of the device, goes low on an interrupt event such as sample complete.' />
				</property>
				<property name='Simulation' folder='property_2' hidden='0' >
					<property name='Simulate Comms' target='SimComms' typeid='7' hidden='0' locked='0' info='No: Simulation is done using panel sliders.
Yes: Send SPI data via API interface and show real time data using panel sliders.' />
					<property name='Communications' folder='property_3' hidden='1' >
						<property name='Scope Traces' target='cal_spi1::ScopeTraces' typeid='7' hidden='0' locked='0' info='Selects if the scope traces are automatically generated or not' />
						<property name='Console Data' target='cal_spi1::ConsoleData' typeid='7' hidden='0' locked='0' info='Selects if the console data is automatically generated or not' />
						<property name='API' target='cal_spi1::Injector' typeid='16' hidden='0' locked='0' info='Selects the API Slave to use to send and receive real world SPI data during simulation.' filter='000' />
					</property>
				</property>
			</properties>
			<values >
				<value target='DevType' data='002' />
				<value target='DevAddress' data='001' />
				<value target='ClockSelection' data='002' />
				<value target='BiasCurrent' data='000' />
				<value target='ADCBiasCurrent' data='002' />
				<value target='Prescaler' data='000' />
				<value target='OversamplingRatio' data='003' />
				<value target='ADCGain' data='001' />
				<value target='IRQMode' data='000' />
				<value target='cal_spi1::CHANNEL' data='001' />
				<value target='cal_spi1::PR_SCALE' data='004' />
				<value target='cal_spi1::MOSI' data='$PORTC.5' />
				<value target='cal_spi1::MOSIPins' data='008' />
				<value target='cal_spi1::MISO' data='$PORTC.4' />
				<value target='cal_spi1::MISOPins' data='013' />
				<value target='cal_spi1::CLK' data='$PORTC.3' />
				<value target='cal_spi1::CLKPins' data='004' />
				<value target='cal_spi1::SS' data='$PORTC.2' />
				<value target='UseIRQ' data='1' />
				<value target='IRQPin' data='$PORTC.1' />
				<value target='SimComms' data='0' />
				<value target='cal_spi1::ScopeTraces' data='1' />
				<value target='cal_spi1::ConsoleData' data='1' />
				<value target='cal_spi1::Injector' data='000' />
			</values>
			<events >
				<event class='Components' event='Property' target='Ev_Property' />
				<event class='System' event='Timer' target='Ev_Timer' />
				<event class='Components' event='Initialise' target='Ev_Initialise' />
			</events>
			<apis >
				<api name='SampleADC' alt='SampleADC_Sim' type='1' proto='1' />
				<api name='Initialise' alt='Initialise_Sim' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Data' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Ev_Timer' description='Called back on the panel command System.TimerStart' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='TimerID' type='u32' description='The identifier passed to the System.TimerStart panel command' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Handle' type='h32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='GetConsoleHandle' >
							<return exp='.Handle' />
						</command>
						<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='SetConsoleHandle' >
							<argument exp='.Handle' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SendCommand' description='Sets the command byte for a read/write operation.
Returns true if the device has acknowledged the command.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u8' description='Starting address or Command Code' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Mode' type='u8' description='0 = Command, 1 = Static Read, 2 = Incremental Write, 3 = Incremental Read' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Count' type='u8' description='Data bytes to send or receive' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Incremental Write Command' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[0] = (DevAddress &lt;&lt; 6) | (.Address &lt;&lt; 2) | .Mode' />
						</command>
						<command class_type='call' title='CS Pin Low' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Enable_CS' />
						<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='FlashTx' />
						<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='FlashRx' />
						<command class_type='call' title='SPI Data Bytes in and out' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Transaction' >
							<argument exp='Data' />
							<argument exp='.Count' />
						</command>
						<command class_type='call' title='CS Pin High' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Disable_CS' />
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='(Data[0] &amp; 0x30) = (DevAddress &lt;&lt; 4)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Device has acknowledged' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Device has not acknowledged' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SampleADC_Sim' description='Performs a single ADC sample and returns the result as a 24-bit value' statediag='0' >
						<return name='Return' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='PositiveChannel' type='u8' description='0=CH0 - 7=CH7, 8=GND, 9=VDD, 11=REF+, 12=REF-, 13=TP, 14=TM, 15=VCM' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='NegativeChannel' type='u8' description='0=CH0 - 7=CH7, 8=GND, 9=VDD, 11=REF+, 12=REF-, 13=TP, 14=TM, 15=VCM' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Pos' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Neg' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Res' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='SimComms' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SampleADC' >
									<return exp='.Return' />
									<argument exp='.PositiveChannel' />
									<argument exp='.NegativeChannel' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.PositiveChannel &lt; 8' swap='0' >
									<flowline >
										<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='SetValue' >
											<argument exp='.PositiveChannel' />
											<argument exp='FLOAT .Return / 16777215.0' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.NegativeChannel &lt; 8' swap='0' >
									<flowline >
										<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='SetValue' >
											<argument exp='.NegativeChannel' />
											<argument exp='0.0' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.PositiveChannel &lt; 8' swap='0' >
									<flowline >
										<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='GetValue' >
											<return exp='.Pos' />
											<argument exp='.PositiveChannel' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.PositiveChannel = 9' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
													<exp exp='.Pos = 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.NegativeChannel &lt; 8' swap='0' >
									<flowline >
										<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='GetValue' >
											<return exp='.Neg' />
											<argument exp='.NegativeChannel' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.NegativeChannel = 8' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
													<exp exp='.Neg = 0' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='.Res = .Pos - .Neg' />
								</command>
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='ADCGain' >
									<case >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 0.33' />
											</command>
										</flowline>
									</case>
									<case exp='1' >
										<flowline />
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 2.0' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 4.0' />
											</command>
										</flowline>
									</case>
									<case exp='4' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 8.0' />
											</command>
										</flowline>
									</case>
									<case exp='5' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 16.0' />
											</command>
										</flowline>
									</case>
									<case exp='6' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 32.0' />
											</command>
										</flowline>
									</case>
									<case exp='7' >
										<flowline >
											<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
												<exp exp='.Res = .Res * 64.0' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.Res &lt; 0.0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='.Return = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='.Res &gt; 1.0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
													<exp exp='.Res = 1.0' />
												</command>
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='.Res = .Res * 16777215.0' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='.Return = .Res' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Initialise' description='Initialisation routine for the component once the component is linked to its parent' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to prevent initialisation' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise_Sim' description='Confgures the SPI bus ready for communications and initialises the MCP356X device.
Returns true if device is responding to commands.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='SimComms' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Initialise' >
									<return exp='.Return' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Sent when a property has been changed by the User' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempStr' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='DevType &gt; 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='DevType &gt; 1' swap='0' >
									<flowline >
										<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
											<argument exp='SensorLibraryComponent1' />
											<argument exp='&quot;Text::sText&quot;' />
											<argument exp='&quot;MCP3564 ADC&quot;' />
										</command>
										<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
											<argument exp='SensorLibraryComponent1' />
											<argument exp='&quot;ValueCount&quot;' />
											<argument exp='8' />
										</command>
									</flowline>
									<flowline >
										<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
											<argument exp='SensorLibraryComponent1' />
											<argument exp='&quot;Text::sText&quot;' />
											<argument exp='&quot;MCP3562 ADC&quot;' />
										</command>
										<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
											<argument exp='SensorLibraryComponent1' />
											<argument exp='&quot;ValueCount&quot;' />
											<argument exp='4' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
									<argument exp='SensorLibraryComponent1' />
									<argument exp='&quot;Text::sText&quot;' />
									<argument exp='&quot;MCP3561 ADC&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
									<argument exp='SensorLibraryComponent1' />
									<argument exp='&quot;ValueCount&quot;' />
									<argument exp='2' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='UseIRQ' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;IRQPin&quot;' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetVisible' >
									<argument exp='this' />
									<argument exp='&quot;IRQPin&quot;' />
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.GetValue' >
									<return exp='.TempStr' />
									<argument exp='cal_spi1' />
									<argument exp='&quot;SS&quot;' />
								</command>
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;IRQPin&quot;' />
									<argument exp='.TempStr' />
								</command>
							</flowline>
						</command>
						<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetVisible' >
							<argument exp='this' />
							<argument exp='&quot;property_3&quot;' />
							<argument exp='SimComms' />
						</command>
						<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
							<argument exp='SensorLibraryComponent1' />
							<argument exp='&quot;ShowComms&quot;' />
							<argument exp='SimComms' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='SimComms' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='System.TimerStart' >
									<argument exp='0' />
									<argument exp='200' />
								</command>
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
									<argument exp='SensorLibraryComponent1' />
									<argument exp='&quot;OutputIcon::CommsType&quot;' />
									<argument exp='5' />
								</command>
							</flowline>
							<flowline >
								<command class_type='sim' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='SensorLibraryComponent1' macro='SetConsoleHandle' >
									<argument exp='0' />
								</command>
								<command class_type='sim' title='Built-in Function' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Component.Property.SetValue' >
									<argument exp='SensorLibraryComponent1' />
									<argument exp='&quot;OutputIcon::CommsType&quot;' />
									<argument exp='255' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SampleADC' description='Performs a single ADC sample and returns the result as a 24-bit value' statediag='0' >
						<return name='Return' type='s32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='PositiveChannel' type='u8' description='0=CH0 - 7=CH7, 8=GND, 9=VDD, 11=REF+, 12=REF-, 13=TP, 14=TM, 15=VCM' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='NegativeChannel' type='u8' description='0=CH0 - 7=CH7, 8=GND, 9=VDD, 11=REF+, 12=REF-, 13=TP, 14=TM, 15=VCM' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='MUX' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[1] = (.PositiveChannel &lt;&lt; 4) | .NegativeChannel' />
						</command>
						<command class_type='call' title='Start incremental write at MUX' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
							<argument exp='6' />
							<argument exp='2' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='ADC Conversion Start - Fast Command' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
							<argument exp='10' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='UseIRQ' swap='0' >
							<flowline >
								<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='IRQPin = 1' >
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='DontCare Command - Read Status' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='Data[0] &amp; 4' >
									<flowline >
										<command class_type='call' title='DontCare Command - Read Status' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='1' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Read ADC Register' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
							<argument exp='0' />
							<argument exp='1' />
							<argument exp='3' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversionsFree1' macro='SetByte' >
							<argument exp='2' />
							<argument exp='Data[1]' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversionsFree1' macro='SetByte' >
							<argument exp='1' />
							<argument exp='Data[2]' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversionsFree1' macro='SetByte' >
							<argument exp='0' />
							<argument exp='Data[3]' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversionsFree1' macro='GetLong' >
							<return exp='.Return' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='Confgures the SPI bus ready for communications and initialises the MCP356X device.
Returns true if device is responding to commands.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversionsFree1' macro='SetByte' >
							<argument exp='3' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Init' />
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='1' type='1' />
						<command class_type='call' title='Setup Device Full Reset Command' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
							<return exp='.Return' />
							<argument exp='14' />
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='10' type='1' />
						<command class_type='calculation' title='Config 0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[1] = 0xC0 | (ClockSelection &lt;&lt; 4) | (BiasCurrent &lt;&lt; 2)' />
						</command>
						<command class_type='calculation' title='Config 1' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[2] = (Prescaler &lt;&lt; 6) | (OversamplingRatio &lt;&lt; 2)' />
						</command>
						<command class_type='calculation' title='Config 2' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[3] = (ADCBiasCurrent &lt;&lt; 6) | (ADCGain &lt;&lt; 3)' />
						</command>
						<command class_type='calculation' title='Config 3 - one shot read revert to standby, 24bit, no CRC or CAL' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[4] = 0x80' />
						</command>
						<command class_type='calculation' title='IRQ - IRQ Output, Fast Commands Enabled, ConvStart Int disabled' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Data[5] = 0x02 | (IRQMode &lt;&lt; 2)' />
						</command>
						<command class_type='call' title='Start incremental write at Config0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='SendCommand' >
							<argument exp='1' />
							<argument exp='2' />
							<argument exp='6' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='960e433c-1295-4aeb-ac84-04d75422119e' vmin='0' vmaj='1' codename='SensorLibraryComponent1' x='3' y='2' z='0' xsz='100' ysz='100' zsz='100' 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' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Text::sText' data='MCP3564 ADC' />
					<value target='ShowComms' data='0' />
					<value target='InputIcon::CommsType' data='255' />
					<value target='OutputIcon::CommsType' data='255' />
					<value target='ConsoleHandle' data='0' />
					<value target='NumDP' data='3' />
					<value target='ValueCount' data='8' />
					<value target='Label0::sText' data='CH0' />
					<value target='Max0' data='1.000000' />
					<value target='Min0' data='0.000000' />
					<value target='MajTick0' data='5' />
					<value target='MinTick0' data='0.020000' />
					<value target='Label1::sText' data='CH1' />
					<value target='Max1' data='1.000000' />
					<value target='Min1' data='0.000000' />
					<value target='MajTick1' data='5' />
					<value target='MinTick1' data='0.020000' />
					<value target='Label2::sText' data='CH2' />
					<value target='Max2' data='1.000000' />
					<value target='Min2' data='0.000000' />
					<value target='MajTick2' data='5' />
					<value target='MinTick2' data='0.020000' />
					<value target='Label3::sText' data='CH3' />
					<value target='Max3' data='1.000000' />
					<value target='Min3' data='0.000000' />
					<value target='MajTick3' data='5' />
					<value target='MinTick3' data='0.020000' />
					<value target='Label4::sText' data='CH4' />
					<value target='Max4' data='1.000000' />
					<value target='Min4' data='0.000000' />
					<value target='MajTick4' data='5' />
					<value target='MinTick4' data='0.020000' />
					<value target='Label5::sText' data='CH5' />
					<value target='Max5' data='1.000000' />
					<value target='Min5' data='0.000000' />
					<value target='MajTick5' data='5' />
					<value target='MinTick5' data='0.020000' />
					<value target='Label6::sText' data='CH6' />
					<value target='Max6' data='1.000000' />
					<value target='Min6' data='0.000000' />
					<value target='MajTick6' data='5' />
					<value target='MinTick6' data='0.020000' />
					<value target='Label7::sText' data='CH7' />
					<value target='Max7' data='1.000000' />
					<value target='Min7' data='0.000000' />
					<value target='MajTick7' data='5' />
					<value target='MinTick7' data='0.020000' />
					<value target='Label8::sText' data='Val 8' />
					<value target='Max8' data='100.000000' />
					<value target='Min8' data='0.000000' />
					<value target='MajTick8' data='10' />
					<value target='MinTick8' data='2.000000' />
					<value target='Label9::sText' data='Val 9' />
					<value target='Max9' data='100.000000' />
					<value target='Min9' data='0.000000' />
					<value target='MajTick9' data='10' />
					<value target='MinTick9' data='2.000000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='1' vmaj='2' codename='cal_spi1' x='-1' y='1' z='0.25' xsz='0.1' ysz='0.1' zsz='0.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' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='001' />
					<value target='MOSI' data='$PORTC.5' />
					<value target='MOSIPins' data='008' />
					<value target='MISO' data='$PORTC.4' />
					<value target='MISOPins' data='013' />
					<value target='CLK' data='$PORTC.3' />
					<value target='CLKPins' data='004' />
					<value target='UseAutoCS' data='1' />
					<value target='UseCS' data='0' />
					<value target='SS' data='$PORTC.2' />
					<value target='SSPins' data='000' />
					<value target='AltSSPin' data='0' />
					<value target='Mode' data='000' />
					<value target='PR_SCALE' data='004' />
					<value target='CKE' data='000' />
					<value target='CKP' data='000' />
					<value target='SMP' data='001' />
					<value target='ScopeTraces' data='1' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='000' />
					<value target='InjectorCS' data='0' />
					<value target='InjectorHandle' data='0' />
					<value target='InjectorChannel' data='0' />
					<value target='BMODE' data='4' />
					<value target='MOSI_PORT' data='$PORTC.5' />
					<value target='MOSI_TRIS' data='$PORTC.5' />
					<value target='MOSI_PIN' data='5' />
					<value target='MISO_PORT' data='$PORTC.4' />
					<value target='MISO_TRIS' data='$PORTC.4' />
					<value target='MISO_PIN' data='4' />
					<value target='SCK_PORT' data='$PORTC.3' />
					<value target='SCK_TRIS' data='$PORTC.3' />
					<value target='SCK_PIN' data='3' />
					<value target='SS_PORT' data='$PORTC.2' />
					<value target='SS_TRIS' data='$PORTC.2' />
					<value target='SS_PIN' data='2' />
					<value target='Remappable' data='' />
					<value target='MOSIReg' data='008' />
					<value target='CLKREG' data='004' />
					<value target='MOSIRPNUM' data='5' />
					<value target='MOSIBank' data='' />
					<value target='MOSIBank2' data='' />
					<value target='CLKRPNUM' data='6' />
					<value target='CLKBank' data='' />
					<value target='MISORPREG' data='RPINR20bits.SDI1R' />
					<value target='MISOBank' data='' />
					<value target='SPIName' data='' />
					<value target='MISOReg' data='000' />
					<value target='SPIClock' data='' />
					<value target='MISOBank2' data='' />
					<value target='CLKBank2' data='' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='0' />
					<value target='ClockSpeed' data='19660800' />
					<value target='MasterDivider' data='4' />
					<value target='Sim' data='1' />
					<value target='CLKRPREG' data='' />
					<value target='SSRPREG' data='RPINR21bits.SS1R' />
					<value target='SSBank' data='' />
					<value target='SSBank2' data='' />
					<value target='AltSSReg' data='' />
					<value target='AltSSMask' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3e8d8ce5-379f-45cf-99dc-b2d57e3c1964' vmin='0' vmaj='1' codename='TypeConversionsFree1' x='24' y='1' z='0' xsz='0.1' ysz='0.1' zsz='0.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' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='GenCode' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='15793151' img='' style='0' />
		<camera xe='106.103' ye='6.65107' ze='1053.4' xt='106.103' yt='6.65107' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='812' dy='485' zoom='93.271' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
	</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='781.66' 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---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SendCommand' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SampleADC' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Timer' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SampleADC_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAASQIAAEcDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
