From OpenSCADAWiki
Jump to: navigation, search
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) <111> == <!--T:5-->
+
''Description:'' Set alarm sign in the case of going out of the variable for the specified boundary.<br/>
+
 
''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) <239> == <!--T:6-->
+
== Condition '<' (cond_lt) == <!--T:6-->
''Description:'' Operation of branching in accordance with the condition "<".<br/>
+
''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) <240> == <!--T:7-->
+
== Condition '>' (cond_gt) == <!--T:7-->
''Description:'' Operation of branching in accordance with the condition ">".<br/>
+
''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) <513> == <!--T:8-->
+
== Full condition (cond_full) == <!--T:8-->
''Description:'' Full check of the conditions, including more, less and equal.<br/>
+
''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>
  
== Digital block (digitBlock) <252> == <!--T:9-->
+
== Discrete block (digitBlock) == <!--T:9-->
''Description:'' Function contains the control algorithm of digital signals acquisition for valves and pumps that contain: signs of "Open", "Close" and the command "Open", "Close", "Stop". Supports work with pulse commands, i.e. can read the signal through the specified period of time.<br/>
+
''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"
 
|-
 
|-
! ID !! Parameter !! Type !! Mode
+
! Identifier !! Parameter !! Type !! Mode
 
|-
 
|-
|cmdOpen||Command "Open"||Bool||Out
+
| cmdOpen || Command "Open" || Bool || Output
 
|-
 
|-
|cmdClose||Command "Close"||Bool||Out
+
| cmdClose || Command "Close" || Bool || Output
 
|-
 
|-
|cmdStop||Command "Stop"||Bool||Out
+
| cmdStop || Command "Stop" || Bool || Output
 
|-
 
|-
|stOpen||Position "Opened"||Bool||In
+
| stOpen || State "Opened" || Bool || Input
 
|-
 
|-
|stClose||Position "Closed"||Bool||In
+
| stClose || State "Closed" || Bool || Input
 
|-
 
|-
|tCmd||Command hold time (s)||Integer||In
+
| tCmd || Time of commands holding, seconds || Integer || Input
 
|-
 
|-
|frq||Frequency of calculation (milliseconds)||Integer||In
+
| frq || Frequency of the calculating, Hz || Integer || Input
 
|}
 
|}
  
== Division (div) <526> == <!--T:10-->
+
== Division (div) == <!--T:10-->
''Description:'' Makes division of the set of variables.<br/>
+
''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) <476> == <!--T:11-->
+
== Exponent (exp) == <!--T:11-->
''Description:'' Calculating the exponent under the group of variables.<br/>
+
''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) <235> == <!--T:12-->
+
== 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) <181> == <!--T:13-->
+
== Iterator (increment) == <!--T:13-->
''Description:'' Iterative calculation with the increment specifying. Gain ratio for different directions is different.<br/>
+
''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) <121> == <!--T:14-->
+
== Lag (lag) == <!--T:14-->
''Description:''Variation of the variable lag. Practice, this is the filter without reference to time.<br/>
+
''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) <259> == <!--T:15-->
+
== 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 + Division(multDiv) <468> == <!--T:16-->
+
== Multiplication and division (multDiv) == <!--T:16-->
''Description:'' Branched multiplication + division.<br/>
+
''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) <745> == <!--T:17-->
+
== PID regulator (pid) == <!--T:17-->
 
''Description:'' Proportional-integral-differential regulator.<br/>
 
''Description:'' Proportional-integral-differential regulator.<br/>
 
''Parameters:''
 
''Parameters:''
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! ID !! Parameter !! Type !! Mode !! By defaults
+
! Identifier !! Parameter !! Type !! Mode !! By defaults
 
|-
 
|-
|var||Variable||Real||In||0
+
| var || Variable || Real || Input || 0
 
|-
 
|-
|sp||Set point||Real||Out||0
+
| sp || Setpoint || Real || Output || 0
 
|-
 
|-
|max||Maximum of scale||Real||In||100
+
| max || Maximum of the scale || Real || Input || 100
 
|-
 
|-
|min||Minimum of scale||Real||In||0
+
| min || Minimum of the scale || Real || Input || 0
 
|-
 
|-
|manIn||Manual input (%)||Real||In||0
+
| manIn || Manual input, % || Real || Input || 0
 
|-
 
|-
|out||Out (%)||Real||Return||0
+
| out || Out, % || Real || Return || 0
 
|-
 
|-
|auto||Auto||Bool||In||0
+
| auto || Auto mode || Bool || Input || 0
 
|-
 
|-
|casc||Cascade||Bool||In||0
+
| casc || Cascade mode || Bool || Input || 0
 
|-
 
|-
|Kp||Kp||Real||In||1
+
| Kp || Kp || Real || Input || 1
 
|-
 
|-
|Ti||Ti (ms)||Integer||In||1000
+
| Ti || Ti, milliseconds || Integer || Input || 1000
 
|-
 
|-
|Kd||Kd||Real||In||1
+
| Kd || Kd || Real || Input || 1
 
|-
 
|-
|Td||Td (ms)||Integer||In||0
+
| Td || Td, milliseconds || Integer || Input || 0
 
|-
 
|-
|Tzd||Td lag (ms)||Integer||In||0
+
| Tzd || Td lag, milliseconds || Integer || Input || 0
 
|-
 
|-
|Hup||Upper limit of the out (%)||Real||In||100
+
| Hup || Upper limit of the out, % || Real || Input || 100
 
|-
 
|-
|Hdwn||Lower limit of the out (%)||Real||In||0
+
| Hdwn || Lower limit of the out, % || Real || Input || 0
 
|-
 
|-
|Zi||Insensitivity (%)||Real||In||1
+
| Zi || Insensitivity, % || Real || Input || 1
 
|-
 
|-
|followSp||Follow sp from var on manual||Bool||In||1
+
| followSp || Follow setpoint from variable on the manual mode || Bool || Input || 1
 
|-
 
|-
|K1||Koef. of the input 1||Real||In||0
+
| K1 || K input 1 || Real || Input || 0
 
|-
 
|-
|in1||Input 1||Real||In||0
+
| in1 || Input 1 || Real || Input || 0
 
|-
 
|-
|K2||Koef. of the input 2||Real||In||0
+
| K2 || K input 2 || Real || Input || 0
 
|-
 
|-
|in2||Input 2||Real||In||0
+
| in2 || Input 2 || Real || Input || 0
 
|-
 
|-
|K3||Koef. of the input 3||Real||In||0
+
| K3 || K input 3 || Real || Input || 0
 
|-
 
|-
|in3||Input 3||Real||In||0
+
| in3 || Input 3 || Real || Input || 0
 
|-
 
|-
|K4||Koef. of the input 4||Real||In||0
+
| K4 || K input 4 || Real || Input || 0
 
|-
 
|-
|in4||Input 4||Real||In||0
+
| in4 || Input 4 || Real || Input || 0
 
|-
 
|-
|f_frq||Frequency of calculation (Hz)||Real||In||1
+
| 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

Other languages:
English • ‎mRussian • ‎Українська
Constr.png The translation checking and actualizing
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".

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

Structure:
FLibComplex1 PID.png

...

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.