Command Edit Parameters
Function: The command opens the "Edit Parameters" dialog, in which you can change the constant input parameters of a function block.
Call: Menu CFC > Edit parameters, context menu > Edit parameters, click on function block field Parameter.
Requirements: A CFC editor is active. A function block is instantiated, which has VAR_INPUT CONSTANT variables in its declaration.
A function block with VAR_INPUT CONSTANT variables is indicated by TwinCAT by the word "Parameter" in the lower left corner of the function block.
Dialog Edit Parameters
Parameter | Name of the variable |
Type | Data type of the variable |
Value | Click in the field to enter a value. |
Initial value | Initialization value |
Category | Additional information about the parameters. These values are defined by attributes and cannot be changed in this dialog
|
Unit | |
Min | |
Max | |
Delete prepared parameters | The command is active if you have written a prepared value (command Debug > Write values) |
After exiting the field and exiting the dialog with OK, the value changes are applied to the project.
Example of a function block with constant inputs:
FUNCTION_BLOCK FB_Sample
VAR_INPUT CONSTANT
{attribute 'parameterCategory':='General'}
{attribute 'parameterUnit':= 'm/s'}
{attribute 'parameterMinValue':= '0'}
{attribute 'parameterMaxValue':= '100'}
nIn1 : INT;
nIn2 : DWORD:=24354333;
sIn3 : STRING:='abc';
END_VAR
This functionality and the declaration of variables with the keyword VAR_INPUT CONSTANT only apply to the CFC editor. In the FBD editor, TwinCAT always shows all input parameters at the function block, irrespective of whether they are declared as VAR_INPUT or VAR_INPUT CONSTANT. Also, TwinCAT does not distinguish between text editors. |
See also:
- Command Save prepared parameters in the project
- PLC documentation: CFC editor in online mode