5-43
5 Designing Tasks
NJ-series CPU Unit Software User’s Manual (W501)
5-2 Task System
5
5-2-16 System-defined Variables Related to Tasks
The following system-defined variables are provided for each task to show task status.
Do not use these variables in the user program. There may be a delay in updating them and concur-
rency problems in relation to the error status of the Function Module. It is used only to sample the task
status for data tracing from the Sysmac Studio.
You can also use the GetMyTaskStatus and Task_IsActive instructions to read task status from the user
program. You cannot access the following variables directly through system-defined variables.
Note Example: The Task Period Exceeded Flag for the task named MainTask is _MainTask_Exceeded.
5-2-16 System-defined Variables Related to Tasks
Variable name Meaning Description
Data
type
R/W
_TaskName_Active Task Active Flag TRUE during task execution.
FALSE from the completion of task execu-
tion until the end of the task period.
BOOL R
_TaskName_LastExecTime Last Task Execu-
tion Time
Gives the last execution time of the task. TIME R
_TaskName_MaxExecTime Maximum Task
Execution Time
Gives the maximum value of the task exe-
cution time.
TIME R
_TaskName_MinExecTime Minimum Task
Execution Time
Gives the minimum value of the task exe-
cution time.
TIME R
_TaskName_ExecCount Task Execution
Count
Contains the number of executions of the
task.
If the present value exceeds the maximum
value of the data type, the present value
returns to 0 and the count is continued.
UDINT R
_TaskName_Exceeded Task Period
Exceeded Flag
TRUE when task execution is completed if
the task period is exceeded.
FALSE if task execution was completed
within the task period.
BOOL R
_TaskName_ExceedCount Task Period
Exceeded Count
Contains the number of times that the task
period was exceeded.
If the present value exceeds the maximum
value of the data type, the present value
returns to 0 and the count is continued.
UDINT R