SysTaskSetPriority

This function of type BOOL can be used to define the priority level for a task which is identified by the task Id. TRUE will be returned in case of a successful operation, otherwise FALSE.

The priority level can be a value between 0 (=highest priority ) and 255 (=lowest priority ).

Note

SysTask functions are not reentrant. This should be no problem in normal cases, but if in the application program a situation might occur, where several IEC-tasks create and manage additional tasks, the calls to these functions have to be synchronized. You can use the library The Library SysLibSem.lib in this case.

Input Variable Data type Description
UdiTaskId UDINT

Id of the task, for which the priority level should be set;

this Id was returned by SysTaskCreate during creation of the task

byPriority BYTE

Priority ; possible values : 0 ““ 255

- Reserved for system: 0..31

- IEC-Tasks: 32..63

- Communication tasks: 64 and higher