7. Maintenance
369
GetTaskInfo
This function returns the task information of a specific application.
Figure 7-8. GetTaskInfo Function
Below, the parameters that must be sent to the function for it to return the application information are
described.
Pointer to receive the application information
Table 7-29. GetTaskInfo Input Parameters
The data returned by the function, through the pointer informed in the input parameters are described
on Table 7-30.
Task cycle time (execution) with 1µs resolution
Task cycle minimum time with 1µs resolution
Task cycle maximum time with 1µs resolution
Task cycle average time with 1µs resolution
Task cycle maximum time before watchdog occurrence
Table 7-30. GetTaskInfo Returned Parameters
Possible ERRORCODE:
ï‚· NoError: success execution
ï‚· TaskNotPresent: the desired task does not exist
Example of utilization in ST language:
PROGRAM MainPrg
VAR
sAppName : STRING;
psAppName : POINTER TO STRING;
sTaskName : STRING;
psTaskName : POINTER TO STRING;
pstTaskInfo : POINTER TO stTaskInfo;
TaskInfo : stTaskInfo;
Info : ERRORCODE;
END_VAR
//INPUTS:
sAppName := 'Application'; //Variable receives the application name.
psAppName := ADR(sAppName); //Pointer with application name.
sTaskName := 'MainTask'; //Variable receives task name.
psTaskName := ADR(sTaskName); //Pointer with task name.
pstTaskInfo := ADR(TaskInfo); //Pointer that receives task info.
//FUNCTION:
//Function call.
Info := GetTaskInfo (psAppName, psTaskName, pstTaskInfo);
//Variable ‘Info’ receives possible function errors.