<root>
<document schema='101' license='1,Chris mellors,A16HQC' title='' description='' target='PIC16.33E.ECIO40P16' >
	<config data='' clkspd='140000000' 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='2' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='6' />
			<data name='clkbit' value='3' />
			<data name='dataport' value='4' />
			<data name='databit' value='2' />
			<data name='ghostype' value='1' />
			<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 >
		<watch expr='AirCon_Speed' />
		<watch expr='FAN1_Speed' />
		<watch expr='Speed_Count' />
		<watch expr='DM_Start' />
		<watch expr='TMR1_Count' />
		<watch expr='message' />
		<watch expr='CAN_ID' />
		<watch expr='T0' />
		<watch expr='T1' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='ee1316ae-3de9-4cfb-8888-34901bfb0623' 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='1' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Count' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CAN_ID' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AirCon_Speed' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T7' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T6' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T5' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</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='Speed_Count' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T4' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T3' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T2' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T1' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T0' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FAN1_Speed' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='D_Eng' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Heart_Beat' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DM_Start' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TMR1_Count' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='M_Health' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='message' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='CAN_HB_Send' description='' >
						<command class_type='decision' title='Decision' exp='TMR1_Count = 16' swap='1' >
							<flowline >
								<command class_type='comment' title='' comment='This is the CAN ID bit that doesnt seem to Work!' textarea='306,200,306,200' />
								<command class_type='calculation' title='Calculation' >
									<exp exp='TMR1_Count = TMR1_Count + 1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='CheckRx' >
									<return exp='message' />
									<argument exp='0' />
								</command>
								<command class_type='decision' title='Decision' exp='message = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='This is where I try to get the recieved message ID
The wrong ID is returned regardless of the macro used (ie siple, high or low)' textarea='245,200,975,200' />
										<command class_type='call' title='Call Component Macro' component='can1' macro='GetRxIDSimple' >
											<return exp='CAN_ID' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxIDSimple' >
											<argument exp='0' />
											<argument exp='41' />
										</command>
										<command class_type='comment' title='' comment='This is where I put the recieved ID in a can message to be read and confirmed via a CANalyser...' textarea='268,131,268,131' />
										<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxData' >
											<argument exp='0' />
											<argument exp='8' />
											<argument exp='CAN_ID' />
											<argument exp='1' />
											<argument exp='2' />
											<argument exp='2' />
											<argument exp='3' />
											<argument exp='3' />
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='can1' macro='SendBuffer' >
											<argument exp='0' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='TMR1_Count = 0' />
								</command>
								<command class_type='decision' title='Decision' exp='Heart_Beat = 255' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Heart_Beat = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='Heart_Beat = Heart_Beat + 1' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxIDSimple' >
									<argument exp='0' />
									<argument exp='20' />
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxData' >
									<argument exp='0' />
									<argument exp='8' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='Heart_Beat' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='SendBuffer' >
									<argument exp='0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='PWM_test' description='' >
						<command class_type='call' title='Call Component Macro' component='FAN_1_PWM' macro='SetDutyCycle' >
							<argument exp='FAN1_Speed' />
						</command>
						<command class_type='call' title='Call Component Macro' component='Air_C_PWM' macro='SetDutyCycle' >
							<argument exp='AirCon_Speed' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='calculation' title='Calculation' >
							<exp exp='DM_Start = 24' />
							<exp exp='M_Health = 42' />
							<exp exp='AirCon_Speed = 84' />
							<exp exp='FAN1_Speed = 167' />
						</command>
						<command class_type='call' title='Call Component Macro' component='can1' macro='Initialise' />
						<command class_type='interrupt' title='Interrupt' enable='1' name='TMR1' call='CAN_HB_Send' >
							<settings timer='1' prescale='64' postscale='-1' rollover='65536' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='2' />
								<option value='65536' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='call' title='Call Component Macro' component='FAN_1_PWM' macro='Enable' />
						<command class_type='call' title='Call Component Macro' component='Air_C_PWM' macro='Enable' />
						<command class_type='call' title='Call Component Macro' component='EM_Stop_LED' macro='TurnOff' />
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='Dman_StartStop' macro='ReadState' >
									<return exp='D_Eng' />
								</command>
								<command class_type='decision' title='Decision' exp='D_Eng = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='AirCon_Speed = 86' />
											<exp exp='FAN1_Speed = 167' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='DM_Start = 42' />
										</command>
										<command class_type='call' title='Call Macro' macro='PWM_test' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' >
											<exp exp='DM_Start = 24' />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='AirCon_Speed = 0' />
											<exp exp='FAN1_Speed = 0' />
										</command>
										<command class_type='call' title='Call Macro' macro='PWM_test' />
									</flowline>
								</command>
								<command class_type='delay' title='Delay' exp='200' type='1' />
								<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxIDSimple' >
									<argument exp='0' />
									<argument exp='40' />
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='SetTxData' >
									<argument exp='0' />
									<argument exp='8' />
									<argument exp='DM_Start' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='M_Health' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Component Macro' component='can1' macro='SendBuffer' >
									<argument exp='0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='da332928-6342-4c2c-afc7-eaf33917d33e' vmin='2' vmaj='1' codename='can1' x='8' y='56' z='0.755' 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 />
				<values >
					<value target='CHANNEL' data='000' />
					<value target='BUS_RATE' data='002' />
					<value target='SAMPLE' data='001' />
					<value target='SJW' data='000' />
					<value target='EXID' data='000' />
					<value target='REF' data='0' />
					<value target='OSC' data='140000000' />
					<value target='BAUD1' data='1' />
					<value target='BAUD2' data='209' />
					<value target='BAUD3' data='3' />
					<value target='SPIChannel' data='001' />
					<value target='TXPin' data='$PORTD.0' />
					<value target='RXPin' data='$PORTD.1' />
					<value target='TXRemap' data='000' />
					<value target='RXRemap' data='065' />
					<value target='SDO' data='$PORTD.0' />
					<value target='SDI' data='$PORTD.1' />
					<value target='SCK' data='$PORTD.2' />
					<value target='SPI_CS' data='$PORTD.3' />
					<value target='MosiRemap' data='000' />
					<value target='MisoRemap' data='065' />
					<value target='ClkRemap' data='002' />
					<value target='TXB0ID' data='0' />
					<value target='TXB0LEN' data='0' />
					<value target='TXB0DB0' data='0' />
					<value target='TXB0DB1' data='0' />
					<value target='TXB0DB2' data='0' />
					<value target='TXB0DB3' data='0' />
					<value target='TXB0DB4' data='0' />
					<value target='TXB0DB5' data='0' />
					<value target='TXB0DB6' data='0' />
					<value target='TXB0DB7' data='0' />
					<value target='TXB1ID' data='0' />
					<value target='TXB1LEN' data='0' />
					<value target='TXB1DB0' data='0' />
					<value target='TXB1DB1' data='0' />
					<value target='TXB1DB2' data='0' />
					<value target='TXB1DB3' data='0' />
					<value target='TXB1DB4' data='0' />
					<value target='TXB1DB5' data='0' />
					<value target='TXB1DB6' data='0' />
					<value target='TXB1DB7' data='0' />
					<value target='TXB2ID' data='0' />
					<value target='TXB2LEN' data='0' />
					<value target='TXB2DB0' data='0' />
					<value target='TXB2DB1' data='0' />
					<value target='TXB2DB2' data='0' />
					<value target='TXB2DB3' data='0' />
					<value target='TXB2DB4' data='0' />
					<value target='TXB2DB5' data='0' />
					<value target='TXB2DB6' data='0' />
					<value target='TXB2DB7' data='0' />
					<value target='RXB0CFG' data='001' />
					<value target='RXM0' data='1984' />
					<value target='RXF0' data='1' />
					<value target='RXF1' data='1' />
					<value target='RXB1CFG' data='000' />
					<value target='RXM1' data='0' />
					<value target='RXF2' data='0' />
					<value target='RXF3' data='0' />
					<value target='RXF4' data='0' />
					<value target='RXF5' data='0' />
					<value target='MIAC' data='0' />
					<value target='label' data='CAN Bus' />
					<value target='Injector' data='' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='5' vmaj='1' codename='FAN_1_PWM' x='-56' y='0' z='0.93' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTE.0' />
					<value target='RemapPin' data='008' />
					<value target='period' data='250' />
					<value target='prescale' data='001' />
					<value target='period_calc' data='7.171428' />
					<value target='frequency_calc' data='139.442230' />
					<value target='pwm_prescale' data='2' />
					<value target='SimRep' data='001' />
					<value target='DispPeriods' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='5' vmaj='1' codename='Air_C_PWM' x='80' y='0' z='0.93' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='002' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTE.2' />
					<value target='RemapPin' data='009' />
					<value target='period' data='255' />
					<value target='prescale' data='001' />
					<value target='period_calc' data='7.314286' />
					<value target='frequency_calc' data='136.718750' />
					<value target='pwm_prescale' data='2' />
					<value target='SimRep' data='001' />
					<value target='DispPeriods' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='EM_Stop_LED' x='80' y='72' z='-3.85' xsz='4.10256' ysz='3.07692' 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 />
				<values >
					<value target='pin' data='$PORTE.3' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label1' x='80' y='56' z='0' xsz='8' ysz='8' 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 />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='EM Stop relay' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='e8f04af0-03d9-4b1c-83d3-9d0b1dc0f80a' vmin='1' vmaj='1' codename='Dman_StartStop' x='-96' y='32' z='-2.4395' xsz='2.0339' ysz='1.88976' 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 />
				<values >
					<value target='pin' data='$PORTB.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='text' codename='label2' x='-48' y='32' z='0' xsz='8' ysz='8' 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 />
				<values >
					<value target='Color' data='192' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='Dearman Start / Stop' />
				</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='16777215' img='' style='0' />
		<table rgb='15232' 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>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='16777215' img='' style='0' />
		<table rgb='15232' 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='CAN_HB_Send' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAA4gQAAJEDAAA' zoom='75' scrollx='0' scrolly='145' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAA4gQAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='PWM_test' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAA4gQAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
