API: RsIrc5Controller
Matthias
✭
in RobotStudio
Hi again!
Is there any possibility to create an RsIrc5Controller with the API?
I can access the active Irc5Controllers via station.Irc5Controllers, but I can't find any possibility to add a new Controller to a new station.
This is what I do to create a new station:
[code]
Station station = new Station();
Project.ActiveProject = station;
GraphicControl gc = new GraphicControl();
DocumentWindow dw = new DocumentWindow("dw", gc, "myView");
gc.RootObject = station;
GraphicComponentLibrary gcl = GraphicComponentLibrary.Load(@C:....,true);
station.GraphicComponents.Add(gcl.RootComponent.CopyInstance ());
dw.Visible = true;
UIEnviroment.Windows.Add(dw);
[/code]
This snippet creates a new station with a (geometry of a) robot in it.
Now I need to know how to attach a new Controller to the station.
It would be very nice if someone could help me.
Best regards, Matthias
Is there any possibility to create an RsIrc5Controller with the API?
I can access the active Irc5Controllers via station.Irc5Controllers, but I can't find any possibility to add a new Controller to a new station.
This is what I do to create a new station:
[code]
Station station = new Station();
Project.ActiveProject = station;
GraphicControl gc = new GraphicControl();
DocumentWindow dw = new DocumentWindow("dw", gc, "myView");
gc.RootObject = station;
GraphicComponentLibrary gcl = GraphicComponentLibrary.Load(@C:....,true);
station.GraphicComponents.Add(gcl.RootComponent.CopyInstance ());
dw.Visible = true;
UIEnviroment.Windows.Add(dw);
[/code]
This snippet creates a new station with a (geometry of a) robot in it.
Now I need to know how to attach a new Controller to the station.
It would be very nice if someone could help me.
Best regards, Matthias
0
Comments
-
Perhaps you should have a look at "ABB.Internal.RobotStudio.API.ControllerHelper" :
RsIrc5Controller controller = ABB.Internal.RobotStudio.API.ControllerHelper.CreateIrc5Cont roller();
RsTask task = ABB.Internal.RobotStudio.API.ControllerHelper.CreateTask();
ABB.Internal.RobotStudio.API.ControllerHelper.AddIrc5Control lerToStation(station, controller);
ABB.Internal.RobotStudio.API.ControllerHelper.AddTaskToContr oller(controller, task);
ABB.Internal.RobotStudio.API.ControllerHelper.AddTaskToStati on(station, task);
0 -
It's called "Internal" for a reason. E.g. it's undocumented, and not guaranteed to work in future versions. Just so you know
Johannes Weiman2007-12-10 10:20:42Johannes Weiman
Software Engineer
ABB Robotics0 -
Thanks for the hint apox.
This is what I did:
[code]
Station station = new Station();
Project.ActiveProject = station;
GraphicControl gc = new GraphicControl();
DocumentWindow dw = new DocumentWindow("dw", gc, "myView");
gc.RootObject = station;
GraphicComponentLibrary gcl = GraphicComponentLibrary.Load(@C:....,true);
station.GraphicComponents.Add(gcl.RootComponent.CopyInstance ());
dw.Visible = true;
UIEnviroment.Windows.Add(dw);
RsIrc5Controller ctrl = ABB.Internal.Robotstudio.API.ControllerHelper.CreateIrc5Cont roller();
RsTask task = ABB.Internal.Robotstudio.API.ControllerHelper.CreateTask();
ABB.Internal.Robotstudio.API.ControllerHelper.AddIrc5Control lerToStation(station, ctrl);
ABB.Internal.Robotstudio.API.ControllerHelper.AddTaskToContr oller(ctrl, task);
ABB.Internal.Robotstudio.API.ControllerHelper.AddTaskToStati on(station, task);
station.ActiveTask = task;
[/code]
There are no errors so far, but the controller doesn't appear in the bottom right hand corner in RobotStudio.
When I try to restart the Controller with ABB.Internal.Robotstudio.API.ControllerHelper.Restart(ctrl, ABB.Internal.Robotstudio.API.ControllerRestartMode.Cold);
Robotstudio crashes.
I can't figure out why this doesn't work.
Any suggestions?
Best Regards, Matthias
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings