PLC task definition

A controller may execute one or more tasks, based on the capabilities of the platform selected:

A proper task setting will optimize the computing performance of the PLC. For fast process control, such as pressure control in hydraulic systems, fast controller response is expected, and therefore Freewheeling task type should be defined. For not so critical control tasks, like room temperature control where the control response is in minutes or slower, the Cyclic task type will be used. The last option is Event task type. It is launched by an event and thus well suitable for e.g. parts of technology which need not to be controlled at all under circumstances.

Freewheeling means that the task will be executed as frequently as possible. The Sleep ratio gives time of waiting at the next computing cycle. The time is entered as a ratio of the computing cycle time. Thus, after the first cycle the controller measures the time of task execution, and the next cycle is started after the Sleep time expires. If one computing cycle takes 10 ms and the Sleep ratio is set to 30 %, the controller will wait 3 ms to start the next cycle after the previous cycle has been finished.

When set as Cyclic, the task is executed on a periodical basis. The period is set in ms. For longer periods, the ST syntax can be used: e.g. to set a period of 2h and 30 min, enter the coded time „t#2h30m“ rather than „8400000“.

The Event setting offers a conditional task execution. The task is executed either once only at the rising or falling signal edge of a particular variable, or it is executed periodically  based on the signal level of 1 or 0 (high level, low level).

Click to a PLC controller. In the PLC editor, select the Tasks tab in the lower part of the window. Right click to the working area and select Add task. In the line generated, click to Program mapping, choose the program that shall be assigned to the task, click Add and click OK.

Select Freewheeling in the Type column. A red line is displayed in the lower part of the editor, indicating that a change has to be confirmed. Click OK.