Skip to main content

7.14.3 RD_TASKINFO

Function

Read the information of the current TASK

LD graphics

RD_TASKINFO

Parameter description

Interface variablesDeclarationData typeDescription
RD_TASKINFOReturn valueINTReturn instruction status
NAMEOut_PutSTRINGThe task name as defined in the task configuration
TYPE_IDOut_PutINTDisplay task type
PRIORITYOut_PutINTDisplay the priority of the task
Overlap_CountOut_PutINTOverlap case: If the task targeted by the new trigger is an already running task, the new trigger will be discarded.
Each time a task trigger is discarded, the counter is incremented by one. The task overlap count is 0, indicating that the task is executed normally, and a non-zero value indicates that the interrupt cycle needs to be extended.
CYC_TIMEOut_PutTIMEConfigured cycle time (ms), only valid for periodic cycle tasks.
WATCH_TIMEOut_PutTIMETask configured watchdog time (ms)
LAST_LTIMEOut_PutLTIMEThe execution time of the previous task cycle, in ns
AVG_LTIMEOut_PutLTIMEThe average execution time required for the task, in ns
MAX_LTIMEOut_PutLTIMEMaximum task execution time, unit is ns
MIN_LTIMEOut_PutLTIMEMinimum task execution time, unit is ns

Return value: RD_TASKINFO (...)

Return command status (W#16#....)

illustrate

  • 0000 No error.
  • FF00 Unable to read current TASK status.
  • In the program editor, error codes can be displayed as integers or hexadecimal.

Example

  • An LD example is shown in the following animation:

RD_TASKINFO_GIF

  • ST example is shown in the following code:
Definition reference:
Name: STRING;
ID:INT;
Priority:INT;
Overlap_I:INT;
Cyc_T TIME;
Watch_T:TIME;
Last_LT:LTIME;
Avg_LT:LTIME;
Max_LT:LTIME;
Mint_LT:LTIME;
OUT3:INT;

Code implementation:
OUT3:=RD_TASKINFO(
NAME=>name,
TYPE_ID=>ID,
PRIORITY=>Priority,
Overlap_Count=>Overlap_I,
CYC_TIME=>Cyc_T,
WATCH_TIME=>Watch_T,
LAST_LTIME=>Last_LT,
AVG_LTIME=>Avg_LT,
MAX_LTIME=>Max_LT,
MIN_LTIME=>Mint_LT
);