<root>
<document scada='0' schema='102' license='1,Dev User,H1YQFU' title='' description='' fcversion='524544' target='PIC.16F.16F1827' >
	<config data='!0,fe2!10,1613%0,2%3,0%5,1%6,1%7,1%8,1%9,3%b,1%c,0%d,0%10,3%14,1%18,0%19,1%1a,1%1c,1%1d,0' clkspd='8000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='Dummy' />
		<watch expr='Measurement.ADC_MW' />
	</debug>
	<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='21' />
			<data name='CalculatedCommsDelay' value='21' />
		</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='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='437c241f-cbda-4e14-9777-02e1cda75ed8' vstate='40' vmin='0' vmaj='1' srcleaf='temperature.fcfx' visiblename='Temperatur_Indicator' description='' category='Misc' catenable='1' author='Marcel Comos' manuname='' manucode='' sysinfo='43' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<component class_type='root' codename='Temperatur_Indicator' 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' macronames='$(type)_$(module)__$(macro)' >
			<resources />
			<properties />
			<values />
			<events />
			<apis >
				<api name='Measurement' alt='Measurement_Sim' type='1' proto='1' />
			</apis>
			<variables >
				<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='Dummy' 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='Measurement' description='' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADC_MW' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADCON1_BYTE' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADCON0_BYTE' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='RAW_ADC' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADC_COUNT' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Berechnung' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='.ADC_MW = 0' />
							<exp exp='' />
						</command>
						<command class_type='native' title='C-Code' ccode='FVRCON = (FVRCON | 0b11110010); // FVR TSEN and TSRNG enable
ADCON0 = 0x75; // Enable Temperature Indicator
ADCON1 = 0xc0; // Right justified, FOSC/8

FCI_DELAYBYTE_US(200);
for( FCL_ADC_COUNT = 0; FCL_ADC_COUNT != 25; FCL_ADC_COUNT++)  
    {
    
    ADCON0 = (ADCON0 | 0x02); // start conversion
    CLRWDT();
    while (ADCON0 &amp; 0x02);
    FCI_DELAYBYTE_US(5);
    
    FCL_RAW_ADC = ADRESH &lt;&lt; 8;
    FCL_RAW_ADC = FCL_RAW_ADC + ADRESL;
    FCL_ADC_MW = FCL_ADC_MW + FCL_RAW_ADC;
    }

FVRCON = (FVRCON &amp; 0b11001111); // FVR TSEN and TSRNG disable' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='calculation' title='Berechnung' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='.ADC_MW = .ADC_MW / .ADC_COUNT' />
							<exp exp='' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='Berechnung' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='.Return = .ADC_MW' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Measurement_Sim' description='' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADC_MW' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADCON1_BYTE' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADCON0_BYTE' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='RAW_ADC' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='ADC_COUNT' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='sim' title='Simulation' cmdcolor='1879295' cmdcolor_sec='5751039' component='Temperature_Scale' macro='GetValue' >
							<return exp='.ADC_MW' />
						</command>
						<command class_type='calculation' title='Berechnung' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='.Return = .ADC_MW * 22' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Makro-Aufruf' cmdcolor='1879295' cmdcolor_sec='5751039' macro='Measurement_Sim' >
							<return exp='Dummy' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='f51b5e55-6a64-49ad-b79d-2b57db0cd54b' vmin='3' vmaj='1' codename='Temperature_Scale' x='50' y='50' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='is_slider' data='001' />
					<value target='val_max' data='85.000000' />
					<value target='val_min' data='-40.000000' />
					<value target='bg_color' data='0' />
					<value target='ink_color' data='49152' />
					<value target='neg_color' data='33023' />
					<value target='label_color' data='16777215' />
					<value target='bezel_color' data='2960685' />
					<value target='resolution' data='15' />
					<value target='marks_count' data='5' />
					<value target='marks_subdiv' data='5' />
					<value target='dec_places' data='0' />
					<value target='num_size' data='6' />
					<value target='num_font' data='Arial Narrow' />
					<value target='label_text' data='Value' />
					<value target='label_size' data='8' />
					<value target='label_font' data='Arial Narrow' />
				</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='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='0' />
		<camera xe='54.1609' ye='57.8108' ze='22.8512' xt='54.1609' yt='57.8108' 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' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAALgcAACoHAAA' zoom='70' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Measurement_Sim' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAeAAAALgcAACoHAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
