OpenSCADA

Modules/BlockCalc

English • ‎mRussian • ‎Українська
Constr.png The translation checking and actualizing
Module Name Version License Source Languages Platforms Type Author Description
BlockCalc Block calculator 1.12 GPL2 daq_BlockCalc.so en,uk,ru,de x86,x86_64,ARM DAQ Roman Savochenko
  Maxim Lysenko (2009,2012) — the page initial translation
Provides a block calculator.

The module of subsystems "DAQ" BlockCalc provides the system OpenSCADA with the mechanism for creating custom calculations. The mechanism of calculations based on the formal language of block circuits(functional blocks).

Also, the module implements the functions of the horizontal reservation, namely, working in conjunction with the remote station of the same level. In addition to the synchronization of the archives of values and archives of attributes of parameters the module implements synchronization of computational templates, in order to shockless catch of the algorithms.

Languages of block programming based on the notion of circuits(functional blocks). Moreover, depending on the substance of the block, block circuits may include: logic, relay logic circuits, a model of technological process, and more. The essence of the block circuit is that it contains a list of blocks and relations between them.

From a formal point of view a block is an element(function), which has inputs, outputs, and an algorithm for computing. Basing on the concept of programming area, block is a frame of values associated with the object of function.

Of course, the inputs and outputs of blocks may be needed to be connected for a solid block scheme. The following types of links are provided:

Conditionally, connections of blocks can be represented as links between the blocks as a whole(Fig. 1) or detailing of the links(Fig. 2). In the process of binding parameters of blocks the connection of parameters of any type is acceptable. Thus, in the process of computation automatically casting of types will be done.

Fig. 1. General connections between blocks of a block scheme.
Fig. 2. Detailed links between blocks.

Contents

1 The controller of the module

Each controller of this module contains the block circuit, which he computes with the specified period. In order to provide calculated data in the system OpenSCADA the parameters can be created in the controller. Example of the configuration tab of the controller of the given type depicted in Fig. 3.

Fig. 3. Configuration tab of a controller.

From this tab you can set:

2 The block scheme of the controller

The block scheme is formed by means of the tab controller's blocks, configuration of the block (Figure 4) and its connections (Fig. 5). The blocks are stored in a table with the name "BlckCalcBlcks_{CntrId}".

Blocks of block scheme can connect both among themselves and to the attributes of the parameters. Blocks themselves do not contain the structure of input/output(IO), but contain values, based on the IO-structure of related function. Function for linking with a block is used from the object model of the system OpenSCADA.

Any block may at any time be removed from the process and be reconfigured and then may be again included in the process. Communications between the blocks can be configured without exception blocks from the processing and stopping of the controller. All IO values without connections can be changed during processing.

Using tab of the blocks you can:

Fig. 4. Configuration tab of a block scheme.

Using the form of block configuration it can be set:

Fig. 5. Configuration tab of links of a block of a block scheme.

Using the configuration tab of links of the block of the block scheme the links can be set for the parameter of each block separately.

The following types of links are supported:

To set values for the parameter of the block there is the corresponding tab (Fig.6).

In accordance with the custom functions in the system OpenSCADA the four main types of IO are supported: integer, float, boolean and string.

Fig. 6. Configuration tab of values of parameters of a block of a block scheme.

The module provides a special treatment of a number of IO of the block:

3 Parameters of the controller

The module provides only one the "Standard (std)" type of the parameters with the parameters table name "BlckCalcPrm_{CntrId}". The parameter used to reflect the data, calculated in the blocks, on the attributes of the controller's parameters. Example of the configuration tab of the parameter is shown in Fig.7.

Fig. 7. Configuration tab of values of parameters of a controller.

From this tab you can set:

{BLK} — block ID, block schemes ID; for constant value set to:
'*s' — string type;
'*i' — integer type;
'*r' — real type;
'*b' — boolean type.
{BLK_IO} — parameter of the block or of the the block scheme; for constant value set to attribute value;
{AID} — attribute of the parameter ID;
{ANM} — name of the attribute of parameter.

4 Copying of the block schemes

To simplify and expedite the development of complex and repetitive block schemes the mechanism of copying of the elements of block scheme both individually and block schemes entirely is provided. The mechanism of copying is integrated into the kernel of OpenSCADA and operates transparently.

5 User programming API

Some objects of the module provides functions for user's programming.

User object model of the module BlockCalc.

The object "Block" (SYS.DAQ.BlockCalc["cntr"]["blk_block"])


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


Getting for values of all block attributes of the controller object
REQ: <get path="/DAQ/BlockCalc/{CNTR}/blk_{BLK}/%2fserv%2fattr" />

RESP: <get path="/DAQ/BlockCalc/{CNTR}/blk_{BLK}/%2fserv%2fattr" rez="0">{attributes}</get>

<get path="/DAQ/BlockCalc/CM101/blk_AT101_1/%2fserv%2fattr" rez="0" user="roman">
  <a id="Fi">50.3839725707191</a>
  <a id="Pi">10.2588208891757</a>
  <a id="Ti">331.149550201738</a>
  <a id="Si">0.071</a>
  <a id="li">10</a>
</get>

Setting for values of list the block attributes of the controller object
REQ[root-DAQ]: <set path="/DAQ/BlockCalc/{CNTR}/blk_{BLK}/%2fserv%2fattr">{attributes}</set>

<set path="/DAQ/BlockCalc/CM101/blk_AT101_1/%2fserv%2fattr">
  <a id="Fi">50.3839725707191</a>
  <a id="Pi">10.2588208891757</a>
</set>


7 Links

Modules/BlockCalc/en - GFDLNovember 2024OpenSCADA 1+r2996