CFC element function block
Symbol:
You can use the element to insert an operator, a function, a function block or a program. By default, TwinCAT adds the element with the name ???. You can edit this field directly by clicking on it and enter a function block name. Alternatively, you can open the input assistant by clicking and select a function block.
In the case of a function block, TwinCAT also displays an input field above the function block symbol (???). You have to replace this name with the name of the function block instance. If you instantiate a function block with constant input parameters, the function block element displays the field Parameter... in the lower left corner. You can edit the parameters by clicking on this field.
To replace an existing box, simply replace the currently inserted identifier with the desired new name. Note that TwinCAT adapts the number of input and output pins according to the definition of the POU and therefore deletes any existing assignments.
As in the CFC feedbacks are allowed, implicit variables with data type of the input variables are generated at the output of a function block (in the sample |
Sample
Implicitly generated variables at the function block output:
Implicitly generated code:
temp_USINT := USINT1 * temp_USINT;
UDINT1 := temp_USINT;
See also:
- TC3 User Interface documentation: Command Edit Parameters