TaskInfo Function
Returns status information for a task.
Syntax
TaskInfo( taskIdentifier, index)
Parameters
- taskIdentifier
- Specify the task name or task number as an integer value. A task name is the function name used in an Xqt statement or a function started from the Run window or Operator window.
- Task number (integer) range is as follows:
- Normal tasks: 1 to 32
- Background task: 65 to 80
- Trap tasks: 257 to 267
- index
- Specify the index of the information to be retrieved as an integer value.
Return Values
An integer containing the specified information.
Description
Index | Description |
---|---|
0 | Task number |
1 | 0 – Background task 1 – Normal task, NoPause task, or NoEmgAbort task |
2 | Task type 0 - Normal task. Nothing specified in Xqt or start the task by Normal 1 - NoPause task. Specified NoPause in Xqt and start the task 2 - NoEmgAbort task. Specified NoEmgAbort in Xqt and start the task 3 - Trap task 4 – Background task |
3 | -1 - Specified task is not executing. 1 - Specified task is executing. 2 - Specified task is waiting for an event. 3 - Specified task is paused or halted 4 - Specified task is in quick pause state 5 - Specified task is in error state |
4 | Timeout has occurred during wait for event (same as TW) |
5 | Event wait time (milliseconds). |
6 | Current robot number selected by the task |
7 | Current robot number being used by the task |
See Also
CtrlInfo, RobotInfo, TaskInfo$ Function
TaskInfo Function Example
If (TaskInfo(1, 3) <> 0 Then
Print "Task 1 is running"
Else
Print "Task 1 is not running"
EndIf