<?xml version="1.0" encoding="UTF-8" ?>
<OpenSCADA>
    <!--
    This is the OpenSCADA configuration file.
    -->
    <station id="StNachPr">
	<!--
	Discribe internal parameter for station.
	Station this only OpenSCADA programm.
	-->
	<prm id="StName">StNachPr</prm>
	<prm id="StName_ru">СтНачПр</prm>
	<prm id="StName_uk">СтНачПр</prm>
	<prm id="WorkDB">SQLite.GenDB</prm>
	<prm id="Workdir">/home/user/OScadaNachPr/share/openscada</prm>
	<prm id="IcoDir">./icons</prm>
	<prm id="ModDir">../../lib/openscada</prm>
	<prm id="LogTarget">10</prm>
	<prm id="MessLev">0</prm>
	<prm id="Lang2CodeBase">en</prm>
	<prm id="SaveAtExit">0</prm>
	<prm id="SavePeriod">0</prm>

	<node id="sub_BD">
	    <tbl id="DB">
		<fld ID="GenDB" TYPE="SQLite" NAME="Generic DB" NAME_ru="Основная БД" NAME_uk="Основна БД" ADDR="./DATA/MainReportSt.db" CODEPAGE="KOI8-U"/>
	    </tbl>
	</node>

	<node id="sub_Security">
	    <!--
	    <tbl id="Security_user">
		<fld
		    NAME="root"
		    DESCR="Super user"
		    DESCR_ru="Супер пользователь"
		    DESCR_uk="Супер користувач"
		    PASS="openscada"/>
		<fld
		    NAME="user"
		    DESCR="System user"
		    DESCR_ru="Системный пользователь"
		    DESCR_uk="Системний користувач"
		    PASS=""/>
	    </tbl>
	    <tbl id="Security_grp">
		<fld
		    NAME="root"
		    DESCR="Super users groups"
		    DESCR_ru="Группа суперпользователей"
		    DESCR_uk="Група суперкористувачів"
		    USERS="root;user"/>
	    </tbl>-->
	</node>

	<node id="sub_ModSched">
	    <prm id="ModAllow">*</prm>
	    <prm id="ModDeny"></prm>
	    <prm id="ChkPer">0</prm>
	</node>

	<node id="sub_Transport">
	    <!--
	    <tbl id="Transport_in">
		<fld
		    ID="WEB_1"
		    MODULE="Sockets"
		    NAME="Generic WEB interface"
		    NAME_ru="Основной WEB интерфейс"
		    NAME_uk="Основний WEB інтерфейс"
		    DESCRIPT="Generic transport for WEB interface."
		    DESCRIPT_ru="Основной транспорт для WEB интерфейса."
		    DESCRIPT_uk="Основний транспорт для WEB інтерфейсу."
		    ADDR="TCP::10002:0"
		    PROT="HTTP"
		    START="1"/>
		<fld
		    ID="WEB_2"
		    MODULE="Sockets"
		    NAME="Reserve WEB interface"
		    NAME_ru="Резервный WEB интерфейс"
		    NAME_uk="Резервний WEB інтерфейс"
		    DESCRIPT="Reserve transport for WEB interface."
		    DESCRIPT_ru="Резервный транспорт для WEB интерфейса."
		    DESCRIPT_uk="Резервний транспорт для WEB інтерфейсу."
		    ADDR="TCP::10004:0"
		    PROT="HTTP"
		    START="1"/>
	    </tbl>
	    <tbl id="Transport_out">
	        <fld
		    ID="testModBus"
		    MODULE="Sockets"
		    NAME="Test ModBus"
		    NAME_ru="Тест ModBus"
		    NAME_uk="Тест ModBus"
		    DESCRIPT="Data exchange by protocol ModBus test."
		    DESCRIPT_ru="Тест обмена по протоколу ModBus."
		    DESCRIPT_uk="Тест обміну за протоколом ModBus."
		    ADDR="TCP:localhost:10502"
		    START="1"/>
	    </tbl>-->
	</node>

	<node id="sub_DAQ">
	    <!--
	    <tbl id="tmplib">
		<fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" DB="tmplib_test2"/>
	    </tbl>
	    <tbl id="tmplib_test2">
		<fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" DB="test2"
		    PROGRAM="JavaLikeCalc.JavaScript&#010;cnt=5*i"/>
	    </tbl>
	    <tbl id="tmplib_test2_io">
		<fld TMPL_ID="test2" ID="i" NAME="I" NAME_ru="I" NAME_uk="I" TYPE="4" FLAGS="160" VALUE="" POS="0"/>
		<fld TMPL_ID="test2" ID="cnt" NAME="Cnt" NAME_ru="Cnt" NAME_uk="Cnt" TYPE="4" FLAGS="32" VALUE="" POS="0"/>
	    </tbl>-->

	    <node id="mod_LogicLev">
		<!--
		<tbl id="DAQ">
		    <fld
			ID="test2"
			NAME="Test 2"
			NAME_ru="Тест 2"
			NAME_uk="Тест 2"
			DESCR=""
			DESCR_ru=""
			DESCR_uk=""
			ENABLE="1"
			START="1"
			PRM_BD="test2prm"
			PERIOD="1000"
			PRIOR="0"/>
		</tbl>
		<tbl id="test2prm">
		    <fld SHIFR="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" MODE="2" PRM="test2.test2"/>
		</tbl>-->
	    </node>

	    <node id="mod_System">
		<!--
		<tbl id="DAQ">
		    <fld
			ID="DataOS"
			NAME="Data OS"
			NAME_ru="Даные ОС"
			NAME_uk="Дані ОС"
			DESCR="Data of services and subsystems OS."
			DESCR_ru="Данные сервисов и подсистем ОС."
			DESCR_uk="Дані сервісів та підсистем ОС."
			ENABLE="1"
			START="1"
			AUTO_FILL="0"
			PRM_BD="DataOSprm"
			PERIOD="1000"
			PRIOR="0"/>
		</tbl>
		<tbl id="DataOSprm">
		    <fld SHIFR="CPU" NAME="CPU load" NAME_ru="Нагрузка CPU" NAME_uk="Навантаження CPU" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" TYPE="CPU" SUBT="gen"/>
		    <fld SHIFR="MEM" NAME="Memory" NAME_ru="Память" NAME_uk="Пам'ять" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" TYPE="MEM"/>
		</tbl>
		-->
	    </node>

	    <node id="mod_DiamondBoards">
	        <!--
		<tbl id="DAQ">
		    <fld ID="Athena" NAME="Athena board" NAME_ru="Плата Athena" NAME_uk="Плата Athena" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="0"
			BOARD="25" PRM_BD_A="AthenaAnPrm" PRM_BD_D="AthenaDigPrm" ADDR="640" INT="5"
			DIO_CFG="0" ADMODE="0" ADRANGE="0" ADPOLAR="0" ADGAIN="0" ADCONVRATE="1000"/>
		</tbl>
		<tbl id="AthenaAnPrm">
		    <fld SHIFR="ai0" NAME="AI 0" NAME_ru="AI 0" NAME_uk="AI 0" DESCR="" DESCR_ru="" DESCR_uk="" EN="0" TYPE="0" CNL="0" GAIN="0"/>
		</tbl>
		<tbl id="AthenaDigPrm">
		    <fld SHIFR="di0" NAME="DI 0" NAME_ru="DI 0" NAME_uk="DI 0" DESCR="" DESCR_ru="" DESCR_uk="" EN="0" TYPE="0" PORT="0" CNL="0"/>
		</tbl>
		-->
	    </node>

	    <node id="mod_BlockCalc">
		<!--
		<tbl id="DAQ">
		    <fld ID="Model" NAME="Model" NAME_ru="Модель" NAME_uk="Модель" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="Model_prm" BLOCK_SH="Model_blcks"
			PERIOD="1000" PRIOR="0" PER_DB="0" ITER="1"/>
		</tbl>
		<tbl id="Model_blcks">
		    <fld ID="Klap" NAME="Klapan" NAME_ru="Клапан" NAME_uk="Клапан" DESCR="" DESCR_ru="" DESCR_uk="" FUNC="DAQ.JavaLikeCalc.lib_techApp.klap" EN="1" PROC="1"/>
		</tbl>
		<tbl id="Model_blcks_io">
		    <fld BLK_ID="Klap" ID="l_kl1" TLNK="0" LNK="" VAL="50"/>
		    <fld BLK_ID="Klap" ID="l_kl2" TLNK="0" LNK="" VAL="20"/>
		</tbl>
		<tbl id="Model_prm">
		    <fld SHIFR="l_kl" NAME="Klap lev" NAME_ru="Полож. клапана" NAME_uk="Полож. клапана" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" BLK="Klap" IO="l_kl1"/>
		</tbl>
		-->
	    </node>

	    <node id="mod_JavaLikeCalc">
		<!--
		<tbl id="DAQ">
		    <fld ID="CalcTest" NAME="Calc Test" NAME_ru="Тест вычисл." NAME_uk="Тест обчисл." DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="CalcTest_prm"
			FUNC="TemplFunc.d_alarm" PERIOD="1000" PRIOR="0" PER_DB="0" ITER="1"/>
		</tbl>
		<tbl id="CalcTest_val">
		    <fld ID="in" VAL="0"/>
		    <fld ID="alrm" VAL=""/>
		    <fld ID="alrm_md" VAL="1"/>
		    <fld ID="alrm_mess" VAL="Error present."/>
		</tbl>
		<tbl id="CalcTest_prm">
		    <fld SHIFR="alrm" NAME="Alarm" NAME_ru="Авария" NAME_uk="Аварія" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" FLD="alrm"/>
		</tbl>
		<tbl id="lib">
		    <fld ID="TemplFunc" NAME="" NAME_ru="" NAME_uk="" DESCR="" ESCR_ru="" DESCR_uk="" DB="lib_TemplFunc"/>
		</tbl>
		<tbl id="lib_TemplFunc">
		    <fld ID="d_alarm" NAME="Digit alarm" NAME_ru="Авария по дискр." NAME_uk="Аварія за дискр" DESCR="" FORMULA="alrm=(in==alrm_md)?&quot;1:&quot;+alrm_mess:&quot;0&quot;;"/>
		</tbl>
		<tbl id="lib_TemplFunc_io">
		    <fld F_ID="d_alarm" ID="in" NAME="Input" NAME_ru="Вход" NAME_uk="Вхід" TYPE="3" MODE="0" DEF="" HIDE="0" POS="0"/>
		    <fld F_ID="d_alarm" ID="alrm" NAME="Alarm" NAME_ru="Авария" NAME_uk="Аварія" TYPE="0" MODE="1" DEF="" HIDE="0" POS="1"/>
		    <fld F_ID="d_alarm" ID="alrm_md" NAME="Alarm mode" NAME_ru="Режим аварии" NAME_uk="Режим аварії" TYPE="3" MODE="0" DEF="" HIDE="0" POS="2"/>
		    <fld F_ID="d_alarm" ID="alrm_mess" NAME="Alarm message" NAME_ru="Сообщ. аварии" NAME_uk="Повід. аварії" TYPE="0" MODE="0" DEF="" HIDE="0" POS="3"/>
		</tbl>-->
	    </node>

	    <node id="mod_CIF">
		<!--
		<tbl id="DAQ">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="test2prm"
			 PERIOD="1000" PRIOR="0" CIF_DEV="0" ADDR="5" ASINC_WR="0"/>
		</tbl>
		<tbl id="test2prm">
		    <fld SHIFR="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" TMPL="S7.ai_man"/>
		</tbl>-->
	    </node>

	    <node id="mod_SNMP">
		<!--
		<tbl id="DAQ">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="test2prm"
			 PERIOD="1000" PRIOR="0" ADDR="localhost" COMM="public" PATTR_LIM="20"/>
		</tbl>
		<tbl id="test2prm">
		    <fld SHIFR="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" OID_LS="system"/>
		</tbl>-->
	    </node>

	    <node id="mod_ModBus">
		<!--
		<tbl id="DAQ">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="test2prm"
			 PERIOD="1000" PRIOR="0" TRANSP="Sockets" ADDR="exlar.diya.org" NODE="1"/>
		</tbl>
		<tbl id="test2prm">
		    <fld SHIFR="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" EN="1" ATTR_LS="321:0:tst:Test"/>
		</tbl>-->
	    </node>

	    <node id="mod_Transporter">
		<!--
		<tbl id="DAQ">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" ENABLE="1" START="1" PRM_BD="test2prm"
			 PERIOD="1000" PRIOR="0" SYNCPER="60" STATIONS="loop" CNTRPRM="System.AutoDA"/>
		</tbl>-->
	    </node>

	</node>

	<node id="sub_Archive">
	    <prm id="MessBufSize">1000</prm>
	    <prm id="MessPeriod">5</prm>
	    <prm id="ValPeriod">1000</prm>
	    <prm id="ValPriority">10</prm>
	    <!--
	    <tbl id="Archive_mess_proc">
		<fld
		    ID="StatErrors"
		    MODUL="FSArch"
		    NAME="Errors"
		    NAME_ru="Ошибки"
		    NAME_uk="Помилки"
		    DESCR="Local errors' archive"
		    DESCR_ru="Архив локальных ощибок"
		    DESCR_uk="Архів локальних помилок"
		    START="1"
		    CATEG="/DemoStation*"
		    LEVEL="4"
		    ADDR="ARCHIVES/MESS/stError/"
		    FSArchMSize="300"
		    FSArchNFiles="10"
		    FSArchTmSize="30"
		    FSArchXML="1"
		    FSArchPackTm="10"
		    FSArchTm="60"/>
		<fld
		    ID="NetRequsts"
		    MODUL="FSArch"
		    NAME="Net requests"
		    NAME_ru="Сетевые запросы"
		    NAME_uk="Мережеві запити"
		    DESCR="Requests to server through transport Sockets."
		    DESCR_ru="Запросы к серверу через транспорт Sockets."
		    DESCR_uk="Запити до сервера через транспорт Sockets."
		    START="1"
		    CATEG="/DemoStation/Transport/Sockets*"
		    LEVEL="1"
		    ADDR="ARCHIVES/MESS/Net/"
		    FSArchMSize="300"
		    FSArchNFiles="10"
		    FSArchTmSize="30"
		    FSArchXML="1"
		    FSArchPackTm="10"
		    FSArchTm="60"/>
	    </tbl>
	    <tbl id="Archive_val_proc">
		<fld
		    ID="1h"
		    MODUL="FSArch"
		    NAME="1hour"
		    NAME_ru="1час"
		    NAME_uk="1год"
		    DESCR="Averaging for hour"
		    DESCR_ru="Усреднение за час"
		    DESCR_uk="Усереднення за годину"
		    START="1"
		    ADDR="ARCHIVES/VAL/1h/"
		    V_PER="360"
		    A_PER="60"
		    FSArchTmSize="8640"
		    FSArchNFiles="10"
		    FSArchRound="0.1"
		    FSArchPackTm="10"
		    FSArchTm="60"/>
	    </tbl>
	    <tbl id="Archive_val">
	        <fld
		    ID="test1"
		    NAME="Test 1"
		    NAME_ru="Тест 1"
		    NAME_uk="Тест 1"
		    DESCR="Test 1"
		    DESCR_ru="Тест 1"
		    DESCR_uk="Тест 1"
		    START="1"
		    VTYPE="1"
		    BPER="1"
		    BSIZE="200"
		    BHGRD="1"
		    BHRES="0"
		    SrcMode="0"
		    Source=""
		    ArchS=""/>
	    </tbl>-->
	</node>

	<node id="sub_Protocol">
	</node>

	<node id="sub_UI">
	    <node id="mod_QTStarter">
		<prm id="StartMod">QTCfg</prm>
	    </node>
	    <node id="mod_WebCfg">
		<prm id="SessTimeLife">20</prm>
	    </node>
	    <node id="mod_VCAEngine">
		<!--
		<tbl id="LIB">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" DB_TBL="wlib_test2" ICO="" USER="root" GRP="UI" PERMIT="436"/>
		</tbl>
		<tbl id="wlib_test2">
		    <fld ID="test2" ICO="" PARENT="/wlb_originals/wdg_Box" PROC="" PROC_ru="" PROC_uk="" PROC_PER="-1" USER="root" GRP="UI" PERMIT="436"/>
		</tbl>
		<tbl id="wlib_test2_io">
		    <fld IDW="test2" ID="name" IO_VAL="Test 2" IO_VAL_ru="Тест 2" IO_VAL_uk="Тест 2" SELF_FLG="" CFG_TMPL="" CFG_TMPL_ru="" CFG_TMPL_uk="" CFG_VAL=""/>
		    <fld IDW="test2" ID="dscr" IO_VAL="Test module 2" IO_VAL_ru="Тест модуля 2" IO_VAL_uk="Тест модуля 2" SELF_FLG="" CFG_TMPL="" CFG_TMPL_ru="" CFG_TMPL_uk="" CFG_VAL=""/>
		</tbl>
		<tbl id="PRJ">
		    <fld ID="test2" NAME="Test 2" NAME_ru="Тест 2" NAME_uk="Тест 2" DESCR="" DESCR_ru="" DESCR_uk="" DB_TBL="prj_test2" ICO="" USER="root" GRP="UI" PERMIT="436"/>
		</tbl>
		<tbl id="prj_test2">
		    <fld OWNER="/test2" ID="pg1" ICO="" PARENT="/wlb_originals/wdg_Box" PROC="" PROC_ru="" PROC_uk="" PROC_PER="-1" USER="root" GRP="UI" PERMIT="436" FLGS="1"/>
		    <fld OWNER="/test2/pg1" ID="pg2" ICO="" PARENT="/wlb_originals/wdg_Box" PROC="" PROC_ru="" PROC_uk="" PROC_PER="-1" USER="root" GRP="UI" PERMIT="436" FLGS="0"/>
		</tbl>
		<tbl id="prj_test2_incl">
		    <fld IDW="/prj_test2/pg_pg1" ID="wdg1" PARENT="/wlb_originals/wdg_Box"/>
		    </tbl>-->
		</node>
	</node>

	<node id="sub_Special">
	    <node id="mod_SystemTests">
		<prm id="PARAM" on="0" per="5" name="LogicLev.experiment.F3"/>
		<prm id="XML" on="0" per="10" file="/etc/oscada.xml"/>
		<prm id="MESS" on="0" per="10" categ="" arhtor="DBArch.test3"/>
		<prm id="SOAttDet" on="0" per="20" name="../../lib/openscada/daq_LogicLev.so" full="1"/>
		<prm id="Val" on="0" per="1" name="LogicLev.experiment.F3.var" arch_len="5" arch_per="1000000"/>
		<prm id="Val" on="0" per="1" name="System.AutoDA.CPULoad.load" arch_len="10" arch_per="1000000"/>
		<prm id="BD" on="0" per="10" type="MySQL" bd="server.diya.org;roman;123456;oscadaTest" table="test" size="1000"/>
		<prm id="BD" on="0" per="10" type="DBF" bd="./DATA/DBF" table="test.dbf" size="1000"/>
		<prm id="BD" on="0" per="10" type="SQLite" bd="./DATA/test.db" table="test" size="1000"/>
		<prm id="BD" on="0" per="10" type="FireBird" bd="server.diya.org:/var/tmp/test.fdb;roman;123456" table="test" size="1000"/>
		<prm id="TrOut" on="0" per="1" addr="TCP:127.0.0.1:10001" type="Sockets" req="time"/>
		<prm id="TrOut" on="0" per="1" addr="UDP:127.0.0.1:10001" type="Sockets" req="time"/>
		<prm id="TrOut" on="0" per="1" addr="UNIX:./oscada" type="Sockets" req="time"/>
		<prm id="TrOut" on="0" per="1" addr="UDP:127.0.0.1:daytime" type="Sockets" req="time"/>
		<prm id="Func" on="0" per="10"/>
		<prm id="SysContrLang" on="0" per="10" path="/Archive/FSArch/mess_StatErrors/%2fprm%2fst"/>
		<prm id="ValBuf" on="0" per="5"/>
		<prm id="Archive" on="0" per="30" arch="test1" period="1000000"/>
		<prm id="Base64Code" on="0" per="10"/>
	    </node>
	</node>
  </station>

</OpenSCADA>
