OpenSCADAWiki: Home Page En/Doc/VC Aconcept/part4/part14 ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of HomePageEn/Doc/VCAconcept/part4/part14 from 2010-04-23 16:10:08..

4.13 API of the user programming and service interfaces of the OpenSCADA

4.13.1. API of the user programming

API of the user programming of the visualization engine are represented by the group of functions directly in the engine module of the VCA. Calling of these functions from the scripts of widgets can be performed directly by the ID of the function, since their area of names is indicated for the context of the scripts of widgets.


Widget list (WdgList)
Description: Returns a list of widgets in the container of widgets or a list of child widgets. If <pg> is set it returns a list of pages for projects and sessions.
Parameters:

ID Name Type Mode By default
list List String Return
addr Address String Input
pg Pages Bool Input 0

Presence of the node (NodePresent)
Description: Check for the presence of the node, including widgets, attributes and others.
Parameters:

ID Name Type Mode By default
rez Result Bool Return
addr Address String Input

Attributes list (AttrList)
Description: Returns list of attributes of the widget. If <noUser> is set then only not user attributes are returned.
Parameters:

ID Name Type Mode By default
list List String Return
addr Address String Input
noUser Without user Bool Input 1

Request of the attribute (AttrGet)
Description: Request of the value of the attribute of the widget. The request can be done as by indicating the full address of the attribute in <addr>, and by indicating separately the address of the widget in <addr>, and the ID of the attribute in the <attr>.
Parameters:

ID Name Type Mode By default
val Value String Return
addr Address String Input
attr Attribute Bool Input

Setting of the attribute (AttrSet)
Description: Setting of the value of the attribute of the widget. Setting can be done as by the indicating the full address of the attribute in <addr>, and by indicating separately the address of the widget in <addr>, and the ID of the attribute in <attr>.
Parameters:

ID Name Type Mode By default
addr Address String Input
val Value String Input
attr Attribute Bool Input

Session user (SesUser)
Description: Return session user by session's widget path.
Parameters:

ID Name Type Mode By default
user User String Return
addr Address String Input

4.13.2. Service interfaces of the OpenSCADA

Service interfaces are interfaces of access to the OpenSCADA system by means of интерфейса управления OpenSCADA from external systems. This mechanism - is the basis of all the mechanisms for sharing within OpenSCADA, implemented through weak ties, and standard exchange protocol of OpenSCADA.

Access to the values of attributes of the visualization elements (widgets)

In order to provide uniform, group, and relatively fast access to the values of attributes of the visual elements the service function of the visual element "/serv/attr" and get/set command of the attributes' values are provided: <get path="/UI/VCAEngine/{wdg_addr}/%2fserv%2fattr"/> and <set path="/UI/VCAEngine/{wdg_addr}/%2fserv%2fattr"/>. Attributes of these commands, which provide the various mechanisms of the request, are presented in the Table 4.13.2.a.


Table 4.13.2.a. Attributes of commands of get/set of the the attributes of visual elements

IdNameValue
Request command of the visual attributes of the widget: <get path="/UI/VCAEngine/{wdg_addr}/%2fserv%2fattr"/>
tm Time/counter of changes Time/counter of changes set up for the query of the only changed attributes.
<el id="{attr}" p="{a_id}">{val}</el> The formation of the child elements with the results of the attributes In the child element are specified: string ID {attr} of the attribute, index {a_id} of the attribute and its value {val}.
The set command of the visual attributes of the widget: <set path="/UI/VCAEngine/{wdg_addr}/%2fserv%2fattr"/>
<el id="{attr}">{val}</el> Set of the ettributes In the child elements the ID of the attribute {attr} and its value {val} are specified.
Group access to the values of attributes of the visualization elements (widgets)

In order to optimize network traffic by eliminating small queries, but use one, but a large the group query of the attributes' values of visual elements is made. Grouping of this query involves a request of attributes of the entire branch of the widget, including embedded elements. For this request the service command "/serv/attrBr". Request of this service command is equivalent to the service command "/serv/attr" and looks as follows:
<get path="/UI/VCAEngine/{wdg_addr}/%2fserv%2fattrBr"/>

tm - Time/counter of changes. Time/counter of changes set up for the query of the only changed attributes.

Result:

<el id="{attr}" p="{a_id}">{val}</el> - Elements with the results of the attributes. In the element are specified: string ID {attr} of the attribute, index {a_id} f the attribute and its value {val}.
<w id="{wid}" lnkPath="{lnk_path}">{childs+attrs}</w> - Elements with child widgets and their attributes. The identifier of the child widget {wid} and the path to the widget on which the current widget links to, if its is the link {lnk_path}, are specified in the element.
Access to the pages of the session

In order to unify and optimize the access to the pages the service function of the session "/serv/pg" and commands of the query of the list of open pages (<openlist path="/UI/VCAEngine/ses_{Session}/%2fserv%2fpg"/>); of opening the pages (<open path="/UI/VCAEngine/ses_{Session}/%2fserv%2fpg"/>); and closing of the pages <close path="/UI/VCAEngine/ses_{Session}/%2fserv%2fpg"/>) are provided.


The result of the query of the list of open pages are child elements <el>{OpPage}</el> which contain the full path of the open page. In addition to the list of open pages, the query returns the value of the current counter for calculating the session in the attribute <tm>. If this attribute is set during the query, then for each open page it is returned the list of changed, since the moment of the specified value of the counter, widgets of the open page.

Signaling (alarm) management

To provide a mechanism for global control of the signaling of the session the service function of the session "/serv/alarm" and commands of the query of the signals status (<get path="/UI/VCAEngine/ses_{Session}/%2fserv%2falarm"/>); and of the quittance (<quittance path="/UI/VCAEngine/ses_{Session}/%2fserv%2falarm"/>) are provided.


Request for the status of signals returns generalized condition of the signals, as well as additional information for the sound signaling. Additional information by sound signal is provided by the current resource, a sound file, for playback and it provides monitoring of the sequence of signaling and quittance of individual files of sound messages.


Request for the quittance performs quittance of the specified widget, attribute <wdg>, in accordance with the template, attribute <tmpl>.

Manipulation with the sessions of the projects

To provide a uniform mechanism for manipulation of the sessions by the visualizers of VCA in the module of the VCA engine (VCAEngin) are provided: the service function "/serv/sess" and query commands of the list of open sessions, connection/creation of the new session and disconnection/deleting of the session:<list path="/UI/VCAEngine/%2fserv%2fsess"/>, <connect path="/UI/VCAEngine/%2fserv%2fsess"/> and <disconnect path="/UI/VCAEngine/%2fserv%2fsess"/> accordingly. Attributes of these commands, which provide the various mechanisms of the request, are presented in Table 4.13.2.b.


Table 4.13.2.b. Attributes of commands of the mechanism of manipulation with sessions

IdNameValue
Command of request of the list of open sessions for the project: <list path="/UI/VCAEngine/%2fserv%2fsess"/>
prj Indication of the project Specifies the project for which to return the list of open sessions.
<el>{Session}</el> Control of the sessions' list In the child element the open for the requested project sessions are specified.
The command of the connection/opening of the session: <connect path="/UI/VCAEngine/%2fserv%2fsess"/>
sess Installation and control of the session name If the attribute is defined, then connecting to an existing session is to be made, else - creation of the new session is to be made. In the case of opening of the new session in this attribute its name is is placed.
prj Setting the name of the project It is used to open a new session for indicated project and when the attribute {sess} is not specified.
The command of disconnection/closing of the session: <disconnect path="/UI/VCAEngine/%2fserv%2fsess"/>
sess Setting the name of the session Specify the name of the session from that it is made the disconnection or closing. Sessions, not the background, and to which none of the visualizers is not connected, are automatically closed.
The group request of the tree of widget libraries

In order to optimize the performance of local and especially network interaction the service function "/serv/wlbBr" and command of the query of the tree of widget libraries: <get path="/UI/VCAEngine/%2fserv%2fwlbBr"/> are provided. The result of the query is the tree with the elements of the libraries of widgets, tags <wlb>. Inside the tags of libraries of widgets are included: icon tag <ico> and widgets library tags <w>. Widgets tags, in their turn, contain the icon tag and tags of the child widgets <cw>.


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]