<root>
<file schema='103' />
<macros >
<macro >
<flowline name='DS18B20_Temp_Serial' description='' statediag='0' >
<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
<local name='length' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
<local name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
<local name='CharValue' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
<local name='Index' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
<local name='Digit' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
<local name='length_High' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
<array size='20' />
</local>
<command class_type='calculation' title='Initilise the .Return value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_High = 0' />
<exp exp='.Index = 0' />
</command>
<command class_type='call' title='Get Next DS18B20 Device' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='DS18B20' macro='AddressNextDevice' />
<command class_type='call' title='Perform temperature conversion - wait for completion' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='DS18B20' macro='SampleAddressedDevice' >
<argument exp='1' />
</command>
<command class_type='call' title='Collect Temperature' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='DS18B20' macro='GetTemperature' >
<return exp='DS18B20_Temp' />
</command>
<command class_type='call' title='Collect Temperature' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' component='DS18B20' macro='GetSerialString' >
<return exp='DS18B20_Serial_STR' />
</command>
<command class_type='calculation' title='Extract upper bits of the serial number' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_High_STR = Left$(DS18B20_Serial_STR,4)' />
</command>
<command class_type='calculation' title='Get the total number of hex characters to process' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.length = Length$(DS18B20_Serial_High_STR)' />
</command>
<command class_type='loop' title='Loop through each character in the hex string' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='.length' >
<flowline >
<command class_type='calculation' title='Get ASCII value of current character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.CharValue = Char$(DS18B20_Serial_High_STR,.Index)' />
</command>
<command class_type='decision' title='Check if character is &apos;0&apos; to &apos;9&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x30 &amp;&amp; .CharValue &lt;= 0x39' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;0&apos;-&apos;9&apos; to numeric 0-9' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x30' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;A&apos; to &apos;F&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x41 &amp;&amp; .CharValue &lt;= 0x46' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;A&apos;-&apos;F&apos; to numeric 10-15' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x37' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;a&apos; to &apos;f&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x61 &amp;&amp; .CharValue &lt;= 0x66' swap='0' >
<flowline >
<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x57' />
</command>
</flowline>
<flowline >
<command class_type='calculation' title='invalid character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = 0' />
</command>
</flowline>
</command>
</flowline>
</command>
</flowline>
</command>
<command class_type='calculation' title=' build the number from left to right' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_High = (DS18B20_Serial_High * 0x10) + .Digit' />
<exp exp='//Shift previous result left by 4 bits (0x10,×16) and add new digit' />
</command>
<command class_type='calculation' title='Increment index value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Index = .Index + 1' />
</command>
</flowline>
</command>
<command class_type='calculation' title='Initilise the .Return value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Mid = 0' />
<exp exp='.Index = 0' />
</command>
<command class_type='calculation' title='Extract lower bits of the serial number' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Mid_STR = Mid$(DS18B20_Serial_STR,4,4)' />
</command>
<command class_type='calculation' title='Get the total number of hex characters to process' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.length = Length$(DS18B20_Serial_Mid_STR)' />
</command>
<command class_type='loop' title='Loop through each character in the hex string' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='.length' >
<flowline >
<command class_type='calculation' title='Get ASCII value of current character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.CharValue = Char$(DS18B20_Serial_Mid_STR,.Index)' />
</command>
<command class_type='decision' title='Check if character is &apos;0&apos; to &apos;9&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x30 &amp;&amp; .CharValue &lt;= 0x39' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;0&apos;-&apos;9&apos; to numeric 0-9' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x30' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;A&apos; to &apos;F&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x41 &amp;&amp; .CharValue &lt;= 0x46' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;A&apos;-&apos;F&apos; to numeric 10-15' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x37' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;a&apos; to &apos;f&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x61 &amp;&amp; .CharValue &lt;= 0x66' swap='0' >
<flowline >
<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x57' />
</command>
</flowline>
<flowline >
<command class_type='calculation' title='invalid character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = 0' />
</command>
</flowline>
</command>
</flowline>
</command>
</flowline>
</command>
<command class_type='calculation' title=' build the number from left to right' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Mid = (DS18B20_Serial_Mid * 0x10) + .Digit' />
<exp exp='//Shift previous result left by 4 bits (0x10,×16) and add new digit' />
</command>
<command class_type='calculation' title='Increment index value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Index = .Index + 1' />
</command>
</flowline>
</command>
<command class_type='calculation' title='Initilise the .Return value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Low = 0' />
<exp exp='.Index = 0' />
</command>
<command class_type='calculation' title='Extract lower bits of the serial number' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Low_STR = Right$(DS18B20_Serial_STR,4)' />
</command>
<command class_type='calculation' title='Get the total number of hex characters to process' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.length = Length$(DS18B20_Serial_Low_STR)' />
</command>
<command class_type='loop' title='Loop through each character in the hex string' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' type='2' exp='.length' >
<flowline >
<command class_type='calculation' title='Get ASCII value of current character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.CharValue = Char$(DS18B20_Serial_Low_STR,.Index)' />
</command>
<command class_type='decision' title='Check if character is &apos;0&apos; to &apos;9&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x30 &amp;&amp; .CharValue &lt;= 0x39' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;0&apos;-&apos;9&apos; to numeric 0-9' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x30' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;A&apos; to &apos;F&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x41 &amp;&amp; .CharValue &lt;= 0x46' swap='0' >
<flowline >
<command class_type='calculation' title='Convert ASCII &apos;A&apos;-&apos;F&apos; to numeric 10-15' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x37' />
</command>
</flowline>
<flowline >
<command class_type='decision' title='Check if character is &apos;a&apos; to &apos;f&apos;' cmdcolor='4767473' cmdcolor_sec='11337727' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' exp='.CharValue &gt;= 0x61 &amp;&amp; .CharValue &lt;= 0x66' swap='0' >
<flowline >
<command class_type='calculation' title='Calculation' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = .CharValue - 0x57' />
</command>
</flowline>
<flowline >
<command class_type='calculation' title='invalid character' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Digit = 0' />
</command>
</flowline>
</command>
</flowline>
</command>
</flowline>
</command>
<command class_type='calculation' title=' build the number from left to right' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='DS18B20_Serial_Low = (DS18B20_Serial_low * 0x10) + .Digit' />
<exp exp='//Shift previous result left by 4 bits (0x10,×16) and add new digit' />
</command>
<command class_type='calculation' title='Increment index value' cmdcolor='4206456' cmdcolor_sec='10785756' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' >
<exp exp='.Index = .Index + 1' />
</command>
</flowline>
</command>
</flowline>
</macro>
</macros>
<variables >
<variable public='0' >
<def class_type='variable' name='DS18B20_Serial_High' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
</variable>
<variable public='0' >
<def class_type='variable' name='DS18B20_Serial_Low_STR' 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='DS18B20_Serial_Low' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
</variable>
<variable public='0' >
<def class_type='variable' name='DS18B20_Serial_Mid' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
</variable>
<variable public='0' >
<def class_type='variable' name='DS18B20_Serial_STR' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
<array size='12' />
</def>
</variable>
<variable public='0' >
<def class_type='variable' name='DS18B20_Temp' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
</variable>
<variable public='0' >
<def class_type='variable' name='DS18B20_Serial_Mid_STR' 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='DS18B20_Serial_High_STR' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
<array size='20' />
</def>
</variable>
</variables>
</root>
