<root>
<document scada='0' schema='103' license='10,CompMaker,WNV3JN' title='' description='' fcversion='655616' target='ESP.ESP32.ESP32_WROOM_32' >
	<config data='' clkspd='240000000' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='.h' />
		<watch expr='.t' />
		<watch expr='.x' />
	</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='1' />
			<data name='CalculatedCommsDelay' value='1' />
			<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='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='2755f2ee-60e0-4e4d-9bce-8bffb3a6a730' vstate='40' vmin='0' vmaj='1' srcleaf='Humidity_AHT10.fcfx' visiblename='Humidity AHT10' description='A high precision I2C based temperature and humidity sensor.' category='Environmental' category2='API Environmental' category3='' bIs2dOnly='1' bIs3dOnly='0' catenable='1' author='Matrix TSL' manuname='' manucode='' sysinfo='4875' keywords='' dynamic='1' scadaCompatible='1' embeddedCompatible='1' showmacros='1' iconpath='..\..\Icons\Components\Humidity.png' />
		<component class_type='root' codename='Humidity_AHT10' panelId='-1' 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='I2C Options' hidden='0' >
					<property name='Channel' target='cal_i2c1::CHANNEL' typeid='16' hidden='0' locked='0' info='Channel selection' filter='000Software
001Channel 1
002Channel 2
' />
					<property name='SDA' target='cal_i2c1::SDA' typeid='5' hidden='0' locked='1' info='Pin used for SDA (data signal)' />
					<property name='SDA Remap Pin' target='cal_i2c1::SDAPins' typeid='16' hidden='0' locked='0' info='' filter='036$PORTB.4
039$PORTB.7
034$PORTB.2
035$PORTB.3
032$PORTB.0
033$PORTB.1
025$PORTA.25
026$PORTA.26
027$PORTA.27
014$PORTA.14
012$PORTA.12
013$PORTA.13
015$PORTA.15
002$PORTA.2
000$PORTA.0
004$PORTA.4
016$PORTA.16
017$PORTA.17
005$PORTA.5
018$PORTA.18
019$PORTA.19
021$PORTA.21
003$PORTA.3
001$PORTA.1
022$PORTA.22
023$PORTA.23' />
					<property name='SCL' target='cal_i2c1::SCL' typeid='5' hidden='0' locked='1' info='Pin used for SCL (clock signal)' />
					<property name='SCL Remap Pin' target='cal_i2c1::SCLPins' typeid='16' hidden='0' locked='0' info='' filter='036$PORTB.4
039$PORTB.7
034$PORTB.2
035$PORTB.3
032$PORTB.0
033$PORTB.1
025$PORTA.25
026$PORTA.26
027$PORTA.27
014$PORTA.14
012$PORTA.12
013$PORTA.13
015$PORTA.15
002$PORTA.2
000$PORTA.0
004$PORTA.4
016$PORTA.16
017$PORTA.17
005$PORTA.5
018$PORTA.18
019$PORTA.19
021$PORTA.21
003$PORTA.3
001$PORTA.1
022$PORTA.22
023$PORTA.23' />
					<property name='Stop Delay' target='cal_i2c1::StopDel' typeid='7' hidden='0' locked='0' info='On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not 
a 10ms delay between an I2C stop event and the next I2C start event.

Most modern microcontrollers will not have a problem so this property can be disabled to speed up the 
I2C communications. ' />
					<property name='Baud Select' target='cal_i2c1::BAUD_LIST' typeid='16' hidden='0' locked='0' info='Baud rate option selector' filter='000Custom
001100KHz
002400KHz
0031MHz' />
					<property name='Baud Rate' target='cal_i2c1::BAUD' typeid='14' hidden='0' locked='1' info='Baud rate to be used' />
				</property>
				<property name='Simulation' folder='cal_i2c1::property_1' hidden='0' >
					<property name='Scope Traces' target='cal_i2c1::ScopeTraces' typeid='7' hidden='0' locked='0' info='Selects if the component pin connections are automatically generated on the data recorder window or not.
Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion.
No: Do not show the pin signals on the data recorder window.' />
					<property name='Console Data' target='cal_i2c1::ConsoleData' typeid='7' hidden='0' locked='0' info='Selects if the console data is automatically generated or not' />
					<property name='API' target='cal_i2c1::Injector' typeid='16' hidden='0' locked='0' info='Specifies the API component on the panel to interact with to provide comms simulation.' filter='000 
' />
					<property name='Injector Handle' target='cal_i2c1::InjectorHandle' typeid='21' hidden='1' locked='0' info='' />
					<property name='Injector Channel' target='cal_i2c1::InjectorChannel' typeid='21' hidden='1' locked='0' info='' />
					<property name='Loading' target='cal_i2c1::Loading' typeid='7' hidden='1' locked='0' info='' />
				</property>
			</properties>
			<values >
				<value target='cal_i2c1::CHANNEL' data='001' />
				<value target='cal_i2c1::SDA' data='$PORTA.0' />
				<value target='cal_i2c1::SDAPins' data='000' />
				<value target='cal_i2c1::SCL' data='$PORTA.1' />
				<value target='cal_i2c1::SCLPins' data='001' />
				<value target='cal_i2c1::StopDel' data='0' />
				<value target='cal_i2c1::BAUD_LIST' data='001' />
				<value target='cal_i2c1::BAUD' data='100000' />
				<value target='cal_i2c1::ScopeTraces' data='0' />
				<value target='cal_i2c1::ConsoleData' data='0' />
				<value target='cal_i2c1::Injector' data='001' />
				<value target='cal_i2c1::InjectorHandle' data='10361' />
				<value target='cal_i2c1::InjectorChannel' data='0' />
				<value target='cal_i2c1::Loading' data='0' />
			</values>
			<events >
				<event class='Compile' event='AddVar' target='Ev_AddVar' />
			</events>
			<apis >
				<api name='ReadHumidity' alt='ReadHumiditySim' type='1' proto='1' />
				<api name='ReadTemperature' alt='ReadTemperatureSim' type='1' proto='1' />
				<api name='Sample' alt='SampleSim' type='1' proto='1' />
				<api name='Initialise' alt='InitialiseSim' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='AHT10_CMD_TRIGGER' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='172' setinit='0xAC' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='InitialiseSample' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AHT10_STATUS_CALIBRATED' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='8' setinit='0x08' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AHT10_STATUS_BUSY' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='128' setinit='0x80' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AHT10_CMD_CALIBRATE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='225' setinit='0xE1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temperature' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='humidity' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AHT10_CMD_SOFTRESET' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='186' setinit='0xBA' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='ReadHumidity' description='Gets the humidity reading from the last sample.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = humidity' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='InitialiseSim' description='Startup I2C bus and initialise the sensor.
Returns 1 if the device is replying to commands.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='InitialiseSample = InitialiseSample | 2' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadTemperature' description='Gets the temperature reading from the last sample.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Temperature' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = temperature' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadTemperatureSim' description='Gets the temperature reading from the last sample.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Temperature' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Initialise' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Sample' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Temperature = 0' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='InitialiseSample = 3' swap='0' >
							<flowline >
								<command class_type='sim' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='SensorLibraryComponent1' macro='GetValue' >
									<return exp='.Temperature' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = .Temperature' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Sample' description='Reads the sensor and collects the latest termperature and humidity readings.
Returns 1 for a successful sample.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='rx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='6' />
						</local>
						<local name='tx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='3' />
						</local>
						<local name='check' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='data' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.tx[0] = AHT10_CMD_TRIGGER' />
							<exp exp='.tx[1] = 0x33' />
							<exp exp='.tx[2] = 0' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Write' >
							<return exp='.check' />
							<argument exp='.tx' />
							<argument exp='3' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.check != 3' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='GetStatus() &amp; AHT10_STATUS_BUSY' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='10' type='1' />
							</flowline>
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Read' >
							<return exp='.check' />
							<argument exp='.rx' />
							<argument exp='6' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.check != 6' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.data = .rx[1]' />
							<exp exp='.data = .data &lt;&lt; 8' />
							<exp exp='.data = .data | .rx[2]' />
							<exp exp='.data = .data &lt;&lt; 4' />
							<exp exp='.data = .data | (.rx[3] &gt;&gt; 4)' />
							<exp exp='humidity = (FLOAT .data * 100.0) / 1048576.0' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.data = .rx[3] &amp; 0x0F' />
							<exp exp='.data = .data &lt;&lt; 8' />
							<exp exp='.data = .data | .rx[4]' />
							<exp exp='.data = .data &lt;&lt; 8' />
							<exp exp='.data = .data | .rx[5]' />
							<exp exp='temperature = ((FLOAT .data * 200.0) / 1048576.0) - 50.0' />
						</command>
						<command class_type='calculation' title='Sample OK' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = 1' />
						</command>
						<command class_type='label' title='Declare Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='A' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_AddVar' description='Sent to a component to allow dynamic amendment of global constant declarations' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to include definition - initialised on call' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='VarName' type='T8' description='The original Flowcode variable' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='ExpandName' type='T8' description='The expanded variable name' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='Expansion' type='T8*' description='The expanded string to inline to the code' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='Compare$(.VarName,&quot;InitialiseSample&quot;,0) == 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadHumiditySim' description='Gets the humidity reading from the last sample.' statediag='0' >
						<return name='Return' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Humidity' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='Initilise' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Sample' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Humidity = 0' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='InitialiseSample = 3' swap='0' >
							<flowline >
								<command class_type='sim' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='SensorLibraryComponent1' macro='GetValue' >
									<return exp='.Humidity' />
									<argument exp='1' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = .Humidity' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GetStatus' description='Gets the status of the AHT10 sensor' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='rx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2' />
						</local>
						<local name='check' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Read' >
							<return exp='.check' />
							<argument exp='.rx' />
							<argument exp='1' />
						</command>
						<command class_type='decision' title='Decision' disable='1' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.check = 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = .rx[0]' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0xFF' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = .rx[0]' />
						</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='t' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='h' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='x' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='InitialiseSim' />
						<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SampleSim' />
						<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Initialise' >
							<return exp='.x' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='1' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='100' type='1' />
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Sample' />
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='ReadHumidity' >
									<return exp='.h' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='ReadTemperature' >
									<return exp='.t' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SampleSim' description='Reads the sensor and collects the latest termperature and humidity readings.
Returns 1 for a successful sample.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='InitialiseSample = InitialiseSample | 1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='Startup I2C bus and initialise the sensor.
Returns 1 if the device is replying to commands.' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='tx' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='3' />
						</local>
						<local name='check' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='20' type='1' />
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Initialise' >
							<argument exp='0x38' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.tx[0] = AHT10_CMD_SOFTRESET' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Write' >
							<return exp='.check' />
							<argument exp='.tx' />
							<argument exp='1' />
						</command>
						<command class_type='decision' title='check for ACK from device' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.check != 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='20' type='1' />
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.tx[0] = AHT10_CMD_CALIBRATE' />
							<exp exp='.tx[1] = 0x08' />
							<exp exp='.tx[2] = 0x00' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='cal_i2c1' macro='Transaction_Write' >
							<return exp='.check' />
							<argument exp='.tx' />
							<argument exp='3' />
						</command>
						<command class_type='decision' title='check for ACK from device' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.check != 3' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='0' exp='GetStatus() &amp; AHT10_STATUS_BUSY' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='10' type='1' />
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='!(GetStatus() &amp; AHT10_STATUS_CALIBRATED)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
									<exp exp='.Return = 0' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
							<exp exp='.Return = 1' />
						</command>
						<command class_type='label' title='Declare Connection Point' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' labelid='0' labelname='A' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='960e433c-1295-4aeb-ac84-04d75422119e' vmin='0' vmaj='1' codename='SensorLibraryComponent1' panelId='0' x='77.2774' y='-156.5' z='0' xsz='101.022' ysz='101.341' 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='2' poslock='1' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Text::sText' data='Humidity AHT10' />
					<value target='Name' data='Humidity_AHT10' />
					<value target='Peripheral::sText' data='(I2C CH1)' />
					<value target='ShowComms' data='0' />
					<value target='InputIcon::CommsType' data='255' />
					<value target='OutputIcon::CommsType' data='255' />
					<value target='OutputIcon::LinkTo' data='0' />
					<value target='ConsoleHandle' data='0' />
					<value target='NumDP' data='0' />
					<value target='ValueCount' data='002' />
					<value target='Label0::sText' data='Temperature' />
					<value target='Max0' data='100' />
					<value target='Min0' data='-40' />
					<value target='MajTick0' data='10' />
					<value target='MinTick0' data='2.000000' />
					<value target='Label1::sText' data='Humidity' />
					<value target='Max1' data='100.000000' />
					<value target='Min1' data='0.000000' />
					<value target='MajTick1' data='10' />
					<value target='MinTick1' data='2.000000' />
					<value target='Label2::sText' data='Val 2' />
					<value target='Max2' data='100.000000' />
					<value target='Min2' data='0.000000' />
					<value target='MajTick2' data='10' />
					<value target='MinTick2' data='2.000000' />
					<value target='Label3::sText' data='Val 3' />
					<value target='Max3' data='100.000000' />
					<value target='Min3' data='0.000000' />
					<value target='MajTick3' data='10' />
					<value target='MinTick3' data='2.000000' />
					<value target='Label4::sText' data='Val 4' />
					<value target='Max4' data='100.000000' />
					<value target='Min4' data='0.000000' />
					<value target='MajTick4' data='10' />
					<value target='MinTick4' data='2.000000' />
					<value target='Label5::sText' data='Val 5' />
					<value target='Max5' data='100.000000' />
					<value target='Min5' data='0.000000' />
					<value target='MajTick5' data='10' />
					<value target='MinTick5' data='2.000000' />
					<value target='Label6::sText' data='Val 6' />
					<value target='Max6' data='100.000000' />
					<value target='Min6' data='0.000000' />
					<value target='MajTick6' data='10' />
					<value target='MinTick6' data='2.000000' />
					<value target='Label7::sText' data='Val 7' />
					<value target='Max7' data='100.000000' />
					<value target='Min7' data='0.000000' />
					<value target='MajTick7' data='10' />
					<value target='MinTick7' data='2.000000' />
					<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='ed3a5141-43bb-43e0-86b0-2243fd1147ca' vmin='0' vmaj='2' codename='cal_i2c1' panelId='0' x='111.99' y='-50.5' z='1' xsz='5.07951' ysz='5.13393' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='0' scadavisible='1' interactive='0' solid='0' layer='2' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='001' />
					<value target='Mode' data='000' />
					<value target='SDA' data='$PORTA.0' />
					<value target='SDAPins' data='000' />
					<value target='SCL' data='$PORTA.1' />
					<value target='SCLPins' data='001' />
					<value target='StopDel' data='0' />
					<value target='BAUD_LIST' data='001' />
					<value target='BAUD' data='100000' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='ClockStretching' data='1' />
					<value target='BMODE' data='0' />
					<value target='SDA_PORT' data='$PORTA.0' />
					<value target='SDA_TRIS' data='$PORTA.0' />
					<value target='SDA_PIN' data='0' />
					<value target='SCL_PORT' data='$PORTA.1' />
					<value target='SCL_TRIS' data='$PORTA.1' />
					<value target='SCL_PIN' data='1' />
					<value target='MASTER' data='0' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='Injector' data='001' />
					<value target='InjectorHandle' data='10361' />
					<value target='InjectorChannel' data='0' />
					<value target='Loading' data='0' />
					<value target='REMAPPABLE' data='1' />
					<value target='SDABank' data='' />
					<value target='SDABank2' data='' />
					<value target='SCLBank' data='' />
					<value target='SCLBank2' data='' />
					<value target='SDARPNUM' data='1' />
					<value target='SCLRPNUM' data='' />
					<value target='SDARPREG' data='I2C1' />
					<value target='SCLRPREG' data='I2C2' />
					<value target='SDAREG' data='000' />
					<value target='SCLREG' data='001' />
					<value target='Sim' data='1' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='10' />
					<value target='SDAAlts' data='000' />
					<value target='SCLAlts' data='000' />
					<value target='SDAAlt' data='0' />
					<value target='SCLAlt' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='1170.37' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='424' dy='821' zoom='43.8356' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='606,0,1419,748' RectRecentDocked='0,0,424,844' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</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' />
		<winpos ID='7004' RectRecentFloat='0,425,654,1002' RectRecentDocked='0,0,210,943' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='2D Panel' >
			<winpos ID='1171' RectRecentFloat='1456,251,1984,644' RectRecentDocked='1250,141,1674,985' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376149408988' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetStatus' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Sample' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadTemperature' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadHumidity' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadTemperatureSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadHumiditySim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SampleSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='InitialiseSim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_AddVar' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATAMAAEcDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
