Line 30: | Line 30: | ||
Below is a description of each library function. | Below is a description of each library function. | ||
− | + | == Alarm (alarm) == <!--T:5--> | |
− | + | ''Description:'' Setting an alarm sign in case of exceeding of the variable for the specified boundary.<br/> | |
− | == Alarm (alarm) | + | |
− | ''Description:'' | + | |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
out = if(val>max || val<min) true; else false;</pre> | out = if(val>max || val<min) true; else false;</pre> | ||
− | == Condition '<' (cond_lt) | + | == Condition '<' (cond_lt) == <!--T:6--> |
− | ''Description:'' Operation of branching | + | ''Description:'' Operation of the branching according to the condition "less."<br/> |
− | ''Formula:'' | + | ''Formula:'' |
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
out = if(in1<(in2_1*in2_2*in2_3*in2_4)) in3_1*in3_2*in3_3*in3_4; | out = if(in1<(in2_1*in2_2*in2_3*in2_4)) in3_1*in3_2*in3_3*in3_4; | ||
else in4_1*in4_2*in4_3*in4_4;</pre> | else in4_1*in4_2*in4_3*in4_4;</pre> | ||
− | == Condition '>' (cond_gt) | + | == Condition '>' (cond_gt) == <!--T:7--> |
− | ''Description:'' Operation of branching | + | ''Description:'' Operation of the branching according to the condition "great".<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 52: | Line 50: | ||
else in4_1*in4_2*in4_3*in4_4;</pre> | else in4_1*in4_2*in4_3*in4_4;</pre> | ||
− | == Full condition (cond_full) | + | == Full condition (cond_full) == <!--T:8--> |
− | ''Description:'' Full check | + | ''Description:'' Full condition check including great, less and equal.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 60: | Line 58: | ||
else in6_1*in6_2*in6_3*in6_4;</pre> | else in6_1*in6_2*in6_3*in6_4;</pre> | ||
− | == | + | == Discrete block (digitBlock) == <!--T:9--> |
− | ''Description:'' | + | ''Description:'' The function contains a control algorithm for the collection of discrete signals for latches and pumps that contain: signs "Opened", "Closed", and commands "Open", "Close", and "Stop". The function supports the operation of pulsed commands, that is it can take a signal within a specified time interval.<br/> |
''Parameters:'' | ''Parameters:'' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Identifier !! Parameter !! Type !! Mode |
|- | |- | ||
− | |cmdOpen||Command "Open"||Bool|| | + | | cmdOpen || Command "Open" || Bool || Output |
|- | |- | ||
− | |cmdClose||Command "Close"||Bool|| | + | | cmdClose || Command "Close" || Bool || Output |
|- | |- | ||
− | |cmdStop||Command "Stop"||Bool|| | + | | cmdStop || Command "Stop" || Bool || Output |
|- | |- | ||
− | |stOpen|| | + | | stOpen || State "Opened" || Bool || Input |
|- | |- | ||
− | |stClose|| | + | | stClose || State "Closed" || Bool || Input |
|- | |- | ||
− | |tCmd|| | + | | tCmd || Time of commands holding, seconds || Integer || Input |
|- | |- | ||
− | |frq||Frequency of | + | | frq || Frequency of the calculating, Hz || Integer || Input |
|} | |} | ||
− | == Division (div) | + | == Division (div) == <!--T:10--> |
− | ''Description:'' | + | ''Description:'' Divides assemblies of variables.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 89: | Line 87: | ||
(in4_1*in4_2*in4_3*in4_4*in4_5 + in5_1*in5_2*in5_3*in5_4*in5_5 + in6);</pre> | (in4_1*in4_2*in4_3*in4_4*in4_5 + in5_1*in5_2*in5_3*in5_4*in5_5 + in6);</pre> | ||
− | == Exponent (exp) | + | == Exponent (exp) == <!--T:11--> |
− | ''Description:'' | + | ''Description:'' Calculate an exponent over a group of variables.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 96: | Line 94: | ||
(in4_1*in4_2*in4_3*in4_4*in4_5+in5) )</pre> | (in4_1*in4_2*in4_3*in4_4*in4_5+in5) )</pre> | ||
− | == Flow (flow) | + | == Flow (flow) == <!--T:12--> |
''Description:'' Calculation of the gas flow.<br/> | ''Description:'' Calculation of the gas flow.<br/> | ||
''Formula:'' | ''Formula:'' | ||
Line 102: | Line 100: | ||
f = K1*((K3+K4*x)^K2);</pre> | f = K1*((K3+K4*x)^K2);</pre> | ||
− | == Iterator (increment) | + | == Iterator (increment) == <!--T:13--> |
− | ''Description:'' Iterative calculation with the increment specifying | + | ''Description:'' Iterative calculation with the increment specifying, gain ratio for different directions is different.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 109: | Line 107: | ||
else in2 - in4*(in2-in1);</pre> | else in2 - in4*(in2-in1);</pre> | ||
− | == Lag (lag) | + | == Lag (lag) == <!--T:14--> |
− | ''Description:'' | + | ''Description:'' Delay of the change of a variable, practically it is a filter without binding to time.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
y = y - Klag*( y - x );</pre> | y = y - Klag*( y - x );</pre> | ||
− | == Simple multiplication(mult) | + | == Simple multiplication (mult) == <!--T:15--> |
''Description:'' Simple multiplication with division.<br/> | ''Description:'' Simple multiplication with division.<br/> | ||
''Formula:'' | ''Formula:'' | ||
Line 122: | Line 120: | ||
(in2_1*in2_2*in2_3*in2_4);</pre> | (in2_1*in2_2*in2_3*in2_4);</pre> | ||
− | == Multiplication | + | == Multiplication and division (multDiv) == <!--T:16--> |
− | ''Description:'' Branched multiplication | + | ''Description:'' Branched multiplication and division.<br/> |
''Formula:'' | ''Formula:'' | ||
<pre style="white-space: pre-wrap;"> | <pre style="white-space: pre-wrap;"> | ||
Line 130: | Line 128: | ||
(in4_1*in4_2*in4_3*in4_4*in4_5));</pre> | (in4_1*in4_2*in4_3*in4_4*in4_5));</pre> | ||
− | == PID regulator (pid) | + | == PID regulator (pid) == <!--T:17--> |
''Description:'' Proportional-integral-differential regulator.<br/> | ''Description:'' Proportional-integral-differential regulator.<br/> | ||
''Parameters:'' | ''Parameters:'' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Identifier !! Parameter !! Type !! Mode !! By defaults |
|- | |- | ||
− | |var||Variable||Real|| | + | | var || Variable || Real || Input || 0 |
|- | |- | ||
− | |sp|| | + | | sp || Setpoint || Real || Output || 0 |
|- | |- | ||
− | |max||Maximum of scale||Real|| | + | | max || Maximum of the scale || Real || Input || 100 |
|- | |- | ||
− | |min||Minimum of scale||Real|| | + | | min || Minimum of the scale || Real || Input || 0 |
|- | |- | ||
− | |manIn||Manual input | + | | manIn || Manual input, % || Real || Input || 0 |
|- | |- | ||
− | |out||Out | + | | out || Out, % || Real || Return || 0 |
|- | |- | ||
− | |auto||Auto||Bool|| | + | | auto || Auto mode || Bool || Input || 0 |
|- | |- | ||
− | |casc||Cascade||Bool|| | + | | casc || Cascade mode || Bool || Input || 0 |
|- | |- | ||
− | |Kp||Kp||Real|| | + | | Kp || Kp || Real || Input || 1 |
|- | |- | ||
− | |Ti||Ti | + | | Ti || Ti, milliseconds || Integer || Input || 1000 |
|- | |- | ||
− | |Kd||Kd||Real|| | + | | Kd || Kd || Real || Input || 1 |
|- | |- | ||
− | |Td||Td | + | | Td || Td, milliseconds || Integer || Input || 0 |
|- | |- | ||
− | |Tzd||Td lag | + | | Tzd || Td lag, milliseconds || Integer || Input || 0 |
|- | |- | ||
− | |Hup||Upper limit of the out | + | | Hup || Upper limit of the out, % || Real || Input || 100 |
|- | |- | ||
− | |Hdwn||Lower limit of the out | + | | Hdwn || Lower limit of the out, % || Real || Input || 0 |
|- | |- | ||
− | |Zi||Insensitivity | + | | Zi || Insensitivity, % || Real || Input || 1 |
|- | |- | ||
− | |followSp||Follow | + | | followSp || Follow setpoint from variable on the manual mode || Bool || Input || 1 |
|- | |- | ||
− | |K1|| | + | | K1 || K input 1 || Real || Input || 0 |
|- | |- | ||
− | |in1||Input 1||Real|| | + | | in1 || Input 1 || Real || Input || 0 |
|- | |- | ||
− | |K2|| | + | | K2 || K input 2 || Real || Input || 0 |
|- | |- | ||
− | |in2||Input 2||Real|| | + | | in2 || Input 2 || Real || Input || 0 |
|- | |- | ||
− | |K3|| | + | | K3 || K input 3 || Real || Input || 0 |
|- | |- | ||
− | |in3||Input 3||Real|| | + | | in3 || Input 3 || Real || Input || 0 |
|- | |- | ||
− | |K4|| | + | | K4 || K input 4 || Real || Input || 0 |
|- | |- | ||
− | |in4||Input 4||Real|| | + | | in4 || Input 4 || Real || Input || 0 |
|- | |- | ||
− | |f_frq||Frequency of | + | | f_frq || Frequency of the calculating, Hz || Real || Input || 1 |
|} | |} | ||
''Structure:''<br/> | ''Structure:''<br/> | ||
[[file:FLibComplex1_PID.png]] | [[file:FLibComplex1_PID.png]] | ||
+ | |||
+ | ... | ||
== Power (pow) <564> == <!--T:18--> | == Power (pow) <564> == <!--T:18--> |
Revision as of 18:47, 28 October 2018
Module | Name | Version | License | Source | Languages | Platforms | Type | Author | Description |
---|---|---|---|---|---|---|---|---|---|
FLibComplex1 | Complex1 functions | 1.2 | GPL2 | spec_FLibComplex1.so | en,uk,ru,de | x86,x86_64,ARM | Special | Roman Savochenko Maxim Lysenko (2009) — the page translation |
Provides a library of the functions of compatibility with SCADA Complex 1 of the firm SIC "DIYA". |
Contents
[hide]- 1 Alarm (alarm)
- 2 Condition '<' (cond_lt)
- 3 Condition '>' (cond_gt)
- 4 Full condition (cond_full)
- 5 Discrete block (digitBlock)
- 6 Division (div)
- 7 Exponent (exp)
- 8 Flow (flow)
- 9 Iterator (increment)
- 10 Lag (lag)
- 11 Simple multiplication (mult)
- 12 Multiplication and division (multDiv)
- 13 PID regulator (pid)
- 14 Power (pow) <564>
- 15 Selection (select) <156>
- 16 Simple integrator (sum) <404>
- 17 Sum with the division (sum_div) <518>
- 18 Sum with the multiplication. (sum_mult) <483>
- 19 User programming API
The module provides OpenSCADA for a static library of compatibility functions with SCADA Complex1 of the firm SIC "DIYA". These functions were used in Complex1 in the form of algoblocks to create in-system computations based on the virtual controller. Providing the library of these functions allows the transfer of computational algorithms from Complex1.
To address the functions of the library you can use the static call address Special.FLibComplex1.{Func}() or dynamic SYS.Special.FLibComplex1["{Func}"].call(), SYS.Special.FLibComplex1.{Func}(). Where {Func} — function identifier in the library.
Below is a description of each library function.
1 Alarm (alarm)
Description: Setting an alarm sign in case of exceeding of the variable for the specified boundary.
Formula:
out = if(val>max || val<min) true; else false;
2 Condition '<' (cond_lt)
Description: Operation of the branching according to the condition "less."
Formula:
out = if(in1<(in2_1*in2_2*in2_3*in2_4)) in3_1*in3_2*in3_3*in3_4; else in4_1*in4_2*in4_3*in4_4;
3 Condition '>' (cond_gt)
Description: Operation of the branching according to the condition "great".
Formula:
out = if(in1>(in2_1*in2_2*in2_3*in2_4)) in3_1*in3_2*in3_3*in3_4; else in4_1*in4_2*in4_3*in4_4;
4 Full condition (cond_full)
Description: Full condition check including great, less and equal.
Formula:
out = if(in1<(in2_1*in2_2*in2_3*in2_4)) in3_1*in3_2*in3_3*in3_4; else if( in1>(in4_1*in4_2*in4_3*in4_4) in5_1*in5_2*in5_3*in5_4; else in6_1*in6_2*in6_3*in6_4;
5 Discrete block (digitBlock)
Description: The function contains a control algorithm for the collection of discrete signals for latches and pumps that contain: signs "Opened", "Closed", and commands "Open", "Close", and "Stop". The function supports the operation of pulsed commands, that is it can take a signal within a specified time interval.
Parameters:
Identifier | Parameter | Type | Mode |
---|---|---|---|
cmdOpen | Command "Open" | Bool | Output |
cmdClose | Command "Close" | Bool | Output |
cmdStop | Command "Stop" | Bool | Output |
stOpen | State "Opened" | Bool | Input |
stClose | State "Closed" | Bool | Input |
tCmd | Time of commands holding, seconds | Integer | Input |
frq | Frequency of the calculating, Hz | Integer | Input |
6 Division (div)
Description: Divides assemblies of variables.
Formula:
out = (in1_1*in1_2*in1_3*in1_4*in1_5 + in2_1*in2_2*in2_3*in2_4*in2_5 + in3) / (in4_1*in4_2*in4_3*in4_4*in4_5 + in5_1*in5_2*in5_3*in5_4*in5_5 + in6);
7 Exponent (exp)
Description: Calculate an exponent over a group of variables.
Formula:
out = exp (in1_1*in1_2*in1_3*in1_4*in1_5 + (in2_1*in2_2*in2_3*in2_4*in2_5+in3) / (in4_1*in4_2*in4_3*in4_4*in4_5+in5) )
8 Flow (flow)
Description: Calculation of the gas flow.
Formula:
f = K1*((K3+K4*x)^K2);
9 Iterator (increment)
Description: Iterative calculation with the increment specifying, gain ratio for different directions is different.
Formula:
out = if( in1 > in2 ) in2 + in3*(in1-in2); else in2 - in4*(in2-in1);
10 Lag (lag)
Description: Delay of the change of a variable, practically it is a filter without binding to time.
Formula:
y = y - Klag*( y - x );
11 Simple multiplication (mult)
Description: Simple multiplication with division.
Formula:
out = (in1_1*in1_2*in1_3*in1_4*in1_5*in1_6)/ (in2_1*in2_2*in2_3*in2_4);
12 Multiplication and division (multDiv)
Description: Branched multiplication and division.
Formula:
out = in1_1*in1_2*in1_3*in1_4*in1_5* (in2_1*in2_2*in2_3*in2_4*in2_5+(in3_1*in3_2*in3_3*in3_4*in3_5)/ (in4_1*in4_2*in4_3*in4_4*in4_5));
13 PID regulator (pid)
Description: Proportional-integral-differential regulator.
Parameters:
Identifier | Parameter | Type | Mode | By defaults |
---|---|---|---|---|
var | Variable | Real | Input | 0 |
sp | Setpoint | Real | Output | 0 |
max | Maximum of the scale | Real | Input | 100 |
min | Minimum of the scale | Real | Input | 0 |
manIn | Manual input, % | Real | Input | 0 |
out | Out, % | Real | Return | 0 |
auto | Auto mode | Bool | Input | 0 |
casc | Cascade mode | Bool | Input | 0 |
Kp | Kp | Real | Input | 1 |
Ti | Ti, milliseconds | Integer | Input | 1000 |
Kd | Kd | Real | Input | 1 |
Td | Td, milliseconds | Integer | Input | 0 |
Tzd | Td lag, milliseconds | Integer | Input | 0 |
Hup | Upper limit of the out, % | Real | Input | 100 |
Hdwn | Lower limit of the out, % | Real | Input | 0 |
Zi | Insensitivity, % | Real | Input | 1 |
followSp | Follow setpoint from variable on the manual mode | Bool | Input | 1 |
K1 | K input 1 | Real | Input | 0 |
in1 | Input 1 | Real | Input | 0 |
K2 | K input 2 | Real | Input | 0 |
in2 | Input 2 | Real | Input | 0 |
K3 | K input 3 | Real | Input | 0 |
in3 | Input 3 | Real | Input | 0 |
K4 | K input 4 | Real | Input | 0 |
in4 | Input 4 | Real | Input | 0 |
f_frq | Frequency of the calculating, Hz | Real | Input | 1 |
...
14 Power (pow) <564>
Description: Raising to the power
Formula:
out = (in1_1*in1_2*in1_3*in1_4*in1_5)^ (in2_1*in2_2*in2_3*in2_4*in2_5 + (in3_1*in3_2*in3_3*in3_4*in3_5)/ (in4_1*in4_2*in4_3*in4_4*in4_5));
15 Selection (select) <156>
Description: Selection of the one from four options.
Formula:
out = if(sel = 1) in1_1*in1_2*in1_3*in1_4; if(sel = 2) in2_1*in2_2*in2_3*in2_4; if(sel = 3) in3_1*in3_2*in3_3*in3_4; if(sel = 4) in4_1*in4_2*in4_3*in4_4;
16 Simple integrator (sum) <404>
Description: A simple summation with the multiplication.
Formula:
out = in1_1*in1_2+in2_1*in2_2+in3_1*in3_2+in4_1*in4_2 + in5_1*in5_2+in6_1*in6_2+in7_1*in7_2+in8_1*in8_2;
17 Sum with the division (sum_div) <518>
Description: The summation the set of values with the division.
Formula:
out = in1_1*in1_2*(in1_3+in1_4/in1_5) + in2_1*in2_2*(in2_3+in2_4/in2_5) + in3_1*in3_2*(in3_3+in3_4/in3_5) + in4_1*in4_2*(in4_3+in4_4/in4_5);
18 Sum with the multiplication. (sum_mult) <483>
Description: The summation the set of values with the multiplication.
Formula:
out = in1_1*in1_2*(in1_3*in1_4+in1_5) + in2_1*in2_2*(in2_3*in2_4+in2_5) + in3_1*in3_2*(in3_3*in3_4+in3_5) + in4_1*in4_2*(in4_3*in4_4+in4_5);
19 User programming API
Some objects of the module provides functions for user's programming.
The object "Functions library" (SYS.Special.FLibComplex1)
- ElTp {funcID}(ElTp prm1, ...) — call the library function {funcID}. Return result of the called function.
The object "User function" (SYS.Special.FLibComplex1["funcID"])
- ElTp call(ElTp prm1, ...) — call the function with parameters <prm{N}>. Return result of the called function.