<?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>Modules/SelfSystem - OpenSCADAWiki</title>
<meta content="MediaWiki 1.26.4" name="generator" />
<link href="https://www.gnu.org/copyleft/fdl.html" rel="copyright" />
<link href="../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="en">Modules/SelfSystem</h1>
		</div><div class="mw-content-ltr" dir="ltr" id="mw-content-text" lang="en"><div class="mw-pt-languages" dir="ltr" lang="en"><div class="mw-pt-languages-list autonym"><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete">English</span>&nbsp;• ‎<a class="mw-pt-progress mw-pt-progress--med" href="../../ru/Modules/SelfSystem.html" title="Модули/Собственный Системный Протокол (54% translated)">mRussian</a>&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> Module </th>
<th> Name </th>
<th> Version </th>
<th> License </th>
<th> Source </th>
<th> Languages </th>
<th> Platforms </th>
<th> Type </th>
<th> Author </th>
<th> Description
</th></tr>

<tr>
<td> <a href="../Modules/SelfSystem.html" title="Special:MyLanguage/Modules/SelfSystem">SelfSystem</a> </td>
<td> Own protocol of 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> Protocol </td>
<td> Roman Savochenko<br />&nbsp;&nbsp;<font size="-2"><i>Maxim Lysenko (2012) — the page initial translation</i></font> </td>
<td> Provides own OpenSCADA protocol based at XML and the control interface of OpenSCADA.
</td></tr></table>
<p>The module is intended to reflect the OpenSCADA control interface to the network, in order to allow external systems to interact with OpenSCADA, as well as to interact with each other stations built on the basis of OpenSCADA.
</p><p>The first experience with using this module's functionality was to support remote configuration of one OpenSCADA station from another, through the network and via the configuration module <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="../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="../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="../files/SelfSystem_compr.png" width="781" /></a>  <div class="thumbcaption">Fig.1. Main tab of the configuration page of the module parameters.</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>The result of the request is the XML tree of language of the OpenSCADA control interface.
</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/en">Modules/SelfSystem/en</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>