From OpenSCADAWiki
Jump to: navigation, search
(Updating to match new version of source page)
Line 20: Line 20:
 
Протокол построен по методу "Запрос-Ответ". Запросы и их структура сведены в таблице 1.
 
Протокол построен по методу "Запрос-Ответ". Запросы и их структура сведены в таблице 1.
  
'''Table 1''' Structure of the request.
+
'''Таблица 1''' Структура запроса.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Requests
+
! Запросы
 
|-
 
|-
 
|
 
|
Line 29: Line 29:
 
'''REZ OK:''' "REZ 0 {ses_id}\n"<br/>
 
'''REZ OK:''' "REZ 0 {ses_id}\n"<br/>
 
'''REZ ERR:''' "REZ 1 Error authentication: wrong user or password.\n"<br/>
 
'''REZ ERR:''' "REZ 1 Error authentication: wrong user or password.\n"<br/>
Request to open a session from the username ''user'' with the ''password''. In case of success, the session ID will be received, otherwise, the code and the error message.
+
Запрос на открытие сеанса от имени пользователя ''user'' с паролем ''password''. В случае успеха будет получен идентификатор сеанса, иначе — код и сообщение об ошибке.
 
|-
 
|-
 
|
 
|
 
'''REQ:''' "SES_CLOSE {ses_id}\n"<br/>
 
'''REQ:''' "SES_CLOSE {ses_id}\n"<br/>
 
'''REZ:''' "REZ 0\n"<br/>
 
'''REZ:''' "REZ 0\n"<br/>
Closure of the session. The result is always successful.
+
Закрытие сеанса. Результат всегда успешен.
 
|-
 
|-
 
|
 
|
Line 42: Line 42:
 
'''REZ ERR:''' "REZ 1 Error authentication: session is not valid.\n"<br/>
 
'''REZ ERR:''' "REZ 1 Error authentication: session is not valid.\n"<br/>
 
'''REZ ERR:''' "REZ 2 {error of the control interface}"<br/>
 
'''REZ ERR:''' "REZ 2 {error of the control interface}"<br/>
Basic queries session and direct ones. Implemented by sending a standard command of the [[Special:MyLanguage/Documents/API#CntrNode|OpenSCADA Control Interface]] in the ''command of the control interface'' field. The result will be the response of the Control Interface ''result of the command of the control interface'' or one of the errors.
+
Основные запросы сеансовый и прямой. Реализуются путём отправки стандартной команды [[Special:MyLanguage/Documents/API#CntrNode|Интерфейса Управления OpenSCADA]] в поле ''command of the control interface''. В результате будет получен ответ Интерфейса Управления ''result of the command of the control interface'' или одна из ошибок.
 
|-
 
|-
 
|
 
|
'''REQ:''' "{Error sequence}"<br/>
+
'''REQ:''' "{Ошибочная последовательность}"<br/>
 
'''REZ ERR:''' "REZ 3 Error the command format.\n"<br/>
 
'''REZ ERR:''' "REZ 3 Error the command format.\n"<br/>
Any invalid request.
+
Любой некорректный запрос.
 
|}
 
|}
  

Revision as of 09:40, 7 May 2023

Other languages:
English • ‎mRussian • ‎Українська
Модуль Имя Версия Лицензия Источник Языки Платформы Тип Автор Описание
SelfSystem Собственный протокол OpenSCADA 1.10 GPL2 prot_SelfSystem.so en,uk,ru,de x86,x86_64,ARM Протокол Роман Савоченко Предоставляет cобственный протокол OpenSCADA основанный на XML и интерфейсе управления OpenSCADA.

Модуль предназначен для отражения интерфейса управления OpenSCADA в сеть, с целью предоставления возможности внешним системам взаимодействовать с OpenSCADA, а также для взаимодействия между собой станций, построенных на основе OpenSCADA.

Первым опытом использования функций данного модуля стала поддержка возможности удалённой конфигурации одной OpenSCADA станции из другой, через сеть и посредством модуля конфигурации QTCfg.

1 Синтаксис протокола

Протокол построен по методу "Запрос-Ответ". Запросы и их структура сведены в таблице 1.

Таблица 1 Структура запроса.

Запросы

REQ: "SES_OPEN {user} {password}\n"
REZ OK: "REZ 0 {ses_id}\n"
REZ ERR: "REZ 1 Error authentication: wrong user or password.\n"
Запрос на открытие сеанса от имени пользователя user с паролем password. В случае успеха будет получен идентификатор сеанса, иначе — код и сообщение об ошибке.

REQ: "SES_CLOSE {ses_id}\n"
REZ: "REZ 0\n"
Закрытие сеанса. Результат всегда успешен.

REQ: "REQ {ses_id} {req_size}\n{command of the control interface}"
REQ: "REQDIR {user} {password} {req_size}\n{command of the control interface}"
REZ OK: "REZ 0 {rez_size}\n{result of the command of the control interface}"
REZ ERR: "REZ 1 Error authentication: session is not valid.\n"
REZ ERR: "REZ 2 {error of the control interface}"
Основные запросы — сеансовый и прямой. Реализуются путём отправки стандартной команды Интерфейса Управления OpenSCADA в поле command of the control interface. В результате будет получен ответ Интерфейса Управления result of the command of the control interface или одна из ошибок.

REQ: "{Ошибочная последовательность}"
REZ ERR: "REZ 3 Error the command format.\n"
Любой некорректный запрос.

The protocol supports the ability of the traffic compression. Only the Control Interface data command of the control interface and result of the command of the control interface are compressed. The fact of receipt of a compressed request or response is determined by the negative value of the req_size or the rez_size 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.

Рис.1. Главная вкладка страницы конфигурации параметров модуля.

On this tab, you can:

  • Familiarize the active authentication sessions.
  • Specify life time of the authentication sessions, in minutes.
  • Specify a connection limit for one user from one host.
  • 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.

2 Внутренняя структура исходящего протокола

Внутренняя структура формируется деревом XML запросов языка интерфейса управления OpenSCADA с резервированием дополнительных служебных атрибутов протокола в корневом теге:

rqDir — признак отправки сообщения минуя процедуру открытия сеанса (0-открывать сеанс, 1-отсылать сразу);
rqUser — пользователь;
rqPass — пароль;
rqAuthForce — принудительно обновить аутентификацию;
rqSeq — последовательность запроса;
conTm — принудительный таймаут подключения.

Результатом запроса также является XML дерево языка интерфейса управления OpenSCADA.