Check timeout on an SFC step
Figure 8-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 runtimeIn 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:
- The error string is sent to the KAS IDE"Integrated development environment" An integrated development environment is a type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debuggerand displayed in the Log window
- The transition is not passed
-
-
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 ST"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;