Introduction
In addition to inputs/outputs, some function blocks also provide public variables.
These variables transfer statistical values (values that are not influenced by the process) to the function block. They are used for setting parameters for the function block.
The assignment of values to public variables is made via their initial values or assignments.
Public variables are read via the instance name of the function block and the names of the public variables.
Assigning values using the initial value
Process the following steps to assign values using the initial value:
Step |
Action |
---|---|
1 |
Call the function block for whose public variable you want to assign a value, see also Calling an FFB. |
2 |
Open the data editor, see also Data Editor Access. |
3 |
Select the tab.Result: The function block instances are displayed. ![]() |
4 |
Expand the display of the public variables by clicking the respective + symbols. Result: You can now see all available public variables of the function block. ![]() |
5 |
Enter the desired value for the public variable in the box. |
Assigning values using the assignment operator
Process the following steps to assign values using the assignment operator:
Step |
Action |
---|---|
1 |
Call the function block for whose public variable you want to assign a value, see also Calling an FFB. |
2 |
Call the public variable, see also Using formal parameters. For example:
|
3 |
Assign a value to the public variable. For example:
|