<root>
<document scada='0' schema='103' license='1,60868906,D4HYFN' title='' description='' fcversion='590593' target='RPI.RPI.RPI3B' >
	<config data='' clkspd='76800000' simspd='1' usewdt='0' constif='0' SSH_IP='01652BBCDF86326BF8A2026443CB1E64' SSH_User='35D86298AE8D4565DD6171BB7AD97877' SSH_Pass='FCF7C18E589E5238' SSH_Sudo='1' 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='6' />
			<data name='ClockPin' value='26' />
			<data name='DataPort' value='6' />
			<data name='DataPin' value='16' />
			<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='00e439e9-9de0-4bd0-a1ad-95dea36d8a66' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<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' comp2dType='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Count' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='InStringLen' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_Power' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_PowerWeb' type='T8' description='Convert to string for web page' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_String' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_1_Current' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='NoData_Web' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Data' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_2_Power' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Data_Web' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='InDataString' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='40' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_2_String' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_1_CurrentWeb' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_1_String' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='NoData' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_2_PowerWeb' type='T8' description='Convert to string for web page' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_Total_Power' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_1_PowerWeb' type='T8' description='Convert to string for web page' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_1_Power' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_2_Current' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='InStringLen_Web' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_CurrentWeb' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_Current' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_Total_PowerWeb' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_2_CurrentWeb' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Sensor_3_CurrWeb' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Webserver' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Written as a macro to tidy up the main routine.' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='calculation' title='Convert floats to strings for web page' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Sensor_1_CurrentWeb = FloatToString$ (Sensor_1_Current)' />
							<exp exp='Sensor_2_CurrentWeb = FloatToString$ (Sensor_2_Current)' />
							<exp exp='Sensor_3_CurrentWeb = FloatToString$ (Sensor_3_Current)' />
							<exp exp='' />
							<exp exp='Sensor_1_PowerWeb = FloatToString$ (Sensor_1_Power)' />
							<exp exp='Sensor_2_PowerWeb = FloatToString$ (Sensor_2_Power)' />
							<exp exp='Sensor_3_PowerWeb = FloatToString$ (Sensor_3_Power)' />
							<exp exp='' />
							<exp exp='Sensor_Total_PowerWeb = FloatToString$ (Sensor_Total_Power)' />
							<exp exp='' />
							<exp exp='//For diagnostics' />
							<exp exp='NoData_Web = ToString$ (NoData)' />
							<exp exp='Data_Web = ToString$ (Data)' />
							<exp exp='InStringLen_Web = ToString$ (InStringLen)' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='CheckSocketActivity' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='0' />
							<argument exp='InDataString' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='1' />
							<argument exp='Sensor_1_String' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='2' />
							<argument exp='Sensor_2_String' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='3' />
							<argument exp='Sensor_3_String' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='4' />
							<argument exp='Sensor_1_CurrentWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='5' />
							<argument exp='Sensor_2_CurrentWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='6' />
							<argument exp='Sensor_3_CurrentWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='7' />
							<argument exp='Sensor_1_PowerWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='8' />
							<argument exp='Sensor_2_PowerWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='9' />
							<argument exp='Sensor_3_PowerWeb' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='13' />
							<argument exp='Sensor_Total_PowerWeb' />
						</command>
						<command class_type='call' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='10' />
							<argument exp='NoData_Web' />
						</command>
						<command class_type='call' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='11' />
							<argument exp='Data_Web' />
						</command>
						<command class_type='call' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='SetOutValue' >
							<argument exp='12' />
							<argument exp='InStringLen_Web' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='VersionHistory' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='V1.4A Rounded power values before web browser.
Total sensor power added to web output page.' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='V1.3A has a simplified calculation. 
V1.3 Web server output changed order and current values added.
' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='V1.2 Some diagnostics removed
Simlink uses serial4 ln -s /dev/ttyUSB0 /dev/serial4 in /etc/rg.local
to make it persistent.
Put console and bluetooth back in.' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='V1.1 First version that actually returned data.
Main issue appeared to be setting the com port in the Pi 3B.
Read the details in the RPI_CAL_UART file.
Remove console and enable UART, also disabled bluetooth and 
created symlink from serial1 to ttyUSB0 (from memory needs SUDO)' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
					</flowline>
				</macro>
				<macro >
					<flowline name='HexStrToInt' description='' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='str' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='len' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='i' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='x' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='c' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='.len = Length$ (.str)' />
							<exp exp='.x = 0' />
							<exp exp='.i = 0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='.i &lt; .len' >
							<flowline >
								<command class_type='calculation' title='Make way for the next digit' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='.x = .x * 16' />
									<exp exp='.c = .str[.i]' />
								</command>
								<command class_type='decision' title='Is it a digit' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='(.c &gt;= &apos;0&apos;) &amp;&amp; (.c &lt;= &apos;9&apos;)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='.x = .x + (.c - &apos;0&apos;)' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Hex digit' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='(.c &gt;= &apos;A&apos;) &amp;&amp; (.c &lt;= &apos;F&apos;)' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
													<exp exp='.x = .x + (.c - &apos;A&apos; + 10)' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='End of valid number so lets bail out of the loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
													<exp exp='.i = .len' />
												</command>
											</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='.i = .i + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' break='1' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='.Return = .x' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='x' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='RetXX' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call the initialise Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Initialise' />
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Wait up to 200ms for an incoming data string.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='UART1' macro='ReceiveString' >
									<return exp='InDataString' />
									<argument exp='200' />
									<argument exp='40' />
								</command>
								<command class_type='calculation' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='InStringLen = Length$ (InDataString)' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='InDataString[0] == 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='NoData = NoData + 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Split the data string to individual sensor values.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='//Test data to verify this and later calculations.' />
											<exp exp='//InDataString = &quot;0123 4567 89AB&quot;' />
											<exp exp='' />
											<exp exp='Sensor_1_String = Left$ (InDataString,4)' />
											<exp exp='Sensor_2_String = Mid$ (InDataString,5,4)' />
											<exp exp='Sensor_3_String = Mid$ (InDataString,10,4)' />
										</command>
										<command class_type='call' title='Convert sensor 1 Hex value to Decimal.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HexStrToInt' >
											<return exp='Sensor_1_Current' />
											<argument exp='Sensor_1_String' />
										</command>
										<command class_type='call' title='Convert sensor 2 Hex value to Decimal.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HexStrToInt' >
											<return exp='Sensor_2_Current' />
											<argument exp='Sensor_2_String' />
										</command>
										<command class_type='call' title='Convert sensor 3 Hex value to Decimal.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HexStrToInt' >
											<return exp='Sensor_3_Current' />
											<argument exp='Sensor_3_String' />
										</command>
										<command class_type='calculation' title='Convert the sensor &quot;current&quot; values to mA.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='//Sensor_1_Current = Sensor_1_Current / 100' />
											<exp exp='//Sensor_2_Current = Sensor_2_Current / 100' />
											<exp exp='//Sensor_3_Current = Sensor_3_Current / 100' />
										</command>
										<command class_type='calculation' title='Convert the sensor &quot;current&quot; values to power.' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='Sensor_1_Power = Sensor_1_Current * 240 / 100000' />
											<exp exp='Sensor_2_Power = Sensor_2_Current * 240 / 100000' />
											<exp exp='Sensor_3_Power = Sensor_3_Current * 240 / 100000' />
											<exp exp='Sensor_Total_Power = Sensor_1_Power + Sensor_2_Power + Sensor_3_Power' />
											<exp exp='' />
											<exp exp='fround (Sensor_1_Power,3)' />
											<exp exp='fround (Sensor_2_Power,3)' />
											<exp exp='fround (Sensor_3_Power,3)' />
											<exp exp='fround (Sensor_Total_Power,3)' />
										</command>
										<command class_type='calculation' title='Diagnostic' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='Data = Data + 1' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call the webserver macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Webserver' />
								<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='1000' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Written as a macro to tidy up the main routine.' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='UART1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='UART1' macro='ChangeHWBaud' >
							<argument exp='4' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TCP_IP_Pi1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='NetworkComms1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='Webserver1' macro='CreateServerSocket' >
							<argument exp='80' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='a1c9b843-a641-4b9c-b762-26995b8f9464' vmin='5' vmaj='1' codename='Webserver1' x='-70' y='90' z='0' xsz='25' ysz='25' zsz='25' 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='label' data='Web Server' />
					<value target='RXBuffSize' data='1024' />
					<value target='Component' data='NetworkComms1' />
					<value target='html_source' data='000' />
					<value target='Directory' data='$(srcdir)' />
					<value target='FComponent' data='NetworkComms1' />
					<value target='max_pages' data='2' />
					<value target='name1' data='index.htm' />
					<value target='html1' data='&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;Flowcode Webserver&lt;/h1&gt;
Webpage Created by Flowcode Webserver.&lt;br /&gt;
InData = %0&lt;br/&gt;
--------------------------&lt;br/&gt;
&lt;h1&gt;Ground&lt;/h1&gt;&lt;br/&gt;
1_String = %1&lt;br/&gt;
1_Current(mA) = %4&lt;br/&gt;
1_Power(kW) = %7&lt;br/&gt;
--------------------------&lt;br/&gt;
&lt;h1&gt;First&lt;/h1&gt;&lt;br/&gt;
2_String = %2&lt;br/&gt;
2_Current(mA) = %5&lt;br/&gt;
2_Power(kW) = %8&lt;br/&gt;
--------------------------&lt;br/&gt;
&lt;h1&gt;Total&lt;/h1&gt;&lt;br/&gt;
3_String = %3&lt;br/&gt;
3_Current(mA) = %6&lt;br/&gt;
3_Power(kW) = %9&lt;br/&gt;
--------------------------&lt;br/&gt;
Display = %13&lt;br/&gt;
--------------------------&lt;br/&gt;
No Data Loop = %10&lt;br/&gt;
Data Loop = %11&lt;br/&gt;
In String Length = %12&lt;br/&gt;
&lt;a href=&quot;page2.htm&quot;&gt;Click here for page2.&lt;/a&gt;
&lt;meta http-equiv=&quot;refresh&quot; content=&quot;1&quot; &gt;
&lt;/body&gt;
&lt;/html&gt;' />
					<value target='name2' data='page2.htm' />
					<value target='html2' data='&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;Flowcode SCADA Page2&lt;/h1&gt;
Webpage Created by Flowcode Webserver.&lt;br /&gt;
&lt;a href=&quot;index.htm&quot;&gt;Click here for page1.&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;' />
					<value target='name3' data='page3.htm' />
					<value target='html3' data='' />
					<value target='name4' data='page4.htm' />
					<value target='html4' data='' />
					<value target='Outgoing_Count' data='014' />
					<value target='Out_Len_0' data='30' />
					<value target='Out_Len_1' data='4' />
					<value target='Out_Len_2' data='4' />
					<value target='Out_Len_3' data='4' />
					<value target='Out_Len_4' data='20' />
					<value target='Out_Len_5' data='20' />
					<value target='Out_Len_6' data='20' />
					<value target='Out_Len_7' data='20' />
					<value target='Out_Len_8' data='20' />
					<value target='Out_Len_9' data='20' />
					<value target='Out_Len_10' data='20' />
					<value target='Out_Len_11' data='20' />
					<value target='Out_Len_12' data='20' />
					<value target='Out_Len_13' data='20' />
					<value target='Out_Len_14' data='20' />
					<value target='Out_Len_15' data='20' />
					<value target='Out_Len_16' data='20' />
					<value target='Out_Len_17' data='20' />
					<value target='Out_Len_18' data='20' />
					<value target='Out_Len_19' data='20' />
					<value target='Out_Len_20' data='20' />
					<value target='Out_Len_21' data='20' />
					<value target='Out_Len_22' data='20' />
					<value target='Out_Len_23' data='20' />
					<value target='Out_Len_24' data='20' />
					<value target='Out_Len_25' data='20' />
					<value target='Out_Len_26' data='20' />
					<value target='Out_Len_27' data='20' />
					<value target='Out_Len_28' data='20' />
					<value target='Out_Len_29' data='20' />
					<value target='Incoming_Count' data='001' />
					<value target='In_Len_0' data='20' />
					<value target='In_Len_1' data='20' />
					<value target='In_Len_2' data='20' />
					<value target='In_Len_3' data='20' />
					<value target='In_Len_4' data='20' />
					<value target='In_Len_5' data='20' />
					<value target='In_Len_6' data='20' />
					<value target='In_Len_7' data='20' />
					<value target='In_Len_8' data='20' />
					<value target='In_Len_9' data='20' />
					<value target='In_Len_10' data='20' />
					<value target='In_Len_11' data='20' />
					<value target='In_Len_12' data='20' />
					<value target='In_Len_13' data='20' />
					<value target='In_Len_14' data='20' />
					<value target='In_Len_15' data='20' />
					<value target='In_Len_16' data='20' />
					<value target='In_Len_17' data='20' />
					<value target='In_Len_18' data='20' />
					<value target='In_Len_19' data='20' />
					<value target='BMP' data='1' />
					<value target='GIF' data='1' />
					<value target='JPG' data='1' />
					<value target='PNG' data='1' />
					<value target='ICO' data='1' />
					<value target='CSS' data='1' />
					<value target='CSV' data='1' />
					<value target='TXT' data='1' />
					<value target='JS' data='1' />
					<value target='JAR' data='1' />
					<value target='JSON' data='1' />
					<value target='PDF' data='1' />
					<value target='XML' data='1' />
					<value target='RAR' data='1' />
					<value target='ZIP' data='1' />
					<value target='TTF' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='0341d84f-f7fd-473c-8076-b38b2d563e13' vmin='9' vmaj='1' codename='TCP_IP_Pi1' x='107' y='91' z='0' xsz='71' ysz='32' zsz='2.01' 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='label' data='RPi TCP/IP' />
					<value target='RemapIndex' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='91049bf5-2436-42dc-947a-c30c86463d98' vmin='5' vmaj='1' codename='NetworkComms1' x='20' y='90' 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' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Component' data='TCP_IP_Pi1' />
					<value target='TCPIP_Channel' data='000' />
					<value target='RemapIndex' data='1' />
					<value target='Status' data='Supported' />
					<value target='Sim' data='0' />
					<value target='SimControl' data='000' />
					<value target='NetworkInterface' data='000' />
					<value target='IPAddress' data='192.168.1.67' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='3' codename='UART1' x='0' y='0' z='0' xsz='25' ysz='25' zsz='25' 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='cal_uart::CHANNEL' data='005' />
					<value target='cal_uart::BAUD_LIST' data='005' />
					<value target='cal_uart::BAUD' data='19200' />
					<value target='cal_uart::DBITS' data='008' />
					<value target='cal_uart::RETURN' data='001' />
					<value target='cal_uart::ECHO' data='000' />
					<value target='cal_uart::UseTX' data='1' />
					<value target='cal_uart::TX' data='$PORTG.14' />
					<value target='cal_uart::OutputPins' data='007' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::UseRX' data='1' />
					<value target='cal_uart::RX' data='$PORTG.15' />
					<value target='cal_uart::InputPins' data='013' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='cal_uart::FLOWEN' data='000' />
					<value target='cal_uart::RTS' data='$PORTB.2' />
					<value target='cal_uart::CTS' data='$PORTB.1' />
					<value target='label' data='UART' />
					<value target='cal_uart::ScopeTraces' data='0' />
					<value target='cal_uart::ConsoleData' data='1' />
					<value target='cal_uart::ConsoleFormat' data='000' />
					<value target='cal_uart::ConsoleColumns' data='64' />
					<value target='cal_uart::DataSource' data='000' />
					<value target='cal_uart::com_port' data='000' />
					<value target='cal_uart::Injector' data='000' />
					<value target='cal_uart::APIUseDDR' data='' />
					<value target='cal_uart::APIDDRPin' data='' />
					<value target='cal_uart::APIDDRRXState' data='' />
					<value target='cal_uart::APIUseFC' data='' />
					<value target='cal_uart::APICTSPin' data='' />
					<value target='cal_uart::APIRTSPin' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='2105930' img='' style='0' />
		<camera xe='21.5037' ye='49.3562' ze='276.48' xt='21.5037' yt='49.3562' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='357' dy='683' zoom='156.239' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='76' perspective='1' >
		<background rgb='9868950' img='' style='0' />
		<table rgb='11842740' 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---------------------wUAAAAYAAAAewcAAJ8DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='HexStrToInt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAewcAAJ8DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAewcAAJ8DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Webserver' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAewcAAJ8DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='VersionHistory' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAewcAAJ8DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
