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.
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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
Description of the rule

Possible for "Active" (1)

Possible
severity (1)

Possible type (1)

Scope (2)

Language (4)

IEC 61131-3 portability rule

C-blocks must only be contained in libraries.
This model rule checks whether the used →C-blocks are contained in libraries. Other C-blocks are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def) (3)

ERROR (def),
WARNING

FAST (def),
NORMAL

file

all

IEC 61131-3 design rule

The usage of expressions in value fields is restricted to literals, constants or variables.
This model rule checks the usage of →expressions in →value fields . Only →literals, →constants or →variables can be used, other expressions are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR (def),
WARNING

FAST (def),
NORMAL

not relevant

FBD

IEC 61131-3 design rule

The usage of blocks is restricted either completely or only for defined types.
This model rule is configurable to restrict the use of →blocks or their allowed types.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

not relevant

all

IEC 61131-3 design rule

Direct lines across pages must not be used.
This model rule checks whether there are direct lines across the pages. Such lines are reported.

See under " Automatic routing of lines " for information when logi.CAD 3 creates such direct lines.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR, INFO,
WARNING (def)

FAST,
NORMAL (def),
EXPENSIVE

not relevant

FBD

IEC 61131-3 design rule

Direct lines on the same page must not be used.
This model rule checks whether there are direct lines on the same page. Such lines are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR, INFO,
WARNING (def)

FAST,
NORMAL,
EXPENSIVE (def)

not relevant

FBD

IEC 61131-3 design rule

Inputs must be positioned on the left block edge, outputs on the right one.
This model rule checks on which block edge the inputs/outputs are positioned. The rule reports inputs not positioned on the left block edge and outputs not positioned on the right block edge.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

NORMAL (def),
EXPENSIVE

not relevant

ST, FBD

IEC 61131-3 design rule

Inputs and outputs must not be negated.
This model rule checks for negated in-/outputs and reports them.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

FAST (def),
NORMAL,
EXPENSIVE

not relevant

FBD

IEC 61131-3 design rule

Elements in an interface of function blocks and functions must not overlap.
This model rule checks whether elements in the interface of →function block and →functions overlap.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR (def),
WARNING

FAST (def),
NORMAL

not relevant

FBD

IEC 61131-3 design rule

Connectors or continuations must not be used.
This model rule checks if →connectors or →continuations are used.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR (def),
WARNING

FAST (def),
NORMAL

not relevant

FBD

IEC 61131-3 design rule

Instances of function blocks must not be called multiple times.
This model rule checks whether→instances of function blocks are called →called multiple times.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR (def),
WARNING

FAST (def),
NORMAL

file

all

IEC 61131-3 design rule

Each program must be assigned to a task.
This model rule checks whether each program type is assigned to a task. Other program types are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
WARNING (def)

FAST,
NORMAL (def)

element

all

IEC 61131-3 design rule

Negations of unconnected block inputs are not allowed.
This model rule checks whether there are negations of block inputs, if these inputs are not connected. Such block inputs are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

FAST (def),
NORMAL,
EXPENSIVE

not relevant

FBD

IEC 61131-3 design rule

A connector must be connected to a source.
This model rule checks whether a →connector is connected to a source. If not, the connector is reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

not relevant

FBD

IEC 61131-3 design rule

Only identifiers conform to predefined specifications must be used for projects/folders/objects.
This model rule checks whether the names of projects/folders/objects are conform to predefined specifications. See "Predefined specifications for names of projects/folders/objects" for more information on these specifications.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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.
Identifiers of folders are only checked, when the command to start the validation is selected.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

EXPENSIVE

not relevant

all

IEC 61131-3 design rule

Lines leading from right to left must not be used.
This model rule checks whether lines leading from right to left are used. Such lines are reported.
Note: Connections via →connectors and →continuations are not checked by this rule.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR, INFO,
WARNING (def)

FAST,
NORMAL (def),
EXPENSIVE

not relevant

FBD

IEC 61131-3 design rule

Namespaces of language elements must match the identifier of the parent namespace folder.
This model rule checks whether the →namespaces of all language elements match the identifier of the parent namespace folder. Deviations are reported. If there is no namespace folder for the language elements, no deviations are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def) ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR,
INFO,
WARNING (def)

FAST,
NORMAL (def)

not relevant

all

IEC 61131-3 design rule

Namespace folders need a unique identifier.
This model rule checks whether there are two or more namespace folders with the same identifier. Deviations are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def) ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR,
INFO,
WARNING (def)

FAST,
NORMAL (def)

not relevant

all

IEC 61131-3 design rule

ST-objects must not contain more than one element on the top level.
This model rule checks whether ST-objects contain more than one element on the top level of the ST-object. Such ST-objects are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Such elements are e.g. →POUs, →data types or →interfaces.


images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

NORMAL (def),
EXPENSIVE

file

ST

IEC 61131-3 design rule

ST-objects may only contain elements with the name of the ST-object on the top level.
This model rule checks whether the name of elements (declared on the top level within an ST-object) is matching the name of this ST-object. Elements with other names are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Such elements are e.g. →POUs or →interfaces. Please observe: This rule is not applied for user-defined →data types in ST-objects.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

NORMAL (def),
EXPENSIVE

file

ST

IEC 61131-3 design rule

Illegal elementary data types must not be used.
This model rule checks whether illegal →data types are used. The usages of such data types are reported as illegal.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg ,
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg (def)

ERROR,
INFO,
WARNING (def)

FAST, NORMAL (def),
EXPENSIVE

element

all

IEC 61131-3 usage rule

Number of resources per platform is limited.
This model rule checks if the maximum number of →resources is exceeded for a platform.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

not relevant

IEC 61131-3 usage rule

References to local variables must not be used in functions/methods.
This model rule checks whether references to local variables are used in functions/methods. Such references to local variables are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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:
→References to local, temporary →variables can be used in →functions / →methods .

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".

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

element

ST, FBD

IEC 61131-3 usage rule

An output of a function block must not be assigned to a VAR_IN_OUT variable
This model rule checks whether there are assignments from an output of a →function block to a VAR_IN_OUT variable. Such assignments are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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): →Assignments from an output of a →function block to a VAR_IN_OUT variable (= →in-out variable) are allowed.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST,
NORMAL (def),
EXPENSIVE

element

all

IEC 61131-3 usage rule

Assignments to output variables of a function block are not allowed outside of function blocks.
This model rule checks whether there are →assignments to output variables (= VAR_OUTPUT) of a function block outside of function blocks. Such assignments are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

element

ST, FBD

IEC 61131-3 usage rule

Assignments to input variables within the POUs are not allowed.
This model rule checks whether there are →assignments to →input variables within →function blocks. Such assignments are reported. Exceptions are assignments to →reference variables within function blocks because they are always allowed.
Assignments to input variables within →functions are never allowed in general. Again, exceptions are assignments to reference variables because they are always allowed in functions as well.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg 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.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg In logi.CAD 3, assignments to input variables of →programs are not possible at all. Hence, this rule is neither applied to such assignments .

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR (def),
INFO,
WARNING

FAST (def),
NORMAL,
EXPENSIVE

element

ST, FBD

The following rule is not provided in all variants of logi.CAD 3:

Rule group

Name of the rule
Description of the rule

Possible for "Active" (1)

Possible
severity (1)

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.
This model rule checks whether the library configurations of library type LOGISAFE and/or LOGIWEB only uses library elements that are conform to the requirements. Other library elements are reported.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Information on the requirements for the library elements can be found under "Peculiarities for logi.SAFE/logi.WEB libraries".
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg This rule is .

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg (def),
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

ERROR

NORMAL (def),
EXPENSIVE

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:

Example for 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.

LVL

The rule is applied to objects that corresponds to the limitations of the →LVL workflow.

The rule is not applied to any ST-objects, FBD-objects or LD-objects .