SysTaskAutoReleaseOnExit (FUN) ¶ FUNCTION SysTaskAutoReleaseOnExit : RTS_IEC_RESULT <description>The creator of a task can call this function to release the task object, if the task ends is execution. So the task is responsible itself to delete this object. NOTE: The task object must not be used from outside the task after calling this function!</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskAutoReleaseOnExit RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param>
SysTaskCheckStack (FUN) ¶ FUNCTION SysTaskCheckStack : RTS_IEC_RESULT <description>NOT IMPLEMENTED YET! Function to investigate the stack task. </description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskCheckStack RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param> pulMaxDepth POINTER TO UDINT <param name=”pulMaxDepth” type=”OUT”>Maximum stack depth</param>
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>
SysTaskCreate2 (FUN) ¶ FUNCTION SysTaskCreate2 : RTS_IEC_HANDLE <description>Is called to create a task in _suspended_ mode. SysTaskResume must be called afterwards!</description> <result><p>RESULT: Handle to the created task</p></result> InOut: Scope Name Type Comment Return SysTaskCreate2 RTS_IEC_HANDLE 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> pResult POINTER TO RTS_IEC_RESULT <param name=”pResult” type=”OUT”>Pointer to runtime system error code (see CmpErrors.library)</param>
SysTaskDestroy (FUN) ¶ FUNCTION SysTaskDestroy : RTS_IEC_RESULT <description>Is called to destroy the given task.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskDestroy RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param>
SysTaskEnd (FUN) ¶ FUNCTION SysTaskEnd : RTS_IEC_RESULT <description>Is called from the task itself, that ends its execution.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskEnd RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param> ulExitCode UDINT <param name=”ulExitCode” type=”IN”>Exit code of the task</param>
SysTaskEnter (FUN) ¶ FUNCTION SysTaskEnter : RTS_IEC_RESULT <description>This function is called to mark entering the while loop.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskEnter RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param>
SysTaskExit (FUN) ¶ FUNCTION SysTaskExit : RTS_IEC_RESULT <description>Tries to exit the given task gracefully. If the task doesn’t answer in the specified timeout, then the task will be deleted hard!</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskExit RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param> ulTimeoutMs UDINT <param name=”ulTimeoutMs” type=”IN”>Timeout in milliseconds</param>
SysTaskGenerateException (FUN) ¶ FUNCTION SysTaskGenerateException : RTS_IEC_RESULT <description>Call the corresponding exception handler of the task.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskGenerateException RTS_IEC_RESULT Input ulTaskOSHandle RTS_IEC_HANDLE <param name=”ulTaskOSHandle” type=”IN”>Operating system handle of the task</param> ulException UDINT <param name=”ulException” type=”IN”>Rts standard exception</param> Context RegContext <param name=”Context” type=”IN”>Context to detect the code location where the exception occurred</param>
SysTaskGetContext (FUN) ¶ FUNCTION SysTaskGetContext : RTS_IEC_RESULT <description>Get the current register context of the task. Task must be in suspended mode!</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskGetContext RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param> pContext POINTER TO RegContext <param name=”pContext” type=”OUT”>Pointer to context</param>