RobotStudio event

ScreenMaker adding .NET method for program pointer change

Hi, I am currently working  with ScreenMaker but I would like to have a button with functionality similar to PP to Routine, but instead of routine list it would change to my predefined routine .

Found out that there is a possible way to integrate .NET methods to actions when added to button element.

Got a fast try with examples from FP SDK that I could find online and in manuals and came up with this kind of construct:

using System;
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.RapidDomain;


namespace PointerMethods
{
    public class dotNETMETHOD
    {
              
        public static void PoinerToTask20()
        {

            Controller c = new Controller();
            Task[] allTasks = c.Rapid.GetTasks();
            Task firstTask = allTasks[0];
            firstTask.SetProgramPointer("IRC6655", "main");    <<<<< could be other routine at this place
        }
    }
}


Off course had no success, button does nothing after adding this method to button.

Am I digging in correct direction, and is it possible to get this functionality using .NET methods called from ScreenMaker ?
If yes maybe someone could comment what I am not doing right.

P.S. I am quite new to .NET framework and VS2008

Comments

  • soup
    soup ✭✭✭
    The predefined "RunRoutineButton" element won't work?
  • soup said:
    The predefined "RunRoutineButton" element won't work?
    Yes did not cover that, RunRoutineButton is not suitable for my task. I am creating a manual routine screen where you can get fast to the routine needed, and select from up to 9 different routines without searching.

    If I use RunRoutineButton Routine is called similar as service routines are called, that means 1. i have to make an entry point for the routine and do a PP to main command,
    2. if the routine is not completed, I have to do additional operator actions to CancelCall Routine,
    3. all the time they have to confirm messages that robot might move, pp to main should be done, error because other routine is running etc. so This is burden for operators.

    Plus those are routines that contains movements and again I have to create entry points and exit points for the path, that is not acceptable as same routines are used in production.
  • Ok, this actually works.

    There is a bug, that If I am targeting the .dll file from my VS project folder with the same name that already exists in the project folder of ScreenMaker (folder "ref") It automatically re targets to the ScreenMaker  file and does not reload new version.

    So to solve my problem:
    1.Installed Visual Studio 2008 (got link from Stack Owerflow)
    2.Installed FlexPendantSDK
    3.Started a Class library in VS
    4.Added References from FlexPendantSDK installation folder (bin)
    5.Wrote a code (that was in the first post) (does not takes mastership and actual mode of controller in consideration, should be added to code)
    6.Built a project
    7.Added into the Screen Maker custom .NET method path (If you need to add changed .dll delete it from the project folder of ScreenMaker (folder "ref") before adding, otherwise it will not change )
    8.Used it as the advanced action on the ScreenMaker element.




  • soup said:
    The predefined "RunRoutineButton" element won't work?
    Yes did not cover that, RunRoutineButton is not suitable for my task. I am creating a manual routine screen where you can get fast to the routine needed, and select from up to 9 different routines without searching.

    If I use RunRoutineButton Routine is called similar as service routines are called, that means
    1. i have to make an entry point for the routine and do a PP to main command,
    2. if the routine is not completed, I have to do additional operator actions to CancelCall Routine,
    3. all the time they have to confirm messages that robot might move, pp to main should be done, error because other routine is running etc. so This is burden for operators.

    Plus those are routines that contains movements and again I have to create entry points and exit points for the path, that is not acceptable as same routines are used in production.
  • soup said:
    The predefined "RunRoutineButton" element won't work?
    Yes did not cover that, RunRoutineButton is not suitable for my task. I am creating a manual routine screen where you can get fast to the routine needed, and select from up to 9 different routines without searching.

    If I use RunRoutineButton Routine is called similar as service routines are called, that means 1. i have to make an entry point for the routine and do a PP to main command,
    2. if the routine is not completed, I have to do additional operator actions to CancelCall Routine,
    3. all the time they have to confirm messages that robot might move, pp to main should be done, error because other routine is running etc. so This is burden for operators.

    Plus those are routines that contains movements and again I have to create entry points and exit points for the path, that is not acceptable as same routines are used in production.