Ejemplo n.º 1
0
 private void TraceTask(ABB.Robotics.Controllers.RapidDomain.Task t)
 {
     Console.WriteLine("\t Task: {0}", t.Name);
     Module[] modules = t.GetModules();
     foreach (Module m in modules)
     {
         TraceModule(m);
     }
 }
Ejemplo n.º 2
0
        private void refreshModuleList()
        {
            listBox_moduleList.Items.Clear();

            tRob1 = controller.Rapid.GetTask("T_ROB1");
            Module[] module = tRob1.GetModules();

            foreach (Module modFiles in module)
            {
                listBox_moduleList.Items.Add(modFiles);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Deletes all existing modules from main task in the controller.
        /// </summary>
        /// <returns></returns>
        private int ClearAllModules(ABBTask task)
        {
            if (controller == null)
            {
                logger.Debug("Cannot clear modules: not connected to controller");
                return(-1);
            }

            if (task == null)
            {
                logger.Debug("Cannot clear modules: task not avaliable");
                return(-1);
            }

            int count = 0;

            try
            {
                using (Mastership.Request(controller.Rapid))
                {
                    ABB.Robotics.Controllers.RapidDomain.Module[] modules = task.GetModules();
                    foreach (ABB.Robotics.Controllers.RapidDomain.Module m in modules)
                    {
                        logger.Verbose($"Deleting module {m.Name} from {task.Name}");
                        m.Delete();
                        count++;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Debug($"CLEAR MODULES ERROR: {ex}");
            }

            logger.Debug($"Cleared {count} modules from main task");
            return(count);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deletes all existing modules from main task in the controller.
        /// </summary>
        /// <returns></returns>
        private int ClearAllModules()
        {
            if (controller == null)
            {
                Console.WriteLine("Cannot clear modules: not connected to controller");
                return(-1);
            }

            if (tRob1Task == null)
            {
                Console.WriteLine("Cannot clear modules: main task not retrieved");
                return(-1);
            }

            int count = 0;

            try
            {
                using (Mastership.Request(controller.Rapid))
                {
                    ABB.Robotics.Controllers.RapidDomain.Module[] modules = tRob1Task.GetModules();
                    foreach (ABB.Robotics.Controllers.RapidDomain.Module m in modules)
                    {
                        Console.WriteLine("Deleting module: {0}", m.Name);
                        m.Delete();
                        count++;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("CLEAR MODULES ERROR: {0}", ex);
            }

            Console.WriteLine("Cleared {0} modules from main task", count);
            return(count);
        }