/
6K Software - Halting a Task.
6K Software - Halting a Task.
HALTing a task is like a sudden power outage for the task. The HALTed task doesn't know it's coming, and can't get its affairs in order before it goes down. A safer and more robust approach for stopping tasks is to request the task to end itself.
For example, suppose VARB35 must be set to enable Task 4, and the controlling task may stop Task 4 by clearing VARB35. The program in Task 4 would qualify each atomic (atomic means not to be interrupted or aborted) block of code with VARB35 and look like:
WHILE (VARB35 = B1)
;some fast code
IF (VARB35 = B1)
;some atomic code
NIF
TIMST0
WHILE (TIM < 100 AND VARB35=B1) ;dwell while still enabled
NWHILE ;end of qualified dwell
IF (VARB35 = B1)
;more atomic code
NIF
NWHILE ;end of main task loop
;end of task cleanup code, graceful exit
END
, multiple selections available,
Related content
6K Troubleshooting - Turning Off My Computer Stops My Program.
6K Troubleshooting - Turning Off My Computer Stops My Program.
More like this
6K Software - Does a !K Command Stop a PLC Program?
6K Software - Does a !K Command Stop a PLC Program?
More like this
6K Software - Task Swapping (Multi-Tasking Feature)
6K Software - Task Swapping (Multi-Tasking Feature)
More like this
6K Software - PLCP Execution
6K Software - PLCP Execution
More like this
6K Troubleshooting - TASF BIT 26 -- Motion Suspended
6K Troubleshooting - TASF BIT 26 -- Motion Suspended
More like this
6K Software - INFNC Program Selection
6K Software - INFNC Program Selection
More like this