Defining description, comment, JSON string or type for variables or data types
VAR | VAR_INPUT | VAR_OUTPUT | VAR_IN_OUT | VAR_GLOBAL | VAR_EXTERNAL | VAR_TEMP
name_1, name_2, ..., name_n : data-type := initial-value {
description :=
"string"
;
comment :=
"string"
;
customDataJson :=
'Json-String'
;
concreteType := data-type; (* only relevant
for
vendor blocks with
'ANY'
inputs used in other vendor blocks' *)
};
...
END_VAR
TYPE
name_A : <Datentyp-Deklaration> := initial-value {
description :=
"string"
;
comment :=
"string"
;
customDataJson :=
'Json-String'
;
};
...
name_B: STRUCT
name_e1 : type := initial-value {
description :=
"string"
;
comment :=
"string"
;
customDataJson :=
'Json-String'
;
};
...
END_STRUCT;
END_TYPE
Meaning |
||||||||||||||||||||||||||||||||||||||||||||||
specification of the following pieces of additional data (= data elements) for a →variable, a →data type or a structure element (= language element):
Implementer-specific realization According to the →IEC-standard, these data elements are an i mplementer-specific realization of a →pragma. The specification of the data elements is necessary in front of the concluding character ; of the language element but after all optional items (e.g. the →initial value). The specification starts with the character { and is terminated with the character }, each data element is terminated with the character ;. You are able to specify one, 2 or all data elements per language element. In case of 2 or 3 data elements, observe the order according to the syntax. The text for the description, comment and the JSON-string must be a character string literal within a →pragma. Character string literals in pragmas consist of zero or more characters prefixed and terminated by the single quote character ' or by the double quote character ".
You are able to directly enter special characters, such as umlauts or €, but $ excepted, within the literal in ' as well as in ". Examples:
See the glossary article "→Character string literal" for more examples on these combinations and informative links. Moreover, the following specifications are possible for character string literals in pragmas:
Moreover, the following specifications are possible for character string literals in ' as well as in ":
If you need the character " within the text for a JSON-string, best practice is to enter the text within ' (see example below). The data elements for the description, comment and JSON-string are typically evaluated by a system integrator. Within logi.CAD 3, description and comment of a variable are also visible within the interface editor. The data element for a concrete data type is only required in the case of the declaration of an →instance of a →vendor block, if this vendor block contains one or several inputs with a →generic data type and the declaration of the instance is done in a vendor block (so the vendor block with the ANY inputs is being used in another vendor block). The additional specification of concreteType and the data type data-type for an instance provides the required type information when the application is built. |
The specification of the data elements is possible within these sections:
VAR
Var1 : INT {description := "This is the long name for the variable.";
comment := "This is the comment for the variable.";
customDataJson := '{
"glossary": {
"title": "Variable (local)",
"ID": "Var1"
}
}';
};
END_VAR
VAR
Inst1 : Control {description := "This is the long name for the function block instance.";
comment := "This is the comment for the function block instance."; };
END_VAR
TYPE
complex : STRUCT
re : REAL {description := "This is the long name for the 1st structure element.";};
im : REAL {comment := "This is the comment for the 2nd structure element.";};
END_STRUCT;
END_TYPE