Skip to main content

run

Short Summary

A method that should be called cyclically to update and execute a class instance.

Parameters

none

Code

Declaration

METHOD run
VAR
currentSafetyState :BOOL;
END_VAR

Implementation

currentSafetyState := THIS^.SafetyIsOk;
IF currentSafetyState <> THIS^.lastSafetyState THEN
THIS^.iterator.reset();
WHILE THIS^.iterator.moveNext() DO
IF currentSafetyState THEN
THIS^.iterator.switchOn();
ELSE
THIS^.iterator.switchOff();
END_IF
END_WHILE
THIS^.lastSafetyState := currentSafetyState;
END_IF