<root>
<document schema='101' license='1,roy johnston,DUY6FT' title='' description='' target='PIC.18F.18F4550' >
	<config data='!0,7ee4!10,e0de!20,7dff!30,ff9b!40,ffff!50,ffff!60,ffff%5,1%3,0%0,4%8,e%e,1%f,0%15,0%10,0%11,3%13,3%18,0%19,0%28,1%29,0%2a,1%2f,0%30,1%32,0%35,0%36,0%37,1%40,1%41,1%42,1%43,1%4f,1%4e,1%50,1%51,1%52,1%53,1%5f,1%5e,1%5d,1%60,1%61,1%62,1%63,1%6e,1' clkspd='20000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='32182528-1a89-4d0d-9806-9f7d5cddcf44' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='Misc' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
			<resources />
			<properties >
				<property name='Your Server Port' target='FCM_ServerPort' typeid='21' hidden='0' locked='0' info='' expansion='$(type)_$(module)__$(variable:u)' initialiser='($(value))' />
			</properties>
			<values >
				<value target='FCM_ServerPort' data='255' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='dataTx' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='19' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='13' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ReceiveData' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</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='cnt13' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt12' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt11' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt10' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='nimbus' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RetVal' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DataPointer' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='water' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt9' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt8' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt7' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='flag2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='flag1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='waterstring1' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='water1' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DataLength' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in4' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in3' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='out' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='13' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='in1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='watchdog_timer' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='waterstring' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Count_Farm_Water' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='reset borehole counter' cmdcolor='3568629' cmdcolor_sec='3568629' exp='out[6] = &apos;1&apos;' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='waterstring1[0] = ReceiveData[5]' />
									<exp exp='waterstring1[1] = ReceiveData[6]' />
									<exp exp='waterstring1[2] = ReceiveData[7]' />
									<exp exp='waterstring1[3] = ReceiveData[8]' />
									<exp exp='waterstring1[4] = ReceiveData[9]' />
									<exp exp='waterstring1[5] = ReceiveData[10]' />
									<exp exp='waterstring1[6] = ReceiveData[11]' />
									<exp exp='waterstring1[7] = ReceiveData[12]' />
									<exp exp='water1 = StringToInt$ (waterstring1)' />
									<exp exp='out[6] = &apos;0&apos;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='input' title='input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048579' mask='8' exp='in2' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='in2 = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='flag2 = 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='flag2 = 1' />
											<exp exp='water1 = water1 + 1' />
											<exp exp='' />
											<exp exp='' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='flag2 = 0' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='execute' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='watchdog' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Nimbus_Delay' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='inputs' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='outputs' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Count_Farm_Water' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Count_borehole_water' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Analise_home_Water' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Analise_Borehole_Water' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Nimbus_Delay' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='1307188 = one minute   60 Minutes' cmdcolor='3568629' cmdcolor_sec='3568629' exp='cnt12 &gt; 78431280' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt12 = cnt12 + 1' />
									<exp exp='nimbus = 0' />
									<exp exp='in[12] = &apos;f&apos;' />
								</command>
								<command class_type='decision' title='10 minutes?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='cnt12 &gt; 65359400' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='cnt12 = 0' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt12 = cnt12 + 1' />
									<exp exp='nimbus = 1' />
									<exp exp='in[12] = &apos;1&apos;' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Analise_Borehole_Water' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='waterstring = ToString$ (water)' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 10' swap='1' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 100' swap='1' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 1000' swap='1' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 10000' swap='1' >
													<flowline >
														<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 100000' swap='1' >
															<flowline >
																<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 1000000' swap='1' >
																	<flowline >
																		<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water &lt; 10000000' swap='1' >
																			<flowline />
																			<flowline >
																				<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																					<exp exp='waterstring[7] = &apos;f&apos;' />
																				</command>
																			</flowline>
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																			<exp exp='waterstring[6] = &apos;f&apos;' />
																			<exp exp='waterstring[7] = &apos;f&apos;' />
																		</command>
																	</flowline>
																</command>
															</flowline>
															<flowline >
																<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='waterstring[5] = &apos;f&apos;' />
																	<exp exp='waterstring[6] = &apos;f&apos;' />
																	<exp exp='waterstring[7] = &apos;f&apos;' />
																</command>
															</flowline>
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='waterstring[4] = &apos;f&apos;' />
															<exp exp='waterstring[5] = &apos;f&apos;' />
															<exp exp='waterstring[6] = &apos;f&apos;' />
															<exp exp='waterstring[7] = &apos;f&apos;' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='waterstring[3] = &apos;f&apos;' />
													<exp exp='waterstring[4] = &apos;f&apos;' />
													<exp exp='waterstring[5] = &apos;f&apos;' />
													<exp exp='waterstring[6] = &apos;f&apos;' />
													<exp exp='waterstring[7] = &apos;f&apos;' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='waterstring[2] = &apos;f&apos;' />
											<exp exp='waterstring[3] = &apos;f&apos;' />
											<exp exp='waterstring[4] = &apos;f&apos;' />
											<exp exp='waterstring[5] = &apos;f&apos;' />
											<exp exp='waterstring[6] = &apos;f&apos;' />
											<exp exp='waterstring[7] = &apos;f&apos;' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='waterstring[1] = &apos;f&apos;' />
									<exp exp='waterstring[2] = &apos;f&apos;' />
									<exp exp='waterstring[3] = &apos;f&apos;' />
									<exp exp='waterstring[4] = &apos;f&apos;' />
									<exp exp='waterstring[5] = &apos;f&apos;' />
									<exp exp='waterstring[6] = &apos;f&apos;' />
									<exp exp='waterstring[7] = &apos;f&apos;' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='outputs' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='is Reservoir  full then put off output 1' cmdcolor='3568629' cmdcolor_sec='3568629' exp='in4 = 0' swap='0' >
							<flowline >
								<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='0' />
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt12 = 0' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='nimbus = 1' swap='0' >
									<flowline >
										<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='1' />
									</flowline>
									<flowline >
										<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='0' />
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='reset ARP request led' cmdcolor='3568629' cmdcolor_sec='3568629' exp='cnt10 &gt; 200' swap='0' >
							<flowline >
								<command class_type='output' title='Reset led' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='2' exp='0' />
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt10 = 0' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt10 = cnt10 + 1' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='reset led ' cmdcolor='3568629' cmdcolor_sec='3568629' exp='cnt7 &gt; 200' swap='0' >
							<flowline >
								<command class_type='output' title='Reset led' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048579' mask='1' exp='0' />
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt7 = 0' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt7 = cnt7 + 1' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='reset led ' cmdcolor='3568629' cmdcolor_sec='3568629' exp='cnt9 &gt; 200' swap='0' >
							<flowline >
								<command class_type='output' title='Reset led' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='4' exp='0' />
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt9 = 0' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='cnt9 = cnt9 + 1' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Count_borehole_water' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='reset borehole counter' cmdcolor='3568629' cmdcolor_sec='3568629' exp='out[5] = &apos;1&apos;' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='waterstring[0] = ReceiveData[5]' />
									<exp exp='waterstring[1] = ReceiveData[6]' />
									<exp exp='waterstring[2] = ReceiveData[7]' />
									<exp exp='waterstring[3] = ReceiveData[8]' />
									<exp exp='waterstring[4] = ReceiveData[9]' />
									<exp exp='waterstring[5] = ReceiveData[10]' />
									<exp exp='waterstring[6] = ReceiveData[11]' />
									<exp exp='waterstring[7] = ReceiveData[12]' />
									<exp exp='water = StringToInt$ (waterstring)' />
									<exp exp='out[5] = &apos;0&apos;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='input' title='input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048579' mask='4' exp='in1' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='in1 = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='flag1 = 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='flag1 = 1' />
											<exp exp='water = water + 1' />
											<exp exp='' />
											<exp exp='' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='flag1 = 0' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='inputs' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='input' title='input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048578' mask='64' exp='in3' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='in3 = 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='in[3] = &apos;0&apos;' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='in[3] = &apos;1&apos;' />
								</command>
							</flowline>
						</command>
						<command class_type='input' title='inputput' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048577' mask='16' exp='in4' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='in4 = 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='in[4] = &apos;0&apos;' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='in[4] = &apos;1&apos;' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Analise_home_Water' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='waterstring1 = ToString$ (water1)' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 10' swap='1' >
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 100' swap='1' >
									<flowline >
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 1000' swap='1' >
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 10000' swap='1' >
													<flowline >
														<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 100000' swap='1' >
															<flowline >
																<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 1000000' swap='1' >
																	<flowline >
																		<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='water1 &lt; 10000000' swap='1' >
																			<flowline />
																			<flowline >
																				<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																					<exp exp='waterstring1[7] = &apos;f&apos;' />
																				</command>
																			</flowline>
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																			<exp exp='waterstring1[6] = &apos;f&apos;' />
																			<exp exp='waterstring1[7] = &apos;f&apos;' />
																		</command>
																	</flowline>
																</command>
															</flowline>
															<flowline >
																<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='waterstring1[5] = &apos;f&apos;' />
																	<exp exp='waterstring1[6] = &apos;f&apos;' />
																	<exp exp='waterstring1[7] = &apos;f&apos;' />
																</command>
															</flowline>
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='waterstring1[4] = &apos;f&apos;' />
															<exp exp='waterstring1[5] = &apos;f&apos;' />
															<exp exp='waterstring1[6] = &apos;f&apos;' />
															<exp exp='waterstring1[7] = &apos;f&apos;' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='waterstring1[3] = &apos;f&apos;' />
													<exp exp='waterstring1[4] = &apos;f&apos;' />
													<exp exp='waterstring1[5] = &apos;f&apos;' />
													<exp exp='waterstring1[6] = &apos;f&apos;' />
													<exp exp='waterstring1[7] = &apos;f&apos;' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='waterstring1[2] = &apos;f&apos;' />
											<exp exp='waterstring1[3] = &apos;f&apos;' />
											<exp exp='waterstring1[4] = &apos;f&apos;' />
											<exp exp='waterstring1[5] = &apos;f&apos;' />
											<exp exp='waterstring1[6] = &apos;f&apos;' />
											<exp exp='waterstring1[7] = &apos;f&apos;' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='waterstring1[1] = &apos;f&apos;' />
									<exp exp='waterstring1[2] = &apos;f&apos;' />
									<exp exp='waterstring1[3] = &apos;f&apos;' />
									<exp exp='waterstring1[4] = &apos;f&apos;' />
									<exp exp='waterstring1[5] = &apos;f&apos;' />
									<exp exp='waterstring1[6] = &apos;f&apos;' />
									<exp exp='waterstring1[7] = &apos;f&apos;' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='watchdog' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='reset ' cmdcolor='3568629' cmdcolor_sec='3568629' exp='watchdog_timer &gt; 15000' swap='0' >
							<flowline >
								<command class_type='calculation' title='reset watchdog timer' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='watchdog_timer = 0' />
								</command>
								<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='1' exp='1' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='1' type='2' />
								<command class_type='native' title='C Code' ccode='WDTCON |= 0x01;
' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Increment Interrupt Count' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='watchdog_timer = watchdog_timer + 1' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='initialise variables' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='cnt7 = 0' />
							<exp exp='cnt8 = 0' />
							<exp exp='out[1] = 0' />
							<exp exp='in1 = 1' />
							<exp exp='in2 = 1' />
							<exp exp='in3 = 1' />
							<exp exp='in4 = 1' />
							<exp exp='watchdog_timer = 0' />
							<exp exp='water = 0' />
							<exp exp='water1 = 0' />
							<exp exp='cnt9 = 0' />
							<exp exp='cnt10 = 0' />
							<exp exp='flag2 = 0' />
							<exp exp='flag1 = 0' />
							<exp exp='cnt11 = 0' />
							<exp exp='cnt12 = 0' />
							<exp exp='cnt13 = 0' />
							<exp exp='nimbus = 0' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='Initialise' />
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='200' type='1' />
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='checking for incoming data' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='PacketReceive' >
									<return exp='DataLength' />
								</command>
								<command class_type='decision' title='data available?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='DataLength &gt; 0' swap='0' >
									<flowline >
										<command class_type='call' title='check for ARP request' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='CheckForARP' >
											<return exp='RetVal' />
											<argument exp='DataLength' />
										</command>
										<command class_type='decision' title='verification' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal' swap='0' >
											<flowline >
												<command class_type='call' title='ARP Reply' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeArpAnswerFromRequest' />
												<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='2' exp='1' />
												<command class_type='goto' title='Goto Connection Point' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
										<command class_type='call' title='check for ip request' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='CheckForIp' >
											<return exp='RetVal' />
											<argument exp='DataLength' />
										</command>
										<command class_type='decision' title='is it our IP' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal' swap='0' >
											<flowline >
												<command class_type='call' title='Check for ping' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='CheckForPing' >
													<return exp='RetVal' />
												</command>
												<command class_type='decision' title='Verification' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal' swap='0' >
													<flowline >
														<command class_type='call' title='Send ping response' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeEchoReplyFromRequest' >
															<argument exp='DataLength' />
														</command>
														<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048578' mask='4' exp='1' />
														<command class_type='goto' title='Done' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='' />
													</flowline>
													<flowline />
												</command>
												<command class_type='call' title='Check the request is destined for our server port' ccode='// Call Component Macro
FCV_RETVAL = FCD_0f5c1_TCPIP_ENC28J60__CheckForTCPPort(255);
' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='CheckForTCPPort' >
													<return exp='RetVal' />
													<argument exp='FCM_ServerPort' />
												</command>
												<command class_type='decision' title='SVR Port  ?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Retval' swap='0' >
													<flowline >
														<command class_type='call' title='Check for the TCP type of request' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='CheckForTCPType' >
															<return exp='RetVal' />
														</command>
														<command class_type='decision' title='Synchronise?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal &amp; 0x02' swap='0' >
															<flowline >
																<command class_type='call' title='Service Acknowledge' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeTcpSynackFromSyn' >
																	<argument exp='FCM_ServerPort' />
																</command>
																<command class_type='goto' title='Goto Connection Point' ccode='// Goto Connection Point
goto FCC__A;
' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='' />
															</flowline>
															<flowline />
														</command>
														<command class_type='decision' title='Ack?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal &amp; 0x10' swap='0' >
															<flowline >
																<command class_type='call' title='Check incoming data length after headers' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='InitialiseDataLengthInfo' />
																<command class_type='call' title='Get Current Data Pointer' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='GetTcpDataPointer' >
																	<return exp='DataPointer' />
																</command>
																<command class_type='decision' title='If there is no inbound data' cmdcolor='3568629' cmdcolor_sec='3568629' exp='DataPointer = 0' swap='0' >
																	<flowline >
																		<command class_type='decision' title='Ack with no data' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RetVal &amp; 0x01' swap='0' >
																			<flowline >
																				<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeTcpAckFromAny' >
																					<argument exp='FCM_ServerPort' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																		<command class_type='goto' title='Goto Connection Point' ccode='// Goto Connection Point
goto FCC__A;
' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='' />
																	</flowline>
																	<flowline />
																</command>
																<command class_type='call' title='read incomming data packet' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='ReadStringFromBuffer' >
																	<return exp='ReceiveData' />
																	<argument exp='DataPointer' />
																	<argument exp='20' />
																</command>
																<command class_type='calculation' title='Here are your 4 Bytes.' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='out[1] = ReceiveData[0]' />
																	<exp exp='out[2] = ReceiveData[1]' />
																	<exp exp='out[3] = ReceiveData[2]' />
																	<exp exp='out[5] = ReceiveData[3]' />
																	<exp exp='out[6] = ReceiveData[4]' />
																</command>
																<command class_type='calculation' title='simple set the dataTx  send 18 bytes' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='dataTx[0] = in[3]' />
																	<exp exp='dataTx[1] = in[4]' />
																	<exp exp='dataTx[2] = waterstring1[0]' />
																	<exp exp='dataTx[3] = waterstring1[1]' />
																	<exp exp='dataTx[4] = waterstring1[2]' />
																	<exp exp='dataTx[5] = waterstring1[3]' />
																	<exp exp='dataTx[6] = waterstring1[4]' />
																	<exp exp='dataTx[7] = waterstring1[5]' />
																	<exp exp='dataTx[8] = waterstring1[6]' />
																	<exp exp='dataTx[9] = waterstring1[7]' />
																	<exp exp='dataTx[10] = waterstring[0]' />
																	<exp exp='dataTx[11] = waterstring[1]' />
																	<exp exp='dataTx[12] = waterstring[2]' />
																	<exp exp='dataTx[13] = waterstring[3]' />
																	<exp exp='dataTx[14] = waterstring[4]' />
																	<exp exp='dataTx[15] = waterstring[5]' />
																	<exp exp='dataTx[16] = waterstring[6]' />
																	<exp exp='dataTx[17] = waterstring[7]' />
																	<exp exp='dataTx[18] = in[12]' />
																</command>
																<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='FillTcpData' >
																	<return exp='DataLength' />
																	<argument exp='0' />
																	<argument exp='dataTx' />
																</command>
																<command class_type='call' title='Assemble TCP Ack Header' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeTcpAckFromAny' >
																	<argument exp='FCM_ServerPort' />
																</command>
																<command class_type='call' title='Add data to the buffer' cmdcolor='1975743' cmdcolor_sec='1975743' component='TCPIP_ENC28J60' macro='MakeTcpAckWithData' >
																	<argument exp='DataLength' />
																</command>
																<command class_type='output' title='outputput' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048579' mask='1' exp='1' />
																<command class_type='goto' title='Goto Connection Point' ccode='// Goto Connection Point
goto FCC__A;
' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='' />
															</flowline>
															<flowline />
														</command>
														<command class_type='label' title='Done' cmdcolor='3389439' cmdcolor_sec='3389439' labelid='0' labelname='RxDone' />
														<command class_type='calculation' title='reset watchdog timer' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='watchdog_timer = 0' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='execute' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='8aab4b54-a912-449c-b11a-7c1a5db8d591' vmin='0' vmaj='1' codename='TCPIP_ENC28J60' x='-290.502' y='19.92' z='1.11022e-16' xsz='159.995' ysz='145.16' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Port' data='80' />
					<value target='BufferSize' data='255' />
					<value target='CHANNEL' data='001' />
					<value target='PR_SCALE' data='004' />
					<value target='ResetPin' data='$PORTB.2' />
					<value target='cs_pin' data='$PORTB.3' />
					<value target='MOSI' data='$PORTC.7' />
					<value target='MISO' data='$PORTB.0' />
					<value target='CLK' data='$PORTB.1' />
					<value target='MosiRemap' data='013' />
					<value target='MisoRemap' data='065' />
					<value target='ClkRemap' data='009' />
					<value target='MAC0' data='200' />
					<value target='MAC1' data='101' />
					<value target='MAC2' data='102' />
					<value target='MAC3' data='103' />
					<value target='MAC4' data='104' />
					<value target='MAC5' data='105' />
					<value target='IP0' data='10' />
					<value target='IP1' data='0' />
					<value target='IP2' data='0' />
					<value target='IP3' data='30' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='-267.162' ye='-38.149' ze='1144.92' xt='-267.162' yt='-38.149' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<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---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='watchdog' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='execute' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='outputs' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Count_Farm_Water' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Analise_home_Water' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Nimbus_Delay' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='inputs' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Count_borehole_water' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Analise_Borehole_Water' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKQUAAEUCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
