Introduction

A program can be built from:

  • Tasks, that are executed cyclically or periodically.

    Tasks are built from:

    • Program Units (only for Modicon M580 and M340)

    • Sections

    • Subroutines

  • Event processing, that is carried out before all other tasks.

    Event processing is built from:

    • Sections for processing time controlled events

    • Sections for processing hardware controlled events

Example of a program:

Tasks

Control Expert supports multiple tasks (Multitasking).

The tasks are executed in parallel and independently of each other whereby the execution priorities are controlled by the PLC. The tasks can be adjusted to meet various requirements and are therefore a powerful instrument for structuring the project.

A multitask project can be constructed from:

  • A Master task (MAST)

    The Master task is executed cyclically or periodically.

    It forms the main section of the program and is executed sequentially.

  • A Fast task (FAST)

    The Fast task is executed periodically. It has a higher priority than the Master task. The Fast task is used for processes that are executed quickly and periodically.

  • One to four AUX task(s))

    The AUX tasks are executed periodically. They are used for slow processing and have the lowest priority.

The project can also be constructed with a single task. In this case, only the Master task is active.

Event Processing

Event processing takes place in event sections. Event sections are executed with higher priority than the sections of all other tasks. They are suited to processing that requires very short reaction times after an event is triggered.

The following section types are available for event processing:

  • Sections for processing time controlled events (Timerx Section)

  • Sections for processing hardware controlled events (Evtx Section)

The following programming languages are supported:

  • FBD (Function Block Diagram)

  • LD (Ladder Diagram Language)

  • IL (Instruction List)

  • ST (Structured Text)

Program Units

Program Units are autonomous programs in which the logic of the project is created.

The Program Units are executed in the order shown in the project browser (structural view).

A Program Unit is connected to a task. The same Program Unit cannot belong to more than one task at the same time.

The Program Unit includes:

  • Public and local variables

  • Sections

    The following programming languages are supported:

    • FBD (Function Block Diagram)

    • LD (Ladder Diagram Language)

    • SFC (Sequential Function Chart) only for sections in Program Unit which belongs to the MAST task

    • IL (Instruction List)

    • ST (Structured Text)

  • Animation tables

Sections

Sections are autonomous programs in which the logic of the project is created.

The sections are executed in the order shown in the project browser (structural view).

A section is connected to a task. The same section cannot belong to more than one task at the same time.

The following programming languages are supported:

  • FBD (Function Block Diagram)

  • LD (Ladder Diagram Language)

  • SFC (Sequential Function Chart) only for sections in MAST task

  • IL (Instruction List)

  • ST (Structured Text)

Subroutine

Subroutines are created as separate units in subroutine sections.

Subroutines are called from sections or from another subroutine.

Nesting of up to 8 levels is possible.

A subroutine cannot call itself (not recursive).

Subroutines are assigned a task. The same subroutine cannot be called by different tasks.

The following programming languages are supported:

  • FBD (Function Block Diagram)

  • LD (Ladder Diagram Language)

  • IL (Instruction List)

  • ST (Structured Text)