Check timeout on an SFC step

SFCClosed"Sequential function chart" It can be used to program processes that can be split into steps. The main components of SFC are: - Steps with associated actions - Transitions with associated logic conditions - Directed links between steps and transitions step implicitly contains a timer, so you do not need to add any timer function.

Figure 7-60: SFC Time Diagram - Timer vs Step Activation

The system can check timeout on any SFC step activity duration. For that, you need to enter the following instruction in the main "Action" list of the step:

__StepTimeout ( timeOut , errString );

Where:

timeout is a time constant or a time variable specifying the timeout duration
errString is a string constant or a string variable specifying the error message to be output

At runtimeClosedIn computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). Within KAS, runtime also refers to the virtual machine that manage the program written in a computer language while it is running, each time the activation time of the step becomes greater than the specified timeout:


  • You can also put this statement within a "#ifdef __DEBUG" test so that timeout checking is enabled only in debug mode.

Alternatively, if you need to make more specific handling of timeouts, you can enter the following STClosed"Structured text" A high-level language that is block structured and syntactically resembles Pascal program in the "N" action block of the step:

if GSn.T > timeout then /* 'n' is the number of the step */
...statements...
end_if;