Click or drag to resize

ModuleDelete Method

Deletes the RAPID module the Module object refers to from program memory.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public void Delete()
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Remarks
This method only removes the module from the controller program memory, i.e. the file containing the RAPID module will not be deleted.
Examples
This example goes through all tasks in the controller and deletes all modules with a specified name.
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