Click or drag to resize

TaskGetModule Method

Gets a Module object that refers to a specific RAPID module.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public Module GetModule(
	string moduleName
)

Parameters

moduleName
Type: SystemString
Name of the module.

Return Value

Type: Module
A Module object to access the module. If the module does not exist, the return value is null.
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 deletes all modules with a certain name in each task in the controller.
private void DeleteModules(Controller c,string stModName)
{
    Task[] tasks;
    Module m;
    try
    {
        // Get Tasks
        tasks = c.Rapid.GetTasks();

        Modules modules;
        foreach (Task t in tasks)
        {
            // Get the modules in the task
            m = t.GetModule(stModName);

            // Delete module        
            m.Delete();
        }
    }
    catch (GeneralException ee)
    {
        // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
        // TODO: Add error handling
    }
    finally
    {
        // Release resources
    }
}
See Also