FUNCTION IecTaskCreate : RTS_IEC_HANDLE
Create a new IEC Task
IEC Tasks itself are used by the scheduler of the runtime. They don't essentially need a corresponding OS task or timer. They might be handled by the scheduler in a completely different way.
Task_Info2.dwEventFunctionPointer:
Function pointer to the event check routine in case Task_Info2.KindOfTask = TaskEvent
FUNCTION CheckEvent : BOOL
VAR_INPUT
END_VAR
(* This function checks wether the event is triggered *)
(* by returning TRUE: raising edge, status, etc. *)
Task_Info2.dwTaskEntryFunctionPointer:
Function pointer to the task code
FUNCTION IecTaskCyclic : BOOL
VAR_INPUT
parameter : IEC_CYCLE_STRUCT;
END_VAR
VAR
udiState : UDINT;
hTask : RTS_IEC_HANDLE;
END_VAR
(* ----- mandatory cyclic task frame code begin ----- *)
udiState := parameter.pApplication^.udiState;
hTask := parameter.hTaskHandle;
IF udiState = AS_STOP THEN
RETURN;
END_IF
IF parameter.pTaskInfo^.bWatchdog THEN
IecTaskEnableWatchdog(hTask);
END_IF
(* ------ mandatory cyclic task frame code end ------ *)
Error code: |
|
InOut: |
|