Mathematical library

Category: Descriptions of the functional blocks
Published on Tuesday, 27 May 2014 19:35
Written by AltonaLab
Hits: 1538

Block ExpressionOneIn

License: Hobby, Industrial

This block is very powerful for mathematical operations. It has a parameter Expression,which connect mathematecaly the output Y with input X. It is important the input X to be presented in expression. Examples for expression:

3.14*X

((2+X)*10)/2.5

The expression can include the existing in application functions. For example:

3*(sin(x)+log(2*x))

Some of the functions have more than one parameters. The function Equal has four parameters:

Equal(X1;X2;Res1;Res2)

It compares paramaters X1 and X2 and in case they are equal, the function will return result Res1, in other case will return Res2;

The list of existing functions is:

Block's inputs:

Block's outputs:

 

Block ExpressionUni

License: Hobby, Industrial

In case the user needs more Expression blocks, then ExpressionUni is suitable. Every output Y1 .. Y8 has independent expression, which is presented as parameter ExpressionY1 .. ExpressionY8.  The other trick here is that every output can be related with one or more inputs. For example, if parameter ExpressionY1, which correspond to output Y1 has a string X1+2*X2+sin(X3), then the output Y1 is related to inputs X1, X2, X3.

The block has parameter InOut, which opens GPIO interface and allows some inputs and outputs to be hiden. The supported mathematical functions are the same as in the block ExpressionOneIn and are described above.

Parameters:

 Block's inputs:

Block's outputs:

 

Block AverageVal

License: Hobby, Industrial

The output Y of the block returns the average value of last few inputs X values of the block. The parameter QueueSize determines the average value of how many values of input X to be calculated. For example, if the parameter QueueSize is 3 and last 3 values of input X were: 3.0, 3.4, 3.8, then the output Y will be (3.0+3.4+3.8)/3 = 3.4.

The block is suitable for filtering signals with noise. The QueueSize can be up to 200 values.

If the input Process is connected, then passing in a high level, the current value of the inputs X will be added to the queue of values on which the block will calculate the average. 

 

Block AverageValAngle

License: Hobby, Industrial

The block calculates the average value of an angle input. The needful calculation at this case is more complicated than of the block AverageVal. For example if we need to calculate an average value for last 10 measured values from wind direction sensor, we can do it with this block.

Block's parameters:

Block's inputs:

 

Block Approximation

License: Hobby, Industrial

The block is suitable for converting non-linear relationship between input and output signals. Parameter Setings opens interface where to introduce the correlation table. If the user needs to convert several signals through the same table, then Number of approximations in settings interface has to be set. The example is a relation between distance and output voltage of sensor: Sharp GP2Y0A21YK0F 10-80 sm.