<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html class="client-nojs" dir="ltr" lang="en">
<head>
<meta charset="UTF-8" />
<title>Модули/Собственный Системный Протокол - OpenSCADAWiki</title>
<meta content="MediaWiki 1.26.4" name="generator" />
<link href="https://www.gnu.org/copyleft/fdl.html" rel="copyright" />
<link href="../../en/files/doc.css" rel="stylesheet" /></head>
<body><div class="floatright"><a href="../index.html"><img alt="OpenSCADA" src="../../en/files/index.png" /></a></div><div id="mw_header">
			<div class="mw-indicators">
</div>
			<h1 id="firstHeading" lang="ru">Модули/Собственный Системный Протокол</h1>
		</div><div class="mw-content-ltr" dir="ltr" id="mw-content-text" lang="ru"><div class="mw-pt-translate-header noprint" dir="ltr" lang="en">This page is a <span class="plainlinks"><a class="external text" href="http://oscada.org/wiki/index.php?title=Special:Translate&amp;group=page-Modules%2FSelfSystem&amp;action=page&amp;filter=&amp;language=ru" rel="nofollow noreferrer noopener" target="_blank">translated version</a></span> of the page <a class="external" href="http://oscada.org/wiki/Modules/SelfSystem" title="Modules/SelfSystem">Modules/SelfSystem</a> and the translation is 54% complete.</div><hr /><div class="mw-pt-languages" dir="ltr" lang="en"><div class="mw-pt-languages-list autonym"><a class="mw-pt-languages-ui mw-pt-progress mw-pt-progress--complete" href="../../en/Modules/SelfSystem.html" title="Modules/SelfSystem (100% translated)">English</a>&nbsp;• ‎<span class="mw-pt-languages-selected mw-pt-progress mw-pt-progress--med">mRussian</span>&nbsp;• ‎<a class="mw-pt-progress mw-pt-progress--complete" href="../../uk/Modules/SelfSystem.html" title="Модулі/Власний Системний Протокол (100% translated)">Українська</a></div></div>
<table class="wikitable">

<tr>
<th> Модуль </th>
<th> Имя </th>
<th> Версия </th>
<th> Лицензия </th>
<th> Источник </th>
<th> Языки </th>
<th> Платформы </th>
<th> Тип </th>
<th> Автор </th>
<th> Описание
</th></tr>

<tr>
<td> <a href="../Modules/SelfSystem.html" title="Special:MyLanguage/Modules/SelfSystem">SelfSystem</a> </td>
<td> Собственный протокол OpenSCADA
</td>
<td> 2.0 </td>
<td> GPL2 </td>
<td> prot_SelfSystem.so </td>
<td> en,uk,ru,de </td>
<td> x86,x86_64,ARM
</td>
<td> Протокол </td>
<td> Роман Савоченко </td>
<td> Предоставляет cобственный протокол OpenSCADA основанный на XML и интерфейсе управления OpenSCADA.
</td></tr></table>
<p>Модуль предназначен для отражения интерфейса управления OpenSCADA в сеть, с целью предоставления возможности внешним системам взаимодействовать с OpenSCADA, а также для взаимодействия между собой станций, построенных на основе OpenSCADA.
</p><p>Первым опытом использования функций данного модуля стала поддержка возможности удалённой конфигурации одной OpenSCADA станции из другой, через сеть и посредством модуля конфигурации <a href="../Modules/QTCfg.html" title="Special:MyLanguage/Modules/QTCfg">QTCfg</a>.
</p>
<div class="toc" id="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#The_syntax_of_the_protocol"><span class="tocnumber">1</span> <span class="toctext">The syntax of the protocol</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Internal_structure_of_the_output_protocol"><span class="tocnumber">2</span> <span class="toctext">Internal structure of the output protocol</span></a></li>
</ul>
</div>

<h2><span class="mw-headline" id="The_syntax_of_the_protocol"><span class="mw-headline-number">1</span> The syntax of the protocol</span></h2>
<p>The protocol is based on the "Request-Answer" method. The queries and their structure are given in the followed Table.
</p>
<table class="wikitable">
<caption> Structure of the request.
</caption>
<tr>
<th> Requests
</th></tr>
<tr>
<td>
<p><b>REQ:</b> "SES_OPEN {user} {password}\n"<br />
<b>REZ OK:</b> "REZ 0 {ses_id}\n"<br />
<b>REZ ERR:</b> "REZ 1 Error authentication: wrong user or password.\n"<br />
Request to open a session from the username <i>user</i> with the <i>password</i>. In case of success, the session ID will be received, otherwise, the code and the error message.
</p>
</td></tr>
<tr>
<td>
<p><b>REQ:</b> "SES_CLOSE {ses_id}\n"<br />
<b>REZ:</b> "REZ 0\n"<br />
Closure of the session. The result is always successful.
</p>
</td></tr>
<tr>
<td>
<p><b>REQ:</b> "REQ {ses_id} {req_size}\n{command of the control interface}"<br />
<b>REQ:</b> "REQDIR {user} {password} {req_size}\n{command of the control interface}"<br />
<b>REZ OK:</b> "REZ 0 {rez_size}\n{result of the command of the control interface}"<br />
<b>REZ ERR:</b> "REZ 1 Error authentication: session is not valid.\n"<br />
<b>REZ ERR:</b> "REZ 2 {error of the control interface}"<br />
Basic queries — session and direct ones. Implemented by sending a standard command of the <a href="../../en/API.html#CntrNode" title="Special:MyLanguage/Documents/API">OpenSCADA Control Interface</a> in the <i>command of the control interface</i> field. The result will be the response of the Control Interface <i>result of the command of the control interface</i> or one of the errors.
</p>
</td></tr>
<tr>
<td>
<p><b>REQ:</b> "{Error sequence}"<br />
<b>REZ ERR:</b> "REZ 3 Error the command format.\n"<br />
Any invalid request.
</p>
</td></tr></table>
<p>The protocol supports the ability of the traffic compression. Only the Control Interface data <i>command of the control interface</i> and <i>result of the command of the control interface</i> are compressed. The fact of receipt of a compressed request or response is determined by the negative value of the <i>req_size</i> or the <i>rez_size</i> response. You can define the compression options on the configuration page of the module (Fig. 1). Response of the protocol input part is forced to the compression with level -1 (that is optimal) at the compressed requests.
</p><p><a class="image" href="http://oscada.org/wiki/File:At.png"><img alt="At.png" height="22" src="../../en/files/At.png" width="22" /></a> All those parameters can be configured individually for the transport, due to the module is first one supports configuration of the external sources in additional parameters of the transports.
</p>
<div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:783px;"><a class="image" href="http://oscada.org/wiki/File:SelfSystem_compr.png"><img class="thumbimage" height="491" src="../../en/files/SelfSystem_compr.png" width="781" /></a>  <div class="thumbcaption">Рис.1. Главная вкладка страницы конфигурации параметров модуля.</div></div></div></div>
<p>On this tab, you can:
</p>
<ul><li> Familiarize the active authentication sessions.</li>
<li> Specify life time of the authentication sessions, in minutes.</li>
<li> Specify a connection limit for one user from one host.</li>
<li> Specify the compression level and lower limit. Where range of the compression level is from 0 to 9 (0 - disable the compression, -1 - optimal compression level in performance and quality) and the lower limit is a threshold for the compression using and turning its off at small requests.</li></ul>
<h2><span class="mw-headline" id="Internal_structure_of_the_output_protocol"><span class="mw-headline-number">2</span> Internal structure of the output protocol</span></h2>
<p>The internal structure is formed by the XML tree of the requests of the language <a class="external" href="http://oscada.org/wiki/Documents/API#CntrNode" title="Documents/API">OpenSCADA control interface</a> with the reservation of the additional service attributes of the protocol in the root tag:
</p>
<dl><dd><i>rqDir</i> — sign of the message sending through passing the procedure of the session opening (0-open session, 1-send immediately);</dd>
<dd><i>rqUser</i> — user;</dd>
<dd><i>rqPass</i> — password;</dd>
<dd><i>rqAuthForce</i> — force authentication update;</dd>
<dd><i>conTm</i> — force connection timeout, in milliseconds.</dd></dl>
<p>Результатом запроса также является XML дерево языка интерфейса управления OpenSCADA.
</p>





</div><table style="border-top: dotted 2px #999999; margin-top: 20pt; color: gray;" width="100%"><tr><td style="text-align: left;" width="40%"><a href="http://oscada.org/wiki/Modules/SelfSystem/ru">Modules/SelfSystem/ru</a> - <a href="http://oscada.org/en/main/about-the-project/licenses/">GFDL</a></td><td style="text-align: center;">April 2025</td><td style="text-align: right;" width="40%">OpenSCADA 1+r3018</td></tr></table></body>
</html>