Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

TASK

A task defines the scheduling of program execution within a resource.

IEC 61131-3

Section 2.7.2

Support

Supported

Syntax

TASK task_name ( INTERVAL := time_value , PRIORITY := integer_value ) ;

Parameters

Parameter

Type

Description

INTERVAL

TIME

Execution interval (cycle time)

PRIORITY

INT

Task priority (0 = highest)

Example

RESOURCE DefaultResource ON PLC
    TASK MainTask(INTERVAL := T#20ms, PRIORITY := 1);
    TASK FastTask(INTERVAL := T#5ms, PRIORITY := 0);

    PROGRAM main WITH MainTask : MainProgram;
END_RESOURCE

Programs are associated with tasks using the WITH keyword. A task executes its associated programs at the specified interval.

See Also