7.14.3 RD_TASKINFO
Function
Read the information of the current TASK
LD graphics

Parameter description
| Interface variables | Declaration | Data type | Description |
|---|---|---|---|
| RD_TASKINFO | Return value | INT | Return instruction status |
| NAME | Out_Put | STRING | The task name as defined in the task configuration |
| TYPE_ID | Out_Put | INT | Display task type |
| PRIORITY | Out_Put | INT | Display the priority of the task |
| Overlap_Count | Out_Put | INT | Overlap 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_TIME | Out_Put | TIME | Configured cycle time (ms), only valid for periodic cycle tasks. |
| WATCH_TIME | Out_Put | TIME | Task configured watchdog time (ms) |
| LAST_LTIME | Out_Put | LTIME | The execution time of the previous task cycle, in ns |
| AVG_LTIME | Out_Put | LTIME | The average execution time required for the task, in ns |
| MAX_LTIME | Out_Put | LTIME | Maximum task execution time, unit is ns |
| MIN_LTIME | Out_Put | LTIME | Minimum 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:

- 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
);