Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

TaskKill

  • Last UpdatedJul 18, 2023
  • 1 minute read

Kills a task. The Cicode task will be stopped and will not run again.

Syntax

TaskKill(hTask)

hTask:

The task handle, returned from the TaskNew() or TaskHnd() function. The task handle identifies the table where all data on the associated task is stored.

Return Value

0 (zero) if successful, otherwise an error code is returned.

Note: TaskKill is an abrupt way to stop a Cicode task. It can cause system errors and may have unintended consequences. Whenever possible, use TaskGetSignal and TaskSetSignal to stop Cicode tasks. Use TaskKill as a last resort and after observing the following:

UNINTENDED EQUIPMENT OPERATION

  • Do not use TaskKill to stop Cicode tasks until you have attempted the alternative methods stated above.

  • Place the processes and devices controlled by Plant SCADA into a state preventing unintended operation before using TaskKill to stop a Cicode task.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

TaskGetSignal, TaskSetSignal, TaskHnd, TaskNew, TaskResume, TaskSuspend

Example

! Create a task, run it for 10 seconds and then kill it.

hTask=TaskNew("MyFunc","",0);

Sleep(10);

TaskKill(hTask);

FUNCTION

MyFunc()

INT Count;

WHILE 1 DO

Prompt("Hello "+Count:###);

Count=Count+1;

END

END

See Also

Task Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in