Introduction

Syntax and semantics check is performed directly when creating the program.

The result of this check is displayed in three formats:

  • directly in the program section with colored text

  • as tooltip if the cursor is placed on incorrect text.

  • In the output window, if Generate > Analyze is selected.

Representation

Representation of colors and labels:

Labeling

Description

Example

blue

Keyword (e.g. LD, AND, ST,...)

Note: Function block input operators (see also section Input operator requirements in the Reference manual) are not treated as keywords.

red

Operators (that are not keywords)

green

Comment

black

standard text (e.g. variable, address, label, ...)

bold

The name of DFBs and subroutines are shown in boldface to identify that these objects can be refined.

underlining

In DFB sections, the formal parameters of the DFBs are shown underlined.

red wavy line

Faulty text:

  • Syntax error

    e.g. spelling errors in keywords, non-declared variables or FB instances, incorrect block call, unvailable block call (in the current PLC plateform or in the library types), EFB type call instead of the instance,...

  • Semantic error

    e.g. division by zero, value range exceeded/underflow (recognized by the system when entered)

Inverted text

Text is selected

Tooltips

If the cursor is placed over incorrect text, the tooltip is displayed with a brief description of the cause of the error. It will also be displayed in the output window after the analysis.

Error messages in the output window

Error message: Accessed object is not a function.

Cause of error

Error Correction

Example

Write error is present during accessing of a function.

Correct the write error.

Wrong:

Right:

Name of the function was already used for:

  • one variable

  • an FB instance

  • a DFB Type

  • an SR Section

  • a procedure or function in a user library

Rename the already used object.

-

Wrong syntax used during access

  • an FB

Correct the syntax.

Wrong:

Right:

Wrong:

Right:

Error message: Accessed object is not a function block.

Cause of error

Error Correction

Example

Write error is present during accessing.

  • an FB

Correct the write error.

Wrong:

Right:

Name of the function was already used for:

  • one variable

  • an FB instance

  • a DFB Type

  • an SR Section

  • a procedure or function in a user library

Rename the already used object.

-

Function block instances that are not defined in the data editor.

Define the FB on the data editor.

-

EFB that is not available for the current PLC platform.

Change the EFB.

-

An EFB that is not in the libset of the current project.

Update the libset.

-