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>
SysTaskGetCurrent (FUN) ¶ FUNCTION SysTaskGetCurrent : RTS_IEC_RESULT <description>Returns the handle of the current running task.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskGetCurrent RTS_IEC_RESULT Input phTask POINTER TO RTS_IEC_HANDLE <param name=”phTask” type=”OUT”>Pointer to task handle</param>
SysTaskGetCurrentOSHandle (FUN) ¶ FUNCTION SysTaskGetCurrentOSHandle : RTS_IEC_RESULT <description>Returns the operating system handle of the current running task.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskGetCurrentOSHandle RTS_IEC_RESULT Input puiTaskOSHandle POINTER TO RTS_IEC_HANDLE <param name=”puiTaskOSHandle” type=”OUT”>Pointer to operating system task handle</param>
SysTaskGetInfo (FUN) ¶ FUNCTION SysTaskGetInfo : RTS_IEC_RESULT <description>Returns the task info of the specified task.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysTaskGetInfo RTS_IEC_RESULT Input hTask RTS_IEC_HANDLE <param name=”hTask” type=”IN”>Handle to task</param> ppInfo POINTER TO POINTER TO SYS_TASK_INFO <param name=”ppInfo” type=”OUT”>Pointer pointer to get task info structure</param>