Click or drag to resize

TaskGetModules Method

Gets the modules defined in the task.

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

Return Value

Type: Module
An array of Module objects.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Remarks
NOTE:When the returned instance is no longer needed you must call its Dispose method.
Examples
The method below counts the number of routines in the task.
private int CountRoutines(Controller c)
{
    int result = 0;
    Task[] tasks;
    try
    {
        tasks = c.Rapid.GetTasks();

        Modules modules;

        // Iterate tasks
        foreach (Task t in tasks)
        {
            // Get all modules of the task
            modules = t.GetModules();

            Routines routines;                
            foreach (Module m in modules)
            {
                // Get all routines of the module
                routines = m.GetRoutines();

                result += routines.Lenght;
            }
        }
    }
    catch (GeneralException ee)
    {
        // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
        // TODO: Add error handling
    }

    return result;
}
See Also