Click or drag to resize

RapidGetTasks Method

Gets the tasks defined in the RAPID domain.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public Task[] GetTasks()

Return Value

Type: Task
An array of Task instances.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Remarks
NOTE:When the returned instance is no longer needed you must call its Dispose method.
Examples
This example retrieves all declared RAPID tasks and adds each task name to a listbox.
private void ListTasks(Controller c)
{
    Task[] tasks;
    try
    {
        // Get all tasks
        tasks = c.Rapid.GetTasks();

        listBox1.Items.Clear();
        // Add name of task
        foreach (Task t in tasks)
            listBox1.Items.Add(t.Name);
    }
    catch (GeneralException ee)
    {
        // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
        // TODO: Add error handling
    }
    finally
    {
        // Make sure resource are released
        this.DisposeTasks();
    }
}
See Also