SchedGetNumOfTasks (FUN) ¶ FUNCTION SchedGetNumOfTasks : DINT <description> Is called to get the number of all registerd IEC tasks in the scheduler. </description> <param name=”pApp” type=”IN”>If an application is specified, only the tasks of this application is returned. If NULL, number of all tasks is returned. </param> <param name=”pResult” type=”OUT”>ERR_OK or Error code</param> <result>Number of tasks</result> InOut: Scope Name Type Return SchedGetNumOfTasks DINT Input pApp POINTER TO APPLICATION pResult POINTER TO RTS_IEC_RESULT
SchedGetProcessorLoad (FUN) ¶ FUNCTION SchedGetProcessorLoad : UDINT <description>Returns the processor load of all IEC tasks</description> <param name=”pResult” type=”OUT”>Pointer to error code</param> <result>Processor load in percent</result> InOut: Scope Name Type Return SchedGetProcessorLoad UDINT Input pResult POINTER TO RTS_IEC_RESULT
SchedGetTaskEventByHandle (FUN) ¶ FUNCTION SchedGetTaskEventByHandle : RTS_IEC_HANDLE <description> Function returns the handle to the task event. With this event a task can be activaed externally, e.g. for external triggered event tasks. The event can be sent by SysEventSet(EventHandle); </description> <param name=”hSchedTask” type=”IN”>Scheduler task handle</param> <param name=”pResult” type=”OUT”>ERR_OK or Error code</param> <result>Event handle. Can be used with SysEventSet(hEvent) of the SysEvent.library to wakeup the task</result> InOut: Scope Name Type Return SchedGetTaskEventByHandle RTS_IEC_HANDLE Input hSchedTask RTS_IEC_HANDLE pResult POINTER TO RTS_IEC_RESULT
SchedGetTaskHandleByIndex (FUN) ¶ FUNCTION SchedGetTaskHandleByIndex : RTS_IEC_HANDLE <description> Function returns the task handle of a task specified by an index. </description> <param name=”pApp” type=”IN”>If an application is specified, only the task of this application is returned. If NULL, the task with the index in all tasks i returned. </param> <param name=”pResult” type=”OUT”>ERR_OK or Error code</param> <result>Handle to the task</result> InOut: Scope Name Type Return SchedGetTaskHandleByIndex RTS_IEC_HANDLE Input pApp POINTER TO APPLICATION nIndex DINT pResult POINTER TO RTS_IEC_RESULT
SchedGetTaskHandleByName (FUN) ¶ FUNCTION SchedGetTaskHandleByName : RTS_IEC_HANDLE <description> Function returns the handle to the task specified by name. </description> <param name=”pszTaskName” type=”IN”>Task name</param> <param name=”pResult” type=”OUT”>ERR_OK or Error code</param> <result>Scheduler task handle</result> InOut: Scope Name Type Return SchedGetTaskHandleByName RTS_IEC_HANDLE Inout Const pszTaskName STRING Input pResult POINTER TO RTS_IEC_RESULT
SchedPostExternalEvent (FUN) ¶ FUNCTION SchedPostExternalEvent : RTS_IEC_RESULT <description> <p>Execute all tasks, that are registered for the given event. The execution context may vary depending on the scheduler type. It might be executed synchronously in the context of the caller, or a system task (e.g. ontop of an OS) is just signaled to execute the task code.</p> <p>Note, that the result ERR_NO_OBJECT might not be a real error. Depending on the system it might be OK, that no task was registered for this event.</p> </description> <param name=”hExtEvent” type=”IN”>Handle to the external event, which tasks should be signaled</param> <errorcode name=”RTS_IEC_RESULT” type=”ERR_OK”>Event was signaled successfully</errorcode> <errorcode name=”RTS_IEC_RESULT” type=”ERR_PARAMETER”>The event handle was not found</errorcode> <errorcode name=”RTS_IEC_RESULT” type=”ERR_NO_OBJECT”>There was no task, registered on this event</errorcode> <result>Error Code</result> InOut: Scope Name Type Return SchedPostExternalEvent RTS_IEC_RESULT Input hExtEvent RTS_IEC_HANDLE
SchedGetTaskInterval (FUN) ¶ FUNCTION SchedGetTaskInterval : RTS_IEC_RESULT <description> Get the actual interval of a cyclic task. If the specified task is no cyclic task, the function return an error. </description> <param name=”hSchedTask” type=”IN”>Handle to the task</param> <param name=”ptInterval” type=”OUT”>Interval of the task in microseconds!</param> <result>error code</result> InOut: Scope Name Type Return SchedGetTaskInterval RTS_IEC_RESULT Input hSchedTask RTS_IEC_HANDLE Inout pulInterval UDINT
SchedRegisterExternalEvent (FUN) ¶ FUNCTION SchedRegisterExternalEvent : RTS_IEC_HANDLE <description> <p>Register an external event, which might be used later by event tasks. You should register those events during the system startup, so that the scheduler knows all events when the application is loaded.</p> <p>Valid Hook: CH_INIT2</p> <p>Note: the parameter pszExtEventName needs to be constantly allocated. It might either be a constant string, a global string variable, or a dynamically allocated string. But the memory needs to be valid during the life time of the event handle.</p> </description> <param name=”pszExtEventName” type=”IN”>Name of the event, as it was specified in the device description. This parameter needs to be constantly allocated</param> <param name=”pResult” type=”INOUT”>Error Code</param> <errorcode name=”RTS_IEC_RESULT” type=”ERR_OK”>Event was registered successfully</errorcode> <errorcode name=”RTS_IEC_RESULT” type=”ERR_NOMEMORY”>There was not enough memory to register the new event handle</errorcode> <result>handle to the event</result> InOut: Scope Name Type Return SchedRegisterExternalEvent RTS_IEC_HANDLE Input pszExtEventName REFERENCE TO STRING pResult POINTER TO RTS_IEC_RESULT
SchedSetTaskInterval (FUN) ¶ FUNCTION SchedSetTaskInterval : RTS_IEC_RESULT <description> Set the actual interval of a cyclic task. If the specified task is no cyclic task, the function return an error. This interface can be used to synchronize a task to another task or to events. </description> <param name=”hSchedTask” type=”IN”>Handle to the task</param> <param name=”tInterval” type=”IN”>New interval in microseconds!</param> <result>error code</result> InOut: Scope Name Type Return SchedSetTaskInterval RTS_IEC_RESULT Input hSchedTask RTS_IEC_HANDLE ulInterval UDINT
SchedUnregisterExternalEvent (FUN) ¶ FUNCTION SchedUnregisterExternalEvent : RTS_IEC_RESULT <description> <p>Unregister an external event, which was registered by SchedRegisterExternalEvent() before.</p> <p>This function should be called on system shutdown</p> <p>Valid Hook: CH_EXIT2</p> </description> <param name=”hExtEvent” type=”IN”>Handle to the external event, that should be unregistered.</param> <errorcode name=”RTS_IEC_RESULT” type=”ERR_OK”>Event was deregistered successfully</errorcode> <errorcode name=”RTS_IEC_RESULT” type=”ERR_PARAMETER”>The event handle was not registered before</errorcode> <result>Error code</result> InOut: Scope Name Type Return SchedUnregisterExternalEvent RTS_IEC_RESULT Input hExtEvent RTS_IEC_HANDLE