<root>
<document scada='0' schema='102' license='1,93986072,CDX9QB' title='' description='' fcversion='590336' target='PIC.12F.12F683' >
	<config data='!0,3015%0,5%3,0%4,1%5,0%6,0%7,0%8,0%a,0%b,0' clkspd='8000000' simspd='0' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='
' body='' />
	<debug >
		<watch expr='ADC' />
		<watch expr='Main.ADR' />
		<watch expr='SMOKE' />
		<watch expr='THERMO' />
		<watch expr='AVER_SMOKE' />
		<watch expr='AVER_TERMO' />
	</debug>
	<traces >
		<trace digital='1' displayname='Out' portdata='84017152' scopetype='1' showtrace='1' autonamed='0' channel='0' />
	</traces>
	<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='0' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='0' />
			<data name='DataPin' value='0' />
			<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' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</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='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='2ae3da20-d699-4dd2-9e9a-d69d5ac6913c' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<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' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='Channel' target='I2C_Master1::cal_i2c::CHANNEL' typeid='16' hidden='0' locked='0' info='Channel selection' filter='000Software
' />
				<property name='Clock Stretching' target='I2C_Master1::cal_i2c::ClockStretching' typeid='7' hidden='0' locked='0' info='Allows the clock signal to be stretched to help combat high capacitance on the SCL/SDA bus signals.
When setting the clock high the CAL code will wait for the clock to read as a high before continuing.
Can potentially cause lockups if pull up resistors are missing from the SDA / SCL signals.
Only compatible with Software I2C channels. ' />
				<property name='Threshold Value' target='DSPOutputPin1::Threshold' typeid='21' hidden='0' locked='0' info='Sets the level at which the pin goes into the active state.
&gt;= the threshold the pin will be in the active state.
&lt; the threshold the pin will be in the none active state.' />
				<property name='Integers' target='lut1::intfixed' typeid='11' hidden='0' locked='0' info='Comma seperated integer data which is used to create the C code which is inserted into the ROM.' />
			</properties>
			<values >
				<value target='I2C_Master1::cal_i2c::CHANNEL' data='000' />
				<value target='I2C_Master1::cal_i2c::ClockStretching' data='0' />
				<value target='DSPOutputPin1::Threshold' data='10' />
				<value target='lut1::intfixed' data='' />
			</values>
			<events />
			<apis >
				<api name='INT_LINE' alt='INT_LINE' type='0' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='OWERWRITE_BUFFER' type='s16' description='Перезапись буфера на место' isconst='1' isHidden='0' isinit='1' usrinit='153' setinit='0x99' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='WRITING_BUFFER' type='s16' description='Запись в буфер' isconst='1' isHidden='0' isinit='1' usrinit='170' setinit='0xAA' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='START_MEAS' type='s16' description='Начать измерение' isconst='1' isHidden='0' isinit='1' usrinit='119' setinit='0x77' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='REQUEST_CONFIRMATION' type='s16' description='Запрос подтверждения' isconst='1' isHidden='0' isinit='1' usrinit='238' setinit='0xEE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='READI_ADDRES' type='s16' description='Чтение адресов сработавших извещателей' isconst='1' isHidden='0' isinit='1' usrinit='85' setinit='0x55' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='READING_BUFFER' type='s16' description='Чтение из буфера' isconst='1' isHidden='0' isinit='1' usrinit='187' setinit='0xBB' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='READ_MEMORY' type='s16' description='Чтение из памяти' isconst='1' isHidden='0' isinit='1' usrinit='204' setinit='0xCC' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDRESING_DETECTOR' type='s16' description='Адресация извещателя (установка активности)' isconst='1' isHidden='0' isinit='1' usrinit='136' setinit='0x88' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AVER_SMOKE' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AVER_TERMO' type='u16' description='Среднее значение температуры' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SURVEY_WORK' type='s16' description='Опрос работоспособности' isconst='1' isHidden='0' isinit='1' usrinit='102' setinit='0x66' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='INT_LINE' description='Прерывания компаратора по линии связи
Формирование протокола 1-Wire' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='Инициализация контроллера' textshow='0' ccode='OPTION_REG=128;
OSCCON=0x70; // Freq 8MHz
TRISIO=30; // Кофигурасия порт
GPIO=0;
ANSEL=46; // Аналоговые входы и скорость чтения АЦП
WPU=0; // Снял подтягивающие резисторы

//Настройки компаратора

CMCON0=20; // Кофигурация входа компаратора
CMCON1=0; // Без синхронизации

// Настройка опорного напряжения

VRCON=136; // 2.5v

//Настройка прерываний

INTCON=192; // Разрешил гпрерывания' cmdcolor='1544914' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' language='C' />
						<command class_type='output' title='Ключ заперт' cmdcolor='3781962' cmdcolor_sec='3781962' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' mode='1' port='1048576' mask='1' exp='0' usechipref='1' />
						<command class_type='output' title='Измеритель выключен' cmdcolor='3781962' cmdcolor_sec='3781962' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' mode='1' port='1048576' mask='32' exp='0' usechipref='1' />
						<command class_type='call' title='Инициализация канала дыма' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='AD_SMOKE' macro='RawEnable' />
						<command class_type='call' title='Инициализация канала температуры' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='AD_THERMO' macro='RawEnable' />
						<command class_type='interrupt' title='Прерывания Компаратора COMP (WanWire) RX/TX' textshow='0' cmdcolor='14697803' cmdcolor_sec='14697803' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' enable='1' name='' call='INT_LINE' >
							<custom name='INT_COM' handler='if( CMIF ){ FCM_%n();}; 
CMIF=0; 
VR2=!COUT;' enable='CMIE=1;' disable='CMIE=0;' />
						</command>
						<command class_type='loop' title='______________________   ROGRAM   ________________________' textshow='0' cmdcolor='16494651' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='0' exp='1' >
							<flowline >
								<command class_type='comment' title='' comment='_________________________ ИЗМЕРЕНИЯ' textarea='40,86,40,86' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
								<command class_type='call' title='Очистка буффера дыма' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='BUF_SMOKE' macro='FlushBuffer' />
								<command class_type='call' title='Очистка буфера температуры' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='BUF_TERMO' macro='FlushBuffer' />
								<command class_type='calculation' title='Сброс переменных' cmdcolor='1544914' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='AVER_SMOKE = 0' />
									<exp exp='AVER_TERMO = 0' />
								</command>
								<command class_type='loop' title='Измерения' cmdcolor='16494651' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='2' exp='10' >
									<flowline >
										<command class_type='call' title='Дать питание на измеритель' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='led_5mm1' macro='TurnOn' />
										<command class_type='delay' title='Время выхода на режим' cmdcolor='14697803' cmdcolor_sec='14697803' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='10' type='1' />
										<command class_type='calculation' title='Заполнение буфферов дыма и температуры' cmdcolor='1544914' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='BUF_SMOKE :: PutData (AD_SMOKE :: GetInt ())' />
											<exp exp='BUF_TERMO :: PutData (AD_THERMO :: GetInt ())' />
										</command>
										<command class_type='call' title='Снять питание с измерителя' cmdcolor='8864659' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='led_5mm1' macro='TurnOff' />
										<command class_type='delay' title='Пауза измерений' cmdcolor='14697803' cmdcolor_sec='14697803' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
									</flowline>
								</command>
								<command class_type='comment' title='' comment='_________________________ ВЫЧИСЛЕНИЯ' textarea='36,84,36,84' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
								<command class_type='comment' title='' comment='_______________________ Обработка данных' textarea='69,81,69,81' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='shape' codename='shape1' x='0' y='0' z='0' xsz='32' ysz='32' zsz='32' 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' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape' data='201' />
					<value target='Color' data='15790320' />
					<value target='Outline' data='0' />
					<value target='Thickness' data='0' />
					<value target='Image' data='' />
					<value target='Model' data='' />
					<value target='Unit' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='AD_SMOKE' x='-125' y='245' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='16711680' />
					<value target='mark_col' data='255' />
					<value target='body_color' data='12632256' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='2' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='002' />
					<value target='actime' data='10' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='AD_THERMO' x='-70' y='245' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='16711680' />
					<value target='mark_col' data='255' />
					<value target='body_color' data='12632256' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='3' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='002' />
					<value target='actime' data='10' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label1' x='-125' y='320' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='16777215' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='SMOKE' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='9a971ee1-28e0-4e47-9c09-71268383fc75' vmin='0' vmaj='1' codename='shape_label2' x='-70' y='320' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Color' data='16777215' />
					<value target='Background' data='-1' />
					<value target='Font' data='Arial' />
					<value target='Text' data='TERMO' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='201d99f7-acf8-481d-a703-61860c2ba3ea' vmin='5' vmaj='1' codename='BUF_SMOKE' x='-125' y='140' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='BufferSize' data='10' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='201d99f7-acf8-481d-a703-61860c2ba3ea' vmin='5' vmaj='1' codename='BUF_TERMO' x='-70' y='140' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='BufferSize' data='10' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d92e8259-f3a8-4176-a8c4-fe7ca42b2c3f' vmin='1' vmaj='1' codename='led_5mm1' x='-16.3625' y='305.649' z='0' xsz='4.16972' ysz='4.16972' 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='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pin' data='$PORTA.5' />
					<value target='polarity' data='001' />
					<value target='on_color' data='255' />
					<value target='length' data='4.000000' />
					<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>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='-15.8875' ye='10.5491' ze='729.463' xt='-15.8875' yt='10.5491' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='1462' dy='1791' zoom='242.51' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='-3.48617' ye='-29.8056' ze='354.503' xt='-3.48617' yt='-29.8056' 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---------------------wUAAAAiAAAAXA0AABsHAAA' zoom='75' scrollx='0' scrolly='274' flags='0' />
	</layout>
</document>
</root>
