<root>
<document schema='101' license='50,Dev User,XDKHX7' title='' description='' target='SIMULATION.SIM.SIM' >
	<config data='' clkspd='100000000' 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='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='edcaa3f4-ec61-4cd6-9ac4-b5874f9f27db' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='Number Helper' description='Component to simplify converting between decimal, hex and binary' category='Misc' catenable='1' author='Ben Rowland' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='NumberHelper' 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='0' poslock='0' >
			<resources />
			<properties >
				<property name='Decimal' target='Decimal' typeid='21' hidden='0' locked='0' info='' />
				<property name='Hexadecimal' target='Hexadecimal' typeid='10' hidden='0' locked='0' info='' />
				<property name='Binary' target='Binary' typeid='10' hidden='0' locked='0' info='' />
			</properties>
			<values >
				<value target='Decimal' data='511' />
				<value target='Hexadecimal' data='0x1FF' />
				<value target='Binary' data='0b0000000111111111' />
			</values>
			<events >
				<event class='Components' event='Property' target='Ev_Property' />
			</events>
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Bin' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</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='Hex' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Dec' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</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='BinaryStringToNumber' description='' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='BinStr' type='T8*' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='idx' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Value' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Value = 0x8000' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.idx = 2' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.Value &gt; 0' >
							<flowline >
								<command class_type='decision' title='Decision' exp='.BinStr[.idx] = &apos;1&apos;' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = .Return + .Value' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Value = .Value &gt;&gt; 1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.idx = .idx + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GenerateBinString' description='' >
						<return name='Return' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</return>
						<param name='Value' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='idx' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = &quot;0b&quot;' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.idx &lt; 16' >
							<flowline >
								<command class_type='decision' title='Decision' exp='.Value &amp; (0x8000 &gt;&gt; .idx)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = .Return + &quot;1&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = .Return + &quot;0&quot;' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.idx = .idx + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='HexStrToNumber' description='' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='HexStr' type='T8*' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='len' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='idx' type='u8' description='' isconst='0' isinit='1' usrinit='2' setinit='2' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.len = Length$ (.HexStr)' />
						</command>
						<command class_type='loop' title='Loop' type='0' exp='.idx &lt; .len' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.Return = .Return * 16' />
								</command>
								<command class_type='decision' title='Decision' exp='.HexStr[.idx] &gt;= &apos;0&apos; &amp;&amp; .HexStr[.idx] &lt;= &apos;9&apos;' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='.Return = .Return + (.HexStr[.Idx] - &apos;0&apos;)' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Decision' exp='.HexStr[.idx] &gt;= &apos;A&apos; &amp;&amp; .HexStr[.idx] &lt;= &apos;F&apos;' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' >
													<exp exp='.Return = .Return + (.HexStr[.Idx] - &apos;A&apos; + 10)' />
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='Decision' exp='.HexStr[.idx] &gt;= &apos;a&apos; &amp;&amp; .HexStr[.idx] &lt;= &apos;f&apos;' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' >
															<exp exp='.Return = .Return + (.HexStr[.Idx] - &apos;a&apos; + 10)' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.idx = .idx + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Sent when a property has been changed by the User' >
						<return name='Return' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempStr' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='HexConv' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='BinConv' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Decision' exp='Dec != Decimal' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.TempStr = NumberToHex$ (Decimal)' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.TempStr = ToUpper$ (.TempStr)' />
								</command>
								<command class_type='calculation' title='Lowercase for this X' >
									<exp exp='.TempStr[1] = &apos;x&apos;' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Hexadecimal&quot;' />
									<argument exp='.TempStr' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Dec = Decimal' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Hex = Dec' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Bin = Dec' />
								</command>
								<command class_type='call' title='Call Macro' macro='GenerateBinString' >
									<return exp='.TempStr' />
									<argument exp='Dec' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Binary&quot;' />
									<argument exp='.TempStr' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='HexStrToNumber' >
							<return exp='.HexConv' />
							<argument exp='Hexadecimal' />
						</command>
						<command class_type='decision' title='Decision' exp='.HexConv != Hex' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Decimal&quot;' />
									<argument exp='.HexConv' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Hex = .HexConv' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Dec = .HexConv' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Bin = .HexConv' />
								</command>
								<command class_type='call' title='Call Macro' macro='GenerateBinString' >
									<return exp='.TempStr' />
									<argument exp='Dec' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Binary&quot;' />
									<argument exp='.TempStr' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Call Macro' macro='BinaryStringToNumber' >
							<return exp='.BinConv' />
							<argument exp='Binary' />
						</command>
						<command class_type='decision' title='Decision' exp='.BinConv != Bin' swap='0' >
							<flowline >
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Decimal&quot;' />
									<argument exp='.BinConv' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.TempStr = NumberToHex$ (Decimal)' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.TempStr = ToUpper$ (.TempStr)' />
								</command>
								<command class_type='calculation' title='Lowercase for this X' >
									<exp exp='.TempStr[1] = &apos;x&apos;' />
								</command>
								<command class_type='sim' title='Simulation' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;Hexadecimal&quot;' />
									<argument exp='.TempStr' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Hex = .BinConv' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='Dec = .BinConv' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' />
				</macro>
			</macros>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='5724159' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAAAUAAJEDAAA' zoom='75' scrollx='0' scrolly='1289' flags='0' />
		<view type='0' name='BinaryStringToNumber' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAAAUAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GenerateBinString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAAAUAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='HexStrToNumber' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAAAUAAJEDAAA' zoom='75' scrollx='24' scrolly='140' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAAAUAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
