Click or drag to resize

ModuleGetRoutines Method

Gets the routines defined in the module.

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

Return Value

Type: Routine
An array of Routine 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 system.
private int CountRoutines(Controller c)
{
  int result = 0;
  Task[] tasks;
  try
  {
    tasks = c.Rapid.GetTasks();

    Modules modules;

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

      Routines routines;
      foreach (Module m in modules)
      {
        // Get all routines in 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