Rules for the validation of an application
The following rules for the validation of an application are included in the standard package of logi.CAD 3.
If it is not possible to change one of these rules in your logi.CAD 3-Version (as specified in the following), the configuration of this rule has been changed by the system integrator.
Rule group |
Name of the rule |
Possible for "Active" (1) |
Possible |
Possible type (1) |
Scope (2) |
Language (4) |
IEC 61131-3 portability rule |
C-blocks must only be contained in libraries. |
, |
ERROR (def), |
FAST (def), |
file |
all |
IEC 61131-3 design rule |
The usage of blocks is restricted either completely or only for defined types. Restriction: Currently the blocks and their allowed types cannot be defined in the graphical user interface but only in the file configuring the model rule. Without a modified file configuring the model rule, it does not make sense to apply this rule at the moment. |
, |
ERROR (def), |
FAST (def), |
not relevant |
all |
IEC 61131-3 design rule |
Direct lines across pages must not be used. See under " Automatic routing of lines " for information when logi.CAD 3 creates such direct lines. |
(def), |
ERROR, INFO, |
FAST, |
not relevant |
FBD |
IEC 61131-3 design rule |
Direct lines on the same page must not be used.
If you change the preset type from
EXPENSIVE
to
NORMAL
or
FAST
, it is possible that the memory consumption increases when importing projects with FBD-objects or opening FBD-objects respectively. Likewise, there might be delays when scrolling within an FBD-object. |
(def), |
ERROR, INFO, |
FAST, |
not relevant |
FBD |
IEC 61131-3 design rule |
Inputs must be positioned on the left block edge, outputs on the right one. |
, |
ERROR, |
NORMAL (def), |
not relevant |
ST, FBD |
IEC 61131-3 design rule |
Inputs and outputs must not be negated. |
, |
ERROR, |
FAST (def), |
not relevant |
FBD |
IEC 61131-3 design rule |
Each program must be assigned to a task. |
, |
ERROR, |
FAST, |
file |
all |
IEC 61131-3 design rule |
Negations of unconnected block inputs are not allowed. |
, |
ERROR, |
FAST (def), |
not relevant |
FBD |
IEC 61131-3 design rule |
A connector must be connected to a source. This rule is also applied to a block input that is connected with a connector without a source. When the rule is activated, such constructs are reported with the message Expression has no return value while other connectors without a source are reported with the message Connector name is not connected to any source. This is in conflict with a rule . When the rule is deactivated, both messages are not reported. |
(def), |
ERROR (def), |
FAST (def), |
not relevant |
FBD |
IEC 61131-3 design rule |
Only identifiers conform to predefined specifications must be used for projects/folders/objects.
An identifier of an object or a project is already checked when the object/project is created in the project explorer. Subsequently, the name entered in the dialog must be conform to the predefined specifications. |
, |
ERROR, |
EXPENSIVE |
not relevant |
all |
IEC 61131-3 design rule |
Lines leading from right to left must not be used. |
, |
ERROR, INFO, |
FAST, |
not relevant |
FBD |
IEC 61131-3 design rule |
Namespaces of language elements must match the identifier of the parent namespace folder. |
(def) , |
ERROR, |
FAST, |
not relevant |
all |
IEC 61131-3 design rule |
Namespace folders need a unique identifier. |
(def) , |
ERROR, |
FAST, |
not relevant |
all |
IEC 61131-3 design rule |
ST-objects must not contain more than one element on the top level. Such elements are e.g. →POUs, →data types or →interfaces. |
, |
ERROR, |
NORMAL (def), |
file |
ST |
IEC 61131-3 design rule |
ST-objects may only contain elements with the name of the ST-object on the top level. Such elements are e.g. →POUs or →interfaces. Please observe: This rule is not applied for user-defined →data types in ST-objects. |
, |
ERROR, |
NORMAL (def), |
file |
ST |
IEC 61131-3 design rule |
Illegal elementary data types must not be used. Best practice how to get information which data types are illegal: Select this rule in the property page Validation or in the dialog Configure Validation for resource and check the content of the field Details. |
, |
ERROR, |
FAST, NORMAL (def), |
element |
all |
IEC 61131-3 usage rule |
Number of resources per platform is limited. |
(def), |
ERROR (def), |
FAST (def), |
not relevant |
– |
IEC 61131-3 usage rule |
References to local variables must not be used in functions/methods.
If you deactivate the rule
, logi.CAD 3 deviates from the →IEC-standard. As a consequence of the deactivation, this enhancement is valid for logi.CAD 3:
Here, "local, temporary variables" identifies the variables for which a temporary memory is assigned while the function/methods is executed. Hence, the following variables are affected:
Moreover, observe that it is possible to implement constructs leading to invalid memory accesses. Such constructs are not detected by logi.CAD 3 . Hence, avoid appropriate constructs. See "Example for a problematic access". |
(def), |
ERROR (def), |
FAST (def), |
element |
ST, FBD |
IEC 61131-3 usage rule |
Connections from an output of a function block are not allowed to a VAR_IN_OUT variable. If you deactivate the rule , logi.CAD 3 deviates from the →IEC-standard. As a consequence of the deactivation, this enhancement is valid for logi.CAD 3 (for FBD): Connections (= lines) from an output of a →function block to a VAR_IN_OUT variable (= →in-out variable) are allowed. |
(def), |
ERROR (def), |
FAST, |
element |
all |
IEC 61131-3 usage rule |
Assignments to output variables of a function block are not allowed outside of function blocks. If you deactivate the rule , logi.CAD 3 deviates from the →IEC-standard. As a consequence of the deactivation, this enhancement is valid for logi.CAD 3: →Output variables (= VAR_OUTPUT) of →function block instances can be written to outside of the function block. |
(def), |
ERROR (def), |
FAST (def), |
element |
ST, FBD |
IEC 61131-3 usage rule |
Assignments to input variables within the POUs are not allowed. If you deactivate the rule , logi.CAD 3 deviates from the →IEC-standard. As a consequence of the deactivation, this enhancement is valid for logi.CAD 3 (FBD): →Input variables can be written to inside of →function blocks.
In
logi.CAD 3, assignments to input variables of
→programs
are not possible at all. Hence, this rule is neither applied to such assignments
. |
(def), |
ERROR (def), |
FAST (def), |
element |
ST, FBD |
The following rule is not provided in all variants of logi.CAD 3:
Rule group |
Name of the rule |
Possible for "Active" (1) |
Possible |
Possible type (1) |
Scope (2) |
Language (4) |
IEC 61131-3 usage rule |
Library configurations of type "LOGISAFE" and/or "LOGIWEB" must only contain elements that are allowed for this type.
Information on the requirements for the library elements can be found under "Peculiarities for logi.SAFE/logi.WEB libraries". |
(def), |
ERROR |
NORMAL (def), |
not relevant |
– |
Notes on the tables:
(1) The setting can be changed in the property page Validation and/or in the dialog Configure Validation for resource. Details: see "Changing the configuration of rules". This article also describes the meaning of the severities and types.
(2) The scope is relevant, if you want to suppress warnings for this rule. Details: see "Suppressing warnings for the validation".
The entry "not relevant" indicates that the warnings cannot be suppressed for this rule.
(3) (def) = (default); When restoring the default values in the property page Validation or in the dialog Configure Validation for resource, logi.CAD 3 resets the rules to the setting labeled with "(def)" in the table.
Restriction
The presettings of rules can only be modified in the file configuring the model rule.
If you want to adapt the files for the model rules, contact logi.cals and ask for the appropriate information from the English documentation "logi.CAD 3 administrator's manual".
The following ST-code is not highlighted as faulty due to the deactivated rule References to local variables must not be used in functions/methods although the code contains a problematic access:
(* The function returns a reference to a variable that - after the function call - is not provided anymore. Note: Functions do not store their state *)
FUNCTION MyFun : REF_TO INT
VAR
Var1 : INT;
END_VAR
MyFun := REF(Var1);
END_FUNCTION
(4)
The column "Language" informs to which language elements the rule is applied during the validation:
Item |
Meaning |
all |
The rule is applied to ST-objects, FBD-objects and LD-objects. |
ST |
The rule is applied to ST-objects. |
FBD |
The rule is applied to FBD-objects. |
– |
The rule is not relevant for ST-objects, FBD-objects or LD-objects . |