From OpenSCADAWiki
Jump to: navigation, search
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
 
<languages/>
 
<languages/>
{{Constr|The translation checking and actualizing}}
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 7: Line 6:
 
<section begin=info />
 
<section begin=info />
 
| [[Special:MyLanguage/Modules/FLibMath|FLibMath]] || Math functions
 
| [[Special:MyLanguage/Modules/FLibMath|FLibMath]] || Math functions
| 0.6 || GPL2 || spec_FLibMath.so || en,uk,ru,de || x86,x86_64,ARM
+
| 0.7 || GPL2 || spec_FLibMath.so || en,uk,ru,de || x86,x86_64,ARM
 
<section end=info />
 
<section end=info />
 
| Special || Roman Savochenko<br/>Maxim Lysenko (2009-2010) — the page translation || Provides a library of the standard mathematical functions.
 
| Special || Roman Savochenko<br/>Maxim Lysenko (2009-2010) — the page translation || Provides a library of the standard mathematical functions.
Line 14: Line 13:
 
__TOC__
 
__TOC__
  
Special FLibMath module provides the library of standard mathematical functions into the system.
+
The module provides OpenSCADA for a static standard mathematical functions library.
  
To address the functions of the library you can use static call address "'''Special.FLibMath.{Func}()'''" or dynamic "'''SYS.Special.FLibMath["{Func}"].call()'''", "'''SYS.Special.FLibMath.{Func}()'''". Where ''{Func}'' — function identifier in the library.
+
To address the functions of the library you can use the static call address '''Special.FLibMath.{Func}()''' or dynamic '''SYS.Special.FLibMath["{Func}"].call()''', '''SYS.Special.FLibMath.{Func}()'''. Where ''{Func}'' — function identifier in the library.
  
 
== Functions ==
 
== Functions ==
Table 1 provides a description of each function of the library. For each function the evaluation time of execution is measured. The measurement was made on a system with the following parameters: Athlon 64 3000 + (ALTLinux 3.0 (32bit)), by measuring the total time of execution of the function, while calling it 1000 times.  
+
Table 1 provides a description of each function of the library.
  
'''Table 1:''' The functions of the library of standard mathematical functions
+
'''Table 1:''' Functions of the standard mathematical functions library
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Id !! Name !! Description !! Time (micro-seconds)
+
! Identifier !! Name !! Description
 
|-
 
|-
|abs||Module||Math. function — the number module.||81
+
| abs || Absolute || Absolute math function.
 
|-
 
|-
|acos||Anti-cosine||Math. function — anti-cosine.||149
+
| acos || Arccosine || Arccosine math function.
 
|-
 
|-
|asin||Anti-sine||Math. function — anti-sine.||140
+
| asin || Arcsine || Arcsine math function.
 
|-
 
|-
|atan||Anti-tangent||Math. function — anti-tangent.||109
+
| atan || Arctangent || Arctangent math function.
 
|-
 
|-
|ceil||Rounding up to a larger||Math. function rounding up to a larger integer.||96
+
| ceil || Ceil || Math function of rounding up to the largest integer.
 
|-
 
|-
|cos||Сosine||Math. function — cosine.||93
+
| cos || Cosine || Cosine math function.
 
|-
 
|-
|cosh||Hyperbolic cosine||Math. function — hyperbolic cosine.||121
+
| cosh || Cosine hyperbolic || Cosine hyperbolic math function.
 
|-
 
|-
|exp||Exponent||Math. function — exponent.||145
+
| exp || Exponent || Exponent math function.
 
|-
 
|-
|floor||Rounding to the lower||Math. function rounding to the lower integer||95
+
| floor || Floor || Math function of rounding down to the lowest integer.
 
|-
 
|-
|if||If Condition||Condition function — "If".||92
+
| if || IF condition || Function of the type 'if'-condition.
 
|-
 
|-
|lg||Common logarithm||Math. function — common logarithm.||168
+
| lg || Decimal logarithm || Decimal logarithm math function.
 
|-
 
|-
|ln||Natural logarithm||Math. function — natural logarithm.||185
+
| ln || Natural logarithm || Natural logarithm math function.
 
|-
 
|-
|pow||Power||Math. function — involution.||157
+
| pow || Power || Power math function.
 
|-
 
|-
|rand||Random number||Math. function random number generator.||147
+
| rand || Random number || Math function of the random numbers generation.
 
|-
 
|-
|sin||Sine||Math. function — sine.||127
+
| sin || Sine || Sine math function.
 
|-
 
|-
|sinh||Hyperbolic sine||Math. function — hyperbolic sine.||199
+
| sinh || Sine hyperbolic || Sine hyperbolic math function.
 
|-
 
|-
|sqrt||The square root||Math. function — the square root.||94
+
| sqrt || Square root || Square root math function.
 
|-
 
|-
|tan||Tangent||Math. function — tangent.||153
+
| tan || Tangent || Tangent math function.
 
|-
 
|-
|tanh||Hyperbolic tangent||Math. function — hyperbolic tangent.||177
+
| tanh || Tangent hyperbolic || Tangent hyperbolic math function.
 
|}
 
|}
  
 
== User programming API ==
 
== User programming API ==
Some objects of the module provides functions for user's programming.
+
The module, as an object, provides user programming functions.
 
+
 
<section begin=API />
 
<section begin=API />
 
'''The object "Functions library" (SYS.Special.FLibMath)'''
 
'''The object "Functions library" (SYS.Special.FLibMath)'''
Line 73: Line 71:
  
 
'''The object "User function" (SYS.Special.FLibMath["funcID"])'''
 
'''The object "User function" (SYS.Special.FLibMath["funcID"])'''
* ''ElTp call(ElTp prm1, ...)'' — call the function with parameters ''<prm{N}>''. Return result of the called function.
+
* ''ElTp call(ElTp prm1, ...)'' — call the function with parameters ''prm{N}''. Return result of the called function.
 
<section end=API />
 
<section end=API />

Revision as of 10:59, 28 October 2018

Other languages:
Module Name Version License Source Languages Platforms Type Author Description
FLibMath Math functions 0.7 GPL2 spec_FLibMath.so en,uk,ru,de x86,x86_64,ARM Special Roman Savochenko
Maxim Lysenko (2009-2010) — the page translation
Provides a library of the standard mathematical functions.

The module provides OpenSCADA for a static standard mathematical functions library.

To address the functions of the library you can use the static call address Special.FLibMath.{Func}() or dynamic SYS.Special.FLibMath["{Func}"].call(), SYS.Special.FLibMath.{Func}(). Where {Func} — function identifier in the library.

1 Functions

Table 1 provides a description of each function of the library.

Table 1: Functions of the standard mathematical functions library

Identifier Name Description
abs Absolute Absolute math function.
acos Arccosine Arccosine math function.
asin Arcsine Arcsine math function.
atan Arctangent Arctangent math function.
ceil Ceil Math function of rounding up to the largest integer.
cos Cosine Cosine math function.
cosh Cosine hyperbolic Cosine hyperbolic math function.
exp Exponent Exponent math function.
floor Floor Math function of rounding down to the lowest integer.
if IF condition Function of the type 'if'-condition.
lg Decimal logarithm Decimal logarithm math function.
ln Natural logarithm Natural logarithm math function.
pow Power Power math function.
rand Random number Math function of the random numbers generation.
sin Sine Sine math function.
sinh Sine hyperbolic Sine hyperbolic math function.
sqrt Square root Square root math function.
tan Tangent Tangent math function.
tanh Tangent hyperbolic Tangent hyperbolic math function.

2 User programming API

The module, as an object, provides user programming functions.

The object "Functions library" (SYS.Special.FLibMath)

  • ElTp {funcID}(ElTp prm1, ...) — call the library function {funcID}. Return result of the called function.

The object "User function" (SYS.Special.FLibMath["funcID"])

  • ElTp call(ElTp prm1, ...) — call the function with parameters prm{N}. Return result of the called function.