IecTaskDelete3
(FUN)
FUNCTION IecTaskDelete3 : RTS_IEC_RESULT
Delete an IEC task with timeout
This function creates an asynchronous job to delete the IEC task with the given handle and timeout value. When the asynchronous job is successfully created the function returns immediately with ERR_PENDING. With asyncState one checks the job completion and finalResult tells wether the deletion of the IEC task itself was successful.
Note
Due to the asynchronous manner of the deletion a dynamically created IEC task may delete itself.
- Error code:
ERR_PENDING: The asynchronous job to delete the IEC task was successfully created.
ERR_FAILED: The asynchronous job to delete the IEC task could not be created.
ERR_PARAMETER: Invalid task handle
ERR_NOT_SUPPORTED: asynchronous jobs are not supported
ERR_NOMEMORY: No memory to manage the asynchronous job
- InOut:
Scope
Name
Type
Comment
Return
IecTaskDelete3
RTS_IEC_RESULT
Error code
Input
hIecTask
RTS_IEC_HANDLE
Handle to task
ulTimeoutMs
UDINT
- Timeout in milliseconds to wait for deleting the task. Some timeouts are predefined:
RTS_TIMEOUT_DEFAULT: Use default wait time
RTS_TIMEOUT_NO_WAIT: No wait
Inout
asyncState
UDINT
Asnyc state. See CmpAsyncMgr.library::GVL::ASYNCSTATE_XXX for possible states. ASYNCSTATE_READY is set when the job ends. For success check finalResult.
finalResult
RTS_IEC_RESULT
- Result of the delete function after completion
ERR_OK: task was deleted and the task object is released
ERR_TIMEOUT: deletion timed out, task may be still busy
ERR_NO_OBJECT: task was not found