Controlled stop of runtime
Function name
STOPINTERFACEENTRYPOINT
ST call
PROGRAM TEST_STOPINTERFACEENTRYPOINT VAR waitforstop : bool; time_out : time; stopacknowledge : bool; enable : bool; END_VAR IF enable THEN STOPINTERFACEENTRYPOINT(waitforstop, time_out,stopacknowledge); END_IF; END_PROGRAM
Description
The function controls safe termination of a technological process when the runtime is stopped. The runtime stop is postponed until conditions for safe process termination are met.
Inputs
Input | Type | Description |
waitforstop | BOOL | The safe process termination function is active (if waitforstop = true, the runtime will wait for signal from the running application at stopping) |
timeout | TIME | Safe limit (30 seconds is maximum time that the runtime is waiting for safe process termination indication – after expiration the runtime stops regardless of the stopacknowledge value) |
stopacknowledge | BOOL | Indication of safe process termination (stopacknowledge = true) |
Outputs
Output | Type | Description |
⇒ | BOOL | Terminating state (⇒ = true, there is request to stop the runtime) |
onlinechanges | BOOL | There will be on-line changes executed (process termination is not required) |
Function
If the input variable waitforstop goes to true, the PLC runtime will not be stopped immediately after receiving the stop request (e.g. from IDE). It waits for one of the two events:
- setting stopacknowledge to true, which is how the program tells the runtime that the conditions for safe process termination were completed and the runtime can be stopped now
- expiration of the timeout, which is the maximum waiting time for the process termination. After expiration the runtime stops even if stopacknowledge is still false. As soon as the runtime receives a request for stop, the function output sets to true. The runtime, however, keeps running. Through the function output, the program „learns“ that there is a runtime stop request, and may run a sequence for safe process termination (e.g. shuts off the main steam valve, switches off electrical heaters and starts a cooling sequence, etc.). If, later, all conditions for safe process termination are met, such as heat exchanger output temperature goes below a certain value, all valves are shut and there is a feedback from end position switches, etc., the program sets the stopacknowledge variable to true. This is what finally makes the runtime to stop. If the onlinechanges output is active, it means that on-line changes will be executed. Therefore it is not necessary to stop the process, even if the function output will indicate the request to stop runtime. The timeout parameter is read at the moment when the runtime starts stopping. If its value changes during the stopping time, it has no influence on the running process.