From OpenSCADAWiki
Jump to: navigation, search
Name Founded Status Members Icon
Graphical PLC Programming in OpenSCADA September 2022 Formation Roman Savochenko GraphicalProgPLC struct.png
Description
Purpose of the sub-project is to provide OpenSCADA with the graphical PLC programming, with the graphical OpenSCADA features as the frontend and multiple PLC interfaces as the backends, in the first way including the OpenSCADA internal calculation mechanisms and supporting the standard protocols like to MTP, the standards IEC 61131-3, etc.
  • Difficulty, spent [compensated] time: 1.5 [1.5] HD[!]
  • Known issues and most actual tasks (To Do):
+ formation the page-conception — 1.0 HD[!]
+ formation the service commands-functions — 0.5 HD[!]
+ preparing: appending for support Qt WebEngine and Qt Multimedia, adapt to Qt6
- VCA: graphical links implementing:
- implementing without the linking specific and as the typical Widget for simple line;
- implementing the linking — graphical drawing at pressing the left mouse and finishing at release, store the standard mode;
- implementing the nodes and graphical linking to the nodes;
- extended decoration.
- implementing the service commands-functions for default — no container sources
- implementing the service commands-functions for DAQ.LogicLev and for the followed VCA implementations
- VCA: implementing of linking the VCA Widget Libraries to the DAQ control libraries: loading, saving
- VCA: implementing of the graphical and logical linking: sockets description and graphical representing, simple links, grouping links
- VCA: implementing of the procedures specifying and transmitting
- implementing the service commands-functions for DAQ.BlockCalc and DAQ.JavaLikeCalc
- implementing the service commands-functions for MTP
- creating libraries for some languages of IEC 61131-3

1 Introduction

Though OpenSCADA is a Supervisory Control And Data Acquisition System (SCADA) initially, that is long enough used for many adjacent areas, one of which is the PLC execution environments, and simulating itself the PLC execution environments together with the technological processes. Creation-programming of such PLC execution environments performed directly in correspond calculation module what is convenient enough for the text languages like to JavaLikeCalk and through DAQ-templates on it base, but that is not convenient for the block diagrams since the diagrams must be drawn graphically in some external editor with different moving the graphical links to the logical scheme.

Outsides OpenSCADA other PLC developers long enough are used some standard languages like to IEC-61131-3 for which there created a polling and potential fundraising for them implementing in OpenSCADA. And now there appeared the topic about using the unification Module Type Package (MTP).

2 Destination

The sub-project targeted for expanding the available graphical functions of the VCA-conception module UI.VCAEngine with its visualisers UI.Vision, UI.WebVision to work in the role of a frontend of the Graphical PLC Programming.

3 Requirements

3.1 Architectural

The main architectural requirement is implementing the PLC Programming Data Model in modules of the subsystem DAQ (inheriting the class TTypeDAQ) which provide such feature. When the implementing of the PLC Programming Data Model means translation of requests to the unified PLC Programming Data Model in the module-source specific PLC Programming Data Model. The Visual Control Area (VCA) performs those requests according to the VCA Widgets and Attributes structure. So in the common we have such hierarchy:

  • VCA — Visual Control Area of the Graphical Edition.
  • Unified PLC Programming Data Model — implemented through the OpenSCADA Control Interface what provides the network distribution.
  • Module-source specific Data Model — for translation to the Unified PLC Programming Data Model.

Essences of the Visual Control Area what already implemented and what must be bound with the PLC Programming Data Model are:

  • libraries of the elements, can be:
    • isolated — can use only own items in the container elements, for very specific to OpenSCADA PLCs with all own resources;
    • read only — for fixed-static libraries.
  • elements with the attributes, can be:
    • container — can include and link other elements, so be the schemes;
    • read only — for fixed-static elements;
    • provide a storage for the graphical configuration or store that in generic fields like to the description.
  • attributes in the standard types, can be:
    • primary — ones from PLC, in the VCA space they are appended by the prefix "src_" and used for the operative data representing;
    • service — ones storing some service data, on the source specific Data Model can be whether forced or stored in generic fields like to the description:
      • "container" — the element is a container, that is can include other elements;
      • "ro" — the element accessible only for use — read only;
      • "proc_{PRC}" — describes the PLC procedure PRC or parameters of its building;
      • "sockets" — describes the block sockets;
      • "links" — describes connections in the container block.

3.2 General

In the common and from the VCA side the Graphical PLC Development provides functions:

  • binding the widget libraries to library of the PLC Programming Data Model;
  • downloading the libraries from the PLC Programming Data Model;
  • unloading the libraries to the PLC Programming Data Model;
  • generating the VCA project with it linking to the local sources of representing the remote data and generating the local data sources themself at the offline developing;
  • offline graphical edition;
  • dynamic-online graphical edition with instantaneous changing the PLC Programming Data Model and tracing-debugging the operative-instantaneous PLC values and the local data sources of representing the PLC values access;

Storing the data of the graphical schemes and elements in the libraries provides doubling, that is storing in PLC and in the VCA Graphical Editor, so you can perform listed above functions in any time.

From the specific, the visual edition also means:

  • adding-moving-removing-properties of the block sockets, including own control panel;
  • linking-unlinking-properties of the socket connections between the included blocks.

4 Projection

The described structure is shown in the Figure.

GraphicalProgPLC struct.png

4.1 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.

Libraries of the control elements

Getting list of the libraries
REQ: <list path="/DAQ/{MOD}/%2fserv%2fgp" />
  • MOD — the DAQ module.
RESP: <list path="/DAQ/{MOD}/%2fserv%2fgp" rez="0">{libraries}</list> />
  • libraries — libraries in the tags "lib": <lib id="{ID}">{name}</lib>
    • ID — identifier of the library;
    • name — name of the library.
Adding a library
REQ: <add path="/DAQ/{MOD}/%2fserv%2fgp" id="{ID}">{name}</add>
  • MOD — the DAQ module;
  • ID — identifier of the library;
  • name — name of the library.
Deleting a library
REQ: <del path="/DAQ/{MOD}/%2fserv%2fgp" id="{ID}" />
  • MOD — the DAQ module;
  • ID — identifier of the library.

Library of the control elements

Getting list of the the control elements
REQ: <list path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}" />
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library.
RESP: <list path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}" rez="0" ro="{readOnly}" isolated="{isolated}">{elements}</list>
  • readOnly — sign [0|1] of the fixed-static libraries;
  • isolated — sign [0|1] of using by this library only own items in the container elements, for very specific to OpenSCADA PLCs with all own resources;
  • elements — the control elements in the tags: <el id="{ID}">{name}</el>
    • ID — identifier of the element;
    • name — name of the element.
Adding an element
REQ: <add path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}" id="{ID}">{name}</add>
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • ID — identifier of the element;
  • name — name of the element.
Deleting an element
REQ: <del path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}" id="{ID}" />
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • ID — identifier of the element.

The control element

Getting list of items of the control element
REQ: <list path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}" />
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • EL — identifier of the container element.
RESP: <list path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}" rez="0" ro="{readOnly}" container="{container}">{items}</list>
  • readOnly — sign [0|1] of the fixed-static elements;
  • container — sign [0|1] of the container elements — has can contain "items";
  • items — items of the control element in the tags: <it id="{ID}" src="{SRC}">{name}</it>
    • ID — identifier of the item;
    • name — name of the item;
    • SRC — the source element at the path "{LIB}.{EL}".
Adding an item
REQ: <add path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}" id="{ID}">{name}</add>
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • EL — identifier of the container element;
  • ID — identifier of the item;
  • name — name of the item.
Deleting an element
REQ: <del path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}" id="{ID}" />
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • EL — identifier of the container element;
  • ID — identifier of the item.
Getting list of all or specified attributes with values for the control element or its item
REQ: <aGet path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}[%2f{IT}]" noInfo="{noInfo}">{attrs}</aGet>
  • MOD — the DAQ module;
  • LIB — identifier of the control elements library;
  • EL — identifier of the container element;
  • IT — identifier of the item;
  • noInfo — don't return the attribute information, only value;
  • attrs — directly requested attributes in the tags: <a id="{ID}" /a>
    • ID — identifier of the attribute.
RESP: <aGet path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}[%2f{IT}]" noName="{noName}" rez="0">{attrs}</aGet>
  • attrs — attributes in the tags: <a id="{ID}" nm="{name}" tp="{type}">{value}</a>
    • name — name of the attribute;
    • type — type of the attribute, see the types;
    • value — value of the attribute.
Setting multiple attributes' values for the control element or its item
REQ: <aSet path="/DAQ/{MOD}/%2fserv%2fgp%2f{LIB}%2f{EL}[%2f{IT}]">{attrs}</aSet>
  • attrs — attribute values in the tags: <a id="{ID}">{value}</a>
    • ID — identifier of the attribute;
    • value — value of the attribute.

...

4.2 Linking

Links, sockets and them treating are most complex essence in the project taking in the account for wideness of the data sources, so they will be detailing in the implementation already, especially for the group links.

Structure of the specific attributes is:

  • "sockets" — "{ID}:({x}|{y})[:{GRP}]"
  • "links" — "{WID}.{ID}:{WID}.{ID}[:({x1}|{y1})...({xn}|{yn})[:{width}[:{color}[:{line_stl}]]]]"

Where:

  • "ID" — the socket identifier;
  • "GRP" — the socket group;
  • "x", "y" — coordinate of the socket point;
  • "WID" — the widget-block identifier;
  • "x{N}", "y{N}" — intermediate coordinates of the connection line;
  • "width","color","line_stl" — width, color and style (0-Solid, 1-Dashed, 2-Dotted) of the connection line.

4.3 Reflection the OpenSCADA DAQ elements in the Unified PLC Programming Data Model

That is pre-laying the DAQ elements of OpenSCADA on this conception for it checking and further implementing.

Function Common Data Source DAQ.LogicLev
Libraries of the elements the controller objects of DAQ
Elements parameters of the controller object of DAQ
Attributes attributes of the DAQ parameter of the controller object of DAQ
Storage of the UI specific configuration and attributes the attribute "Description (DESCR)" — the configuration field
Linking --//-- ...

...

5 Links