<root>
<document schema='101' license='1,Roy Johnston,EDB2BV' title='' description='' target='PIC.18F.18F4550' >
	<config data='!0,e4!8,7e!10,fe!18,f7!20,ff!28,7d!30,9b!38,ff!40,f0!48,3f!50,ff!58,ff!60,ff!68,ff%5,1%3,0%0,4%8,e%e,1%f,0%15,1%10,0%11,3%13,3%18,1%19,b%28,1%29,0%2a,1%2f,0%30,1%32,0%35,0%36,0%37,1%40,0%41,0%42,0%43,0%4f,0%4e,0%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='19660800' 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='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
		</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='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' 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='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='s0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cub_room1_dry' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='int_count1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC3' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC1' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cub_room2_dry' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='intlatch' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='y' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='42' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='x' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='30' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temp3' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cnt0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temp2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temp1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cub_room1_wet' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Reset_Outputs' description='' >
						<command class_type='calculation' title='Calculation' >
							<exp exp='cnt0 = 1' />
						</command>
						<command class_type='loop' title='Loop' type='2' exp='41' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='y[cnt0] = 0' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='cnt0 = cnt0 + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='cnt0 = 1' />
						</command>
						<command class_type='loop' title='Loop' type='2' exp='26' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='x[cnt0] = 0' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='cnt0 = cnt0 + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Execution' description='' >
						<command class_type='decision' title='is first scan pulse arrived from computer' exp='intlatch = 1' swap='0' >
							<flowline >
								<command class_type='decision' title='set scan to 18.25 hz' exp='int_count1 = 4' swap='1' >
									<flowline >
										<command class_type='calculation' title='Increment Interrupt Count' >
											<exp exp='int_count1 = int_count1 + 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Reset Interrupt Count' >
											<exp exp='int_count1 = 0' />
											<exp exp='' />
										</command>
										<command class_type='call' title='Call Macro' macro='Outputs' />
										<command class_type='call' title='Call Macro' macro='probes' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='native' title='Clear watchdog timer' ccode='MX_CLEAR_WATCHDOG;
' language='C' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='service' description='' >
						<param name='a' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='40' />
						</param>
						<command class_type='native' title='reset and switch off watchdog timer' ccode='MX_CLEAR_WATCHDOG;
' language='C' />
						<command class_type='decision' title='Decision' exp='intlatch = 1' swap='0' >
							<flowline />
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='intlatch = 1' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='s0 = service.a[0]' />
							<exp exp='x[17] = (s0 AND 1) / 1' />
							<exp exp='x[18] = (s0 AND 2) / 2' />
							<exp exp='x[19] = (s0 AND 4) / 4' />
							<exp exp='x[20] = (s0 AND 8) / 8' />
							<exp exp='x[21] = (s0 AND 16) / 16' />
							<exp exp='x[22] = (s0 AND 32) / 32' />
							<exp exp='x[23] = (s0 AND 64) / 64' />
							<exp exp='x[24] = (s0 AND 128) / 128' />
							<exp exp='service.a[0] = cub_room1_dry' />
							<exp exp='service.a[1] = cub_room1_wet' />
							<exp exp='service.a[2] = cub_room2_dry' />
						</command>
						<command class_type='call' title='Call Component Macro' component='USB1' macro='SendString' >
							<argument exp='service.a' />
							<argument exp='3' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Outputs' description='' >
						<command class_type='calculation' title='Calculation' />
						<command class_type='output' title='Output' mode='1' port='1048580' mask='4' exp='x[17]' />
						<command class_type='output' title='Output' mode='1' port='1048580' mask='2' exp='x[18]' />
						<command class_type='output' title='Output' mode='1' port='1048580' mask='1' exp='x[19]' />
						<command class_type='output' title='Output' mode='1' port='1048576' mask='32' exp='x[20]' />
						<command class_type='output' title='Output' mode='1' port='1048577' mask='4' exp='x[21]' />
						<command class_type='output' title='Output' mode='1' port='1048577' mask='8' exp='x[22]' />
						<command class_type='output' title='Output' mode='1' port='1048577' mask='16' exp='x[23]' />
						<command class_type='output' title='Output' mode='1' port='1048577' mask='32' exp='x[24]' />
					</flowline>
				</macro>
				<macro >
					<flowline name='probes' description='' >
						<command class_type='call' title='Call Component Macro' component='probe1' macro='GetByte' >
							<return exp='temp1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='probe2' macro='GetByte' >
							<return exp='temp2' />
						</command>
						<command class_type='call' title='Call Component Macro' component='probe3' macro='GetByte' >
							<return exp='temp3' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='ADC1 = temp1 + ADC1' />
							<exp exp='ADC2 = temp2 + ADC2' />
							<exp exp='ADC3 = temp3 + ADC3' />
							<exp exp='cnt1 = cnt1 + 1' />
						</command>
						<command class_type='decision' title='Decision' exp='cnt1 = 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='cub_room1_dry = ADC1 / 100' />
									<exp exp='cub_room1_wet = ADC2 / 100' />
									<exp exp='cub_room2_dry = ADC3 / 100' />
									<exp exp='temp1 = 0' />
									<exp exp='temp2 = 0' />
									<exp exp='temp3 = 0' />
									<exp exp='ADC1 = 0' />
									<exp exp='ADC2 = 0' />
									<exp exp='ADC3 = 0' />
									<exp exp='cnt1 = 0' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='calculation' title='Calculation' >
							<exp exp='intlatch = 0' />
						</command>
						<command class_type='call' title='Call Macro' macro='Reset_Outputs' />
						<command class_type='interrupt' title='Interrupt' enable='1' name='TMR0' call='Execution' >
							<settings timer='1' prescale='256' postscale='-1' rollover='-1' bitcount='0' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='1' />
								<option value='1' />
								<option value='8' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='delay' title='Delay' exp='3' type='2' />
						<command class_type='call' title='Call Component Macro' component='USB1' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' component='USB1' macro='RunSlaveService' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='2' vmaj='1' codename='probe1' x='-88' y='-88' z='9' xsz='25.1419' ysz='25.1419' zsz='18.45' 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='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='channel' data='0' />
					<value target='vrefvol' data='158' />
					<value target='vrefop' data='1' />
					<value target='convspd' data='3' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='2' vmaj='1' codename='probe2' x='-56' y='-88' z='9' xsz='25.1419' ysz='25.1419' zsz='18.45' 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='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='channel' data='1' />
					<value target='vrefvol' data='158' />
					<value target='vrefop' data='1' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='14683ea8-5a08-4b3a-be2d-3dea3e17e720' vmin='2' vmaj='1' codename='probe3' x='-16' y='-88' z='9' xsz='25.1419' ysz='25.1419' zsz='18.45' 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='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='cap_color' data='192' />
					<value target='point_color' data='16777215' />
					<value target='channel' data='2' />
					<value target='vrefvol' data='158' />
					<value target='vrefop' data='1' />
					<value target='convspd' data='3' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='26cbc2df-5ef0-47db-ab2f-c2425b14462f' vmin='1' vmaj='1' codename='USB1' x='40' y='40' z='0.755' xsz='60' ysz='26' zsz='1.51' 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='vendor_ID' data='4799' />
					<value target='product_ID' data='65285' />
					<value target='dev_name' data='Turbo Smoker Room 1' />
					<value target='dev_manufacturer' data='Roy Johnston' />
					<value target='major_version' data='1' />
					<value target='minor_version' data='0' />
					<value target='enumeration_tout' data='0' />
					<value target='timeout' data='10' />
					<value target='country_code' data='000' />
					<value target='max_current' data='500' />
					<value target='usb_type' data='1' />
					<value target='slave_macro' data='service' />
					<value target='slave_params' data='011' />
					<value target='driver_directory' data='$(srcdir)' />
					<value target='driver_filename' data='mm_mchpusb' />
					<value target='gen_driver' data='0' />
					<value target='Instance' data='000' />
					<value target='SimTimeout' data='0' />
					<value target='vid_pid_str' data='vid_12bf&amp;pid_ff05' />
					<value target='label' data='USB Slave' />
				</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='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='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' />
	</panel3d>
	<layout >
		<view type='0' name='service' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='196' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='73' flags='0' />
		<view type='0' name='probes' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Outputs' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Execution' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Reset_Outputs' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAASgUAAAkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
