Changing of constant input parameters of function block instances
You can write input parameters of function block instances of type VAR_INPUT CONSTANT
in online mode and modify the parameters in this way. After logging out, you save these parameters by clicking Save Prepared Parameters to Project.
Requirement: A CFC editor is active. An instantiated function block has VAR_INPUT CONSTANT
variables in its declaration.
In the editor, open the box by calling the function block instance.
The declaration of
FB_DoIt
has been supplemented by the constantMAXIMUM
.FUNCTION_BLOCK FB_DoIt VAR_INPUT iAlfa : INT; iBravo: INT; sCharlie : STRING := 'Charlie'; xItem : BOOL; iDelta : INT; END_VAR VAR_INPUT CONSTANT MAXIMUM : INT := 12; END_VAR VAR_OUTPUT iResult : INT; sResult : STRING; xResult : BOOL; END_VAR
The graphical representation of the function block instances contains the Parameters button.
Log in to the controller.
Click the Parameters button of the function block instance.
The Edit Parameters dialog opens.
Click the Value column in an inline monitoring field of a parameter.
The Prepare Value dialog opens.
Type
20
in the Prepare a new value for the next write or force operation field.Click OK to confirm the entry.
The prepared value is shown in angle brackets next to the current value. Example:
<20>
Click
.The prepared value is written. The parameter is changed and displayed in the project in brackets after the value.
The difference between both values is shown by a red asterisk next to the parameter field of the function block instance.
Click Edit Parameters to close the dialog. Log out.
Click
.The change parameter value is saved to the project. The asterisk next to the parameter field disappears.