From OpenSCADAWiki
Jump to: navigation, search

Service commands-functions of the Control Interface

Service functions are an interface for accessing OpenSCADA from external systems through the Control Interface. This mechanism is the basis of all exchange within OpenSCADA, implemented through weak links and OpenSCADA's own exchange protocol.

The common widgets

Getting for values of specified or all visual attributes of the widget
REQ: <get path="/UI/VCAEngine/{wAddr}/%2fserv%2fattr">{attributes}</get>
  • wAddr — the widget local address, like to "/wlb_AGLKS/wdg_CM101/wdg_ElFigure1";
  • attributes — the only requested attributes in the tags "el" with only one attribute of the identifier "id"; there can be no the attribute tags for requesting all available ones.
RESP: <get path="/UI/VCAEngine/{wAddr}/%2fserv%2fattr" rez="0">{attributes}</get>
  • attributes — processed attributes in the tags "el": <el id="{ID}" p="{pos}" act="{active}">{value}</el>
    • ID — identifier of the attribute;
    • pos — position-index of the attribute for the standard ones;
    • active — activity state of the attribute, only at the direct requesting;
    • value — value of the attribute.
<get path="/UI/VCAEngine/wlb_AGLKS/wdg_CM101/wdg_ElFigure1/%2fserv%2fattr" rez="0" user="roman">
  <el id="id">ElFigure1</el>
  <el id="path">/wlb_AGLKS/wdg_CM101/wdg_ElFigure1</el>
  <el id="parent">/wlb_originals/wdg_ElFigure</el>
  <el id="owner">root:UI</el>
  <el id="perm">948</el>
  <el id="root" p="1">ElFigure</el>
  <el id="name" />
  <el id="dscr" />
</get>
Setting for group values of the specified widget attributes
REQ[root-UI]: <set path="/UI/VCAEngine/{wAddr}/%2fserv%2fattr">{attributes}</set>
  • wAddr — the widget local address in the module, like to "/wlb_AGLKS/wdg_CM101/wdg_ElFigure1";
  • attributes — attributes with values in the tags "el": <el id="{ID}">{value}</el>
    • ID — identifier of the attribute;
    • value — setting value of the attribute.
<set path="/UI/VCAEngine/wlb_AGLKS/wdg_CM101/wdg_ElFigure1/%2fserv%2fattr">
  <el id="name">New name</el>
  <el id="dscr">New description</el>
</set>
Getting for values of the visual attributes of the widget branch, optimised for the networks
REQ: <get path="/UI/VCAEngine/{wAddr}/%2fserv%2fattrBr" />
  • wAddr — the widget local address in the module, like to "/wlb_AGLKS/wdg_CM101/wdg_ElFigure1".
RESP: <get path="/UI/VCAEngine/{wAddr}/%2fserv%2fattrBr" rez="0">{attributes} {widgets}</get>
  • attributes — processed attributes in the tags "el": <el id="{ID}" p="{pos}">{value}</el>
    • ID — identifier of the attribute;
    • pos — position-index of the attribute for the standard ones;
    • value — value of the attribute.
  • widgets — child widgets in the tags "w": <w id="{ID}" lnkPath="{lnkPath}">{attributes} {widgets}</w>
    • ID — identifier of the widget;
    • lnkPath — path to the linked widget for child widgets of the widget libraries.
<get path="/UI/VCAEngine/wlb_AGLKS/wdg_CM101/%2fserv%2fattrBr" rez="0" user="roman">
  <el id="id">CM101</el>
  <el id="path">/wlb_AGLKS/wdg_CM101</el>
  <el id="parent">/wlb_originals/wdg_Box</el>
  <el id="owner">root:UI</el>
  <el id="perm">948</el>
  <el id="root" p="1">Box</el>
  <el id="name">CM101</el>
  <w id="AT101_1" lnkPath="/wlb_mnEls/wdg_cooler">
    <el id="id">AT101_1</el>
    <el id="path">/wlb_AGLKS/wdg_CM101/wdg_AT101_1</el>
    <el id="parent">/wlb_mnEls/wdg_cooler</el>
    <el id="owner">root:UI</el>
    <el id="perm">948</el>
    <el id="root" p="1">ElFigure</el>
    <el id="name">АТ101 1</el>
  </w>
</get>

The widget libraries

Obtaining the widget libraries' tree, optimised for the networks
REQ: <get path="/UI/VCAEngine/%2fserv%2fwlbBr" item="{item}" disIconsW="{disIconsW}" disIconsCW="{disIconsCW}" />
  • item — the library item for obtaining, as the path "wlb_{WLib}[/wdg_{Wdg}[/wdg_{ChildWdg}]]", for empty there will be obtained all the tree;
  • disIconsW — disable for obtaining the icon data of the widgets [0|1];
  • disIconsCW — disable for obtaining the icon data of the child widgets [0|1].
RESP: <get path="/UI/VCAEngine/%2fserv%2fwlbBr" item="{item}" disIconsW="{disIconsW}" disIconsCW="{disIconsCW}" rez="0">{wlibs}</get>
  • wlibs — the widget libraries in the "wlb" tags: <wlb id="{ID}" doc="{doc}">{name} {icon} {widgets}</wlb>
    • icon — the "icon" tag with the Base64 encoded data of the icon;
    • widgets — the "w" tags with the library widgets description: <w id="{ID}" doc="{doc}" parent="{parent}">{name} {icon} {widgets}</w>
      • parent — address of the widget parent;
      • widgets — the "сw" tags with the child widgets description: <cw id="{ID}" doc="{doc}">{name} {icon}</cw>
<get disIconsCW="1" disIconsW="1" item="/wlb_AGLKS" path="/UI/VCAEngine/%2fserv%2fwlbBr" rez="0" user="roman">
  <wlb id="AGLKS">AGLKS
    <ico>iVBORw0KGgoAA...U5ErkJggg==</ico>
    <w id="CM101" parent="/wlb_originals/wdg_Box">CM101
      <cw id="AT101_1">АТ101 1</cw>
      <cw id="AT101_2">АТ101 1</cw>
      <cw id="C101_1">C101/1</cw>
      <cw id="C101_2">C101/1</cw>
      <cw id="C101_3">C101/1</cw>
      <cw id="CM101">CM101</cw>
      <cw id="CM101_1">CM101_1</cw>
      <cw id="CM101_2">CM101_2</cw>
      <cw id="ElFigure1">ElFigure1</cw>
      <cw id="ElFigure2">ElFigure2</cw>
      <cw id="ElFigure3">ElFigure3</cw>
      <cw id="ElFigure4">ElFigure4</cw>
      <cw id="ElFigure5">ElFigure5</cw>
      <cw id="ElFigure6">ElFigure6</cw>
      <cw id="ElFigure7">ElFigure7</cw>
    </w>
    <w id="KCH_MN1" parent="/wlb_originals/wdg_Box">KCH_MN1
      <cw id="BC1">Ball crane</cw>
      <cw id="BC2">Ball crane</cw>
      <cw id="BC21">Ball crane</cw>
      <cw id="BC22">Ball crane</cw>
    </w>
    <w id="comprEn" parent="/wlb_originals/wdg_ElFigure">Compressor run</w>
  </wlb>
</get>

The VCA projects

Obtaining the project list expanded by some options
REQ: <get path="/UI/VCAEngine/[%2fbr%2fprj_|%2fprm%2fcfg%2fprj]" chkUserPerm="{chkUserPerm}" getChPgN="{getChPgN}" noName="{noName}" />
  • chkUserPerm — checking for the user permition before listing [0|1];
  • getChPgN — requesting for quantity of the child pages in the projects [0|1];
  • noName — do not return for names of the pages [0|1].
RESP: <get path="/UI/VCAEngine/[%2fbr%2fprj_|%2fprm%2fcfg%2fprj]" chkUserPerm="{chkUserPerm}" getChPgN="{getChPgN}" noName="{noName}" rez="0">{projects}</get>
  • projects — projects list in the tags "el", where the name is in the tag text and the identifier in the attribute "id". Expanded by the extra attributes:
    • "chPgN" — quantity of the child pages in the project at setting "getChPgN".
<get getChPgN="1" path="/UI/VCAEngine/%2fbr%2fprj_" rez="0" user="roman">
  <el chPgN="2" id="AGLKS">AGLKS</el>
  <el chPgN="2" id="archBrowser">Archives browser</el>
  <el chPgN="2" id="tmplSO">Signal groups (template)</el>
</get>
Checking for read access to the project from the user of the request
REQ: <read path="/UI/VCAEngine/prj_{proj}/%2fserv%2faccess" />
  • proj — identifier of the project.
RESP: <read path="/UI/VCAEngine/prj_{proj}/%2fserv%2faccess" rez="0">{access}</get>
  • access — the access presence status [0|1].

</translate>

<read path="/UI/VCAEngine/prj_AGLKS/%2fserv%2faccess" rez="0" user="roman">1</read>

<translate> The project sessions

Obtaining the session list expanded by some options
REQ: <get path="/UI/VCAEngine/[%2fbr%2fses_|%2fses%2fses]" chkUserPerm="{chkUserPerm}" onlyMy="{onlyMy}" />
  • chkUserPerm — checking for the user permition before listing [0|1];
  • onlyMy — listening only my own sessions [0|1].
RESP: <get path="/UI/VCAEngine/[%2fbr%2fses_|%2fses%2fses]" chkUserPerm="{chkUserPerm}" onlyMy="{onlyMy}" rez="0">{sessions}</get>
  • sessions — sessions list in the tags "el", where the identifier is in the tag text. Expanded by the extra attributes:
    • "user" — user of the session;
    • "proj" — project of the session.

</translate>

<get path="/UI/VCAEngine/%2fses%2fses" rez="0" onlyMy="1" user="roman">
  <el user="roman" proj="AGLKS">AGLKS</el>
  <el user="roman" proj="AGLKS">AGLKS0</el>
</get>

<translate>

Obtaining the sessions list of the specified VCA project
REQ: <list path="/UI/VCAEngine/%2fserv%2fsess" prj="{project}" />
  • project — identifier of the requested project.
RESP: <list path="/UI/VCAEngine/%2fserv%2fsess" prj="{project}" rez="0">{sessions}</list>
  • sessions — sessions in the "el" tags.
<list path="/UI/VCAEngine/%2fserv%2fsess" prj="AGLKS" rez="0" user="roman">
  <el>AGLKS</el>
</list>
Connection to the specified VCA project or the project session
REQ: <connect path="/UI/VCAEngine/%2fserv%2fsess" prj="{project}" sess="{session}" userChange="{userChange}" onlyMy="{onlyMy}" />
  • project — identifier of the requested project, empty for connection to the available session;
  • session — identifier of the already present session, empty at a new session creation;
  • onlyMy — sign of connection-reconnection to the session only when it is my;
  • userChange — sign of the user changing [0|1] of the session, that is updation the user information.
RESP: <connect path="/UI/VCAEngine/%2fserv%2fsess" prj="{project}" sess="{session}" userChange="{userChange}" onlyMy="{onlyMy}" rez="0" conId="{conId}" userIsRoot="{userIsRoot}" />
  • conId — the session connection identifier, used in next requests;
  • project — the project identifier of the successfully connected session;
  • session — identifier of the new created session of the successfully connected project;
  • userIsRoot — the user has the root permition [0|1].

</translate>

<connect conId="50860885" path="/UI/VCAEngine/%2fserv%2fsess" prj="AGLKS" rez="0" sess="AGLKS" user="roman" userIsRoot="1" />

<translate>

Disconnection the specified VCA project session
Sessions with zero connections are closed here also.
REQ: <disconnect path="/UI/VCAEngine/%2fserv%2fsess" sess="{session}" conId="{conId}" />
  • session — identifier of the present session;
  • conId — the session connection identifier.
<disconnect path="/UI/VCAEngine/%2fserv%2fsess" sess="AGLKS" conId="50860885" />
Getting for the opened pages list of the project session
REQ[{owner}-{grp}]: <openlist path="/UI/VCAEngine/ses_{session}/%2fserv%2fpg" conId="{conId}" tm="{clock}" />
  • owner, grp — reading access for the project owner or a user in group and regarding to the project permissions;
  • session — identifier of the session;
  • conId — the session connection identifier;
  • clock — the internal clock (the live cycle) value from the previous processed request, for checking of the changed ones.
RESP: <openlist path="/UI/VCAEngine/ses_{session}/%2fserv%2fpg" conId="{conId}" tm="{clock}" rez="0">{pages}</openlist>
  • clock — the internal clock (the live cycle) value - 1 at the request time;
  • pages — pages in the tags "pg": <pg pgGrp="{pgGrp}" updWdg="{nUpdWdgs}">{ID}</pg>
    • ID — identifier of the page;
    • pgGrp — the pages group for early calculation the page including;
    • nUpdWdgs — quantity of the updated widgets after the last request and for not empty "clock".

</translate>

<openlist conId="52760577" path="/UI/VCAEngine/ses_AGLKS/%2fserv%2fpg" rez="0" tm="1403" user="roman">
  <pg>/ses_AGLKS/pg_so</pg>
  <pg pgGrp="so">/ses_AGLKS/pg_so/pg_1/pg_mn/pg_1</pg>
  <pg pgGrp="cntr">/ses_AGLKS/pg_control/pg_ElCadr</pg>
</openlist>

<translate>

Opening or closing for the specified page of the project session
REQ[{owner}-{grp}]: <[open|close] path="/UI/VCAEngine/ses_{session}/%2fserv%2fpg" pg="{page}" />
  • owner, grp — writing access for the project owner or a user in group and regarding to the project permissions;
  • session — identifier of the session;
  • page — address of the page in the session context, like to "/ses_AGLKS/pg_so/pg_1/pg_mn/pg_1".
Getting for the alarm status and the notification resource of the project session
REQ[{owner}-{grp}]: <get path="/UI/VCAEngine/ses_{session}/%2fserv%2falarm" mode="{mode}" tp="{typeNtf}" wdg="{widget}" />
  • owner, grp — reading access for the project owner or a user in group and regarding to the project permissions;
  • session — identifier of the session;
  • mode — the requesting mode, only "resource" for obtaining the notification resources and empty for the status only;
  • typeNtf — the notification type of obtaining the notification resource, see the alarming section;
  • widget — address of the widget for forming the notification resource, empty for global.
RESP: <get path="/UI/VCAEngine/ses_{session}/%2fserv%2falarm" mode="{mode}" tp="{typeNtf}" rez="0" alarmSt="{alarmSt}" tm="{clock}" wdg="{widget}" resTp="{resTp}" mess="{message}" lang="{language}">{resource}</get>
  • alarmSt — the alarm status as that described in the alarming section;
  • clock — the internal clock (the live cycle) value at the notification resource form;
  • widget — address of the source widget at the notification resource form;
  • message — message of notification from the text;
  • language — language of the notification, for the "message" mostly;
  • resTp — type of the notification resource;
  • resource — resource of the notification encoded by Base64 for the binary data.
<get path="/UI/VCAEngine/ses_AGLKS/%2fserv%2falarm" mode="resource" tp="1" rez="0" user="roman"
     alarmSt="460554" tm="0" resTp="audio/ogg;73.3428" lang="en_US.UTF-8">
T2dnUwACA...Dg6gwAjo+PAQ==
</get>
Quietance of the alarm notification of the project session
REQ[{owner}-{grp}]: <quietance path="/UI/VCAEngine/ses_{session}/%2fserv%2falarm" wdg="{widget}" tmpl="{template}" ret="{return}" />
  • owner, grp — reading access for the project owner or a user in group and regarding to the project permissions;
  • session — identifier of the session;
  • widget — address of the widget for quietance the notification, empty for global;
  • template — template of the quietance, that is bitset corresponding to the quieting notification types;
  • return — sign of the notification return, that is the quietance disabling.
<quietance path="/UI/VCAEngine/ses_AGLKS/%2fserv%2falarm" tmpl="7" />
Getting for values of the modified visual attributes of the session widget
Redefines the common service request of the widgets "<get path='/UI/VCAEngine/{wAddr}/%2fserv%2fattr' />" for the session specific.
REQ: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattr" tm="{clock}" />
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • clock — the internal clock (the live cycle) value from the previous processed request, for checking of the changed ones; at zero value there force appended the service-virtual attributes: "perm", "name".
RESP: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattr" tm="{clock}" rez="0">{attributes}</get>
  • attributes — modified from "clock" attributes in the tags "el": <el id="{ID}" p="{pos}">{value}</el>
    • ID — identifier of the attribute;
    • pos — position-index of the attribute for the standard ones;
    • value — value of the attribute.
<get path="/UI/VCAEngine/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1/%2fserv%2fattr" rez="0" tm="0" user="roman">
  <el id="perm" p="-3">6</el>
  <el id="root" p="1">ElFigure</el>
  <el id="en" p="5">1</el>
  <el id="active" p="6">0</el>
  <el id="geomX" p="7">488</el>
  <el id="geomY" p="8">250</el>
  <el id="geomW" p="9">16</el>
  <el id="geomH" p="10">100</el>
  <el id="geomXsc" p="13">1</el>
  <el id="geomYsc" p="14">0.75</el>
  <el id="geomZ" p="11">-9</el>
</get>
Setting for group values of the specified attributes of the session widget
Redefines the common service request of the widgets "<set path='/UI/VCAEngine/{wAddr}/%2fserv%2fattr' />" for the session specific like to the "event" attribute processing and detection the user activity-inactivity.
REQ[{owner}-{grp}]: <set path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattr" noUser="{noUser}">{attributes}</set>
  • owner, grp — writing access for the project owner or a user in group and regarding to the project permissions;
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • noUser — don't mark that as a user activity;
  • attributes — attributes with values in the tags "el": <el id="{ID}">{value}</el>
    • ID — identifier of the attribute;
    • value — setting value of the attribute.
<set path="/UI/VCAEngine/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1/%2fserv%2fattr">
  <el id="name">New name</el>
  <el id="dscr">New description</el>
</set>
Activating the attribute for using as the visual one and creating that at missing
REQ: <activate path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattr%2f{aID}" aNm="{aName}" aTp="{aType}" aFlg="{aFlags}" aVls="{aValues}" aNms="{aNames}">{aDef}</activate>
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • aID — identifier of the attribute;
  • aName — name of the attribute at it creation;
  • aType — type of the attribute at it creation, see to the object TFld;
  • aFlags — flags of the attribute at it creation, see to the object TFld;
  • aDef — default value of the attribute at it creation;
  • aValues — the attribute values for the selective types at it creation;
  • aNames — names to values of the attribute for the selective types at it creation.
<activate path="/UI/VCAEngine/ses_AGLKS/pg_so/%2fserv%2fattr%2frunWin" aNm="Run window" aTp="1" aFlg="1" aVls="0;1;2" aNms="Original size;Maximize;Full screen">0</activate>
Getting for values of the visual attributes of the widget branch of the session, optimised for the networks
Redefines the common service request of the widgets "<get path='/UI/VCAEngine/{wAddr}/%2fserv%2fattrBr' />" for the session specific.
REQ: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattrBr" tm="{clock}" FullTree="{FullTree}" />
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • clock — the internal clock (the live cycle) value from the previous processed request, for checking of the changed ones; at zero value there force appended the service-virtual attributes: "perm", "name";
  • fullTree — obtaining the full widgets tree independent from presence the changes, without the attributes.
RESP: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattrBr" tm="{clock}" FullTree="{FullTree}" rez="0">{attributes} {widgets}</get>
  • attributes — processed attributes in the tags "el": <el id="{ID}" p="{pos}">{value}</el>
    • ID — identifier of the attribute;
    • pos — position-index of the attribute for the standard ones;
    • value — value of the attribute.
  • widgets — child widgets in the tags "w": <w id="{ID}">{attributes} {widgets}</w>
    • ID — identifier of the widget.
<get path="/UI/VCAEngine/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/%2fserv%2fattrBr" rez="0" tm="0" user="roman">
  <el id="name" p="-4">CM101</el>
  <el id="perm" p="-3">6</el>
  <el id="root" p="1">Box</el>
  <el id="en" p="5">1</el>
  <el id="active" p="6">0</el>
  <el id="geomX" p="7">0</el>
  <el id="geomY" p="8">0</el>
  <el id="geomW" p="9">900</el>
  <el id="geomH" p="10">580</el>
  <w id="AT101_1">
    <el id="perm" p="-3">6</el>
    <el id="root" p="1">ElFigure</el>
    <el id="en" p="5">1</el>
    <el id="active" p="6">0</el>
    <el id="geomX" p="7">338</el>
    <el id="geomY" p="8">320</el>
    <el id="geomW" p="9">80</el>
    <el id="geomH" p="10">100</el>
  </w>
</get>
Getting for value of the session specific attribute of the session widget
REQ: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattrSess%2f{aID}" />
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • aID — identifier of the session specific attribute.
RESP: <get path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattrSess%2f{aID}" rez="0">{value}</get>
  • value — value of the attribute.
<get path="/UI/VCAEngine/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/%2fserv%2fattrSess%2ftestA" rez="0" user="roman">test val</get>
Setting for value of the session specific attribute of the session widget
REQ[{owner}-{grp}]: <set path="/UI/VCAEngine/ses_{wAddr}/%2fserv%2fattrSess%2f{aID}">{value}</get>
  • owner, grp — writing access for the project owner or a user in group and regarding to the project permissions;
  • wAddr — the session widget local address, like to "/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/wdg_ElFigure1";
  • aID — identifier of the session specific attribute;
  • value — value of the attribute.
<set path="/UI/VCAEngine/ses_AGLKS/pg_so/pg_2/pg_mn/pg_CM101/%2fserv%2fattrSess%2ftestA">test val</set>