Sys Lib Tasks
Sys Lib Tasks
lib
SysTaskCreate
SysTaskDestroy
SysTaskGetInfo
SysTaskGetPriority
SysTaskSetPriority
SysTaskSuspend
SysTaskResume
SysTaskSleep
SysTaskEnd
SysTaskGetCurrent
SysTaskCreate
This function of Typ UDINT creates a new task. It will return an unique Id number for the task, which is
required as an input parameter for the other functions of SysLibTask.lib.
Input Variable
Data type
Description
stName
STRING
byPriority
BYTE
udiInterval
UDINT
pfFunction
DWORD
pArgument
DWORD
SysTaskDestroy
This function of type BOOL can be used to delete a task. It will return TRUE, if the operation has
succeeded, otherwise FALSE.
Input Variable
Data type
Description
udiTaskId
UDINT
SysTaskGetInfo
This function of type BOOL returns information on a task, which is identified by the task Id.
Input Variable
Data type
Description
udiTaskId
UDINT
pSysTaskInfo
POINTER TO
SYSTASKINFO
Structure SysTaskInfo:
dwHandle:
DWORD;
dwId:
DWORD;
dwSem:
DWORD;
wIECTaskNr: WORD;
stName:
STRING;
SysTaskGetPriority
This function of type BYTE returns the priority of the task identifed by the task Id.
The priority can be a value between 0 (=highest priority ) and 255 (=lowest priority ).
Input Variable
Data type
Description
udiTaskId
UDINT
SysTaskSetPriority
This function of type BOOL can be used to define the priority level for a task which is identifed by the
task Id. TRUE will be returned in case of a successfull operation, otherwiese FALSE.
The priority level can be a value between 0 (=highest priority ) and 255 (=lowest priority )..
Input Variable
Data type
Description
UdiTaskId
UDINT
byPriority
BYTE
SysTaskSuspend
This function of Typ BOOL can be used to stop a task during operation. The task will be identified by the
task Id. (By calling the function SysTaskResume the processing can be continued later.)
TRUE will be returned in case of a successfull stop of the task, otherwiese FALSE.
Input Variable
Data type
Description
udiTaskId
UDINT
SysTaskResume
This function of type BOOL can be used to continue the processing of a task, which was stopped before by
the function SysTaskSuspend.
TRUE will be returned in case of a successfull stop of the task, otherwiese FALSE. .
Input Variable
Data type
Description
udiTaskId
UDINT
SysTaskSleep
This function of type BOOL can be used to interrupt the processing in a running task and to make it
continue after a defined period of time.
TRUE will be returned, if the sleep function has been executed successfully, otherwise FALSE.
Input Variable
Data type
Description
udiMilliseconds
UDINT
SysTaskEnd
This function of type BOOL should be called by a task as soon its processing has been terminated.
Typically this should be done immediately before the task is left.
Input Variable
udiExitCode
UDINT
Should be 0
udiTaskId
UDINT
SysTaskGetCurrent
This function of type UDINT can be called by the currently processing task in order to get returned the
own task Id.
Input Variable
Data type
Description
bDummy
BOOL