SysTaskCreate (FUN)

FUNCTION SysTaskCreate : RTS_IEC_RESULT

<description>Is called to create a task in _run_ mode.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result>

InOut:

Scope

Name

Type

Comment

Return

SysTaskCreate

RTS_IEC_RESULT

Input

pszTaskName

REFERENCE TO STRING

<param name=”pszTaskName” type=”IN”>The name of the task</param>

pFunction

PFSYS_TASK_FUNCTION

<param name=”pFunction” type=”IN”>Function which implements the task: void func (SYS_TASK_PARAM/// pParam*)</param>

pParam

POINTER TO SYS_TASK_PARAM

<param name=”pParam” type=”IN”>Pointer to the argument which is passed on entry, see SYS_TASK_PARAM->pParam</param>

ulPriority

UDINT

<param name=”ulPriority” type=”IN”>Priority of the task. Can be 0..255</param>

ulInterval

UDINT

<param name=”ulInterval” type=”IN”>Interval in microseconds</param>

ulStackSize

UDINT

<param name=”ulStackSize” type=”IN”>Stack size of task in bytes. 0=Default</param>

pExceptionHandler

PFSYS_TASK_EXCEPTIONHANDLER

<param name=”pExceptionHandler” type=”IN”>Function pointer to exception handler that is called after an exception has occurred in the task</param>

phTaskHandle

POINTER TO RTS_IEC_HANDLE

<param name=”phTaskHandle” type=”OUT”>Handle to the created task</param>