Function generator
Function block for user defined mathematical functions.
The basic arithmetical operations and brackets can be used in the function:
* Multiplication
/ Division
% Modulo-Division (only integer data types)
+ Addition
- Subtraction
( ) Brackets
The elements of the input vector and constants serve as operands. The index of the first vector element is 0.
Thus a 2nd order polynomial could be defined as following:
y=(x0-2)*(x0+3.4)
If the input dialog is closed with OK, the block checks the function for possible errors. Messages are shown in the message window.
Parameters
Through the parameter dialog the data type can be assigned. Additionally, a short description about the appearance in the function block as well as the actual mathematical function can be entered.
Signals
Name | I/O | Type(s) | Function |
---|---|---|---|
X | I | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Input vector |
Y | O | UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Result value |
Visualization
The given name will be displayed in the function block.
If the input vector includes less elements than used in the defined function, the symbol will be depicted in red in run mode.
Comment
If no connection exists, another data type for a block can be assigned by creating a new connection.
If the data type is changed by the parameter dialog, all invalid input and output connections will be deleted.