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.

Illustration in the program section

Representation of colors and labels:

Labeling

Description

Example

blue

Keyword (e.g. IF, FOR, WHILE,...)

Note: IL specific keywords (e.g. LD, CAL, ST) are not keywords in ST, but are still labeled as such for technical reasons.

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

  • a procedure

  • an SR Section

Correct the syntax.

Wrong:

Right:

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

  • a procedure

  • an SR Section

Correct the write error.

Wrong:

Right:

Wrong:

Right:

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.

-

Wrong syntax used during access.

  • a function

  • a function block

Correct the syntax.

Wrong:

Right:

Wrong:

Right:

Wrong:

Right: