Suppressing warnings for the validation

It is possible to suppress warnings for rule violations regarding ST-code when the application is validated. For this purpose insert the specification {suppressWarning} in front of the concernced POU or data type within the ST-object.

Syntax
(* syntax for a POU *)
{suppressWarning modelRuleNamespace.modelRuleId('reason for suppression'), scope:=element|file}
PROGRAM name1 | FUNCTION_BLOCK name2 | FUNCTION name3
...
END_PROGRAM | END_FUNCTION_BLOCK | END_FUNCTION
 
(* syntax for a data type *)
TYPE
{suppressWarning modelRuleNamespace.modelRuleId('reason for suppression'), scope:=element|file}
name4 : ...;
END_TYPE

Meaning

suppress a warning for the following element, if a rule violation for this element is detected when validating the application and this rule violation would be reported as warning
Statements for suppressing warnings are provided as an enhancement to the →IEC-standard.

The statement {suppressWarning} can be inserted in front of these ST-elements:

Syntax:

  • modelRuleNamespace.modelRuleId must be the fully qualified name of an existing rule. Best practice is to copy the following example into the ST-editor and to use the content assist after suppressWarning in order to replace the fully qualified name from the example. The content assist lists the name and ID for each provided rule.

  • The reason for the suppression must be specified after the ID and within (). This reason is a STRING literal with 255 characters at most. Details on STRING literals: see under →character string literal

  • The optional keyword scope defines the scope. These values are supported:

    • element – The warning is suppressed, if logi.CAD 3 detects a rule violation for the concerned element (e.g. the function block). element is the default value and is applied without specified key word scope.

    • file – The warnings are suppressed, if logi.CAD 3 detects a rule violation for all elements declared in the file (e.g. all functions blocks and functions in the file).

Restriction: If a rule refers to a file, the value element will not have any effect. Just define scope:=file for such rules.
Example: The rule ST-objects may only contain elements with the name of the ST-object on the top level will examine the entire ST-object (hence the rule refers to a file). Subsequently, the specification scope:=element for this rule will have no effect.

See "Rules for the validation of an application", whether you are able to suppress warnings for a rule and/or if you need information on the scope of individual rules.

It is not possible to

Example for suppressing a warning regarding a function block within ST-object 'Test'
{suppressWarning com.logicals.mrc.rules.ModelRuleStObjWithResNameOnly('The function block must have a different name than the ST-object.'), scope:=file}
FUNCTION_BLOCK Control
...
END_FUNCTION_BLOCK

Consequences of the statement {suppressWarning} for the concerned POU or data type:

  1. The rule violation will not be listed as warning in the ST-editor or the Problems view anymore but as information.

  2. When the application is validated, the suppressed warning will be listed in the generated report.