omron — TASK real-valued function

TASK real-valued function select = 2 Task status bits: Returns an integer value that should be interpreted as a set of bit flags that indicate the following information about the task specified by the task_num parameter: Examples Display the task number the program is running in: TYPE "This program is running as task number :", TASK() The following program segment demonstrates how the TASK function can be used to decide whether to initiate execution of a program (named pc.job.2) with task #2:

IF TASK(1,2) 4 THEN ;If task #2 not executing IF STATUS("pc.job.2") == -1 THEN ;and if program is okay EXECUTE 2 pc.job.2() ;start it up ELSE ;But if program not okay TYPE /B, "Can't start task #2" ;output error message END END Related Keywords ERROR real-valued function STATE real-valued function eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 525 Value Interpretation 3 Stopped due to ABORT, panic button pressed, robot error, or watchpoint. 4 Executing. 5 Stopped due to PAUSE or breakpoint 7 Stopped due to single-step execution Bit # Bit mask Indication if bit is set 1 1 Debugger is accessing task 2 2 Task has robot attached