RS SDK 5.14 - C# creating boxes along path
Anna
✭
Hello,
Body[] cut = Imported.Cut2(Bloc);
John Wiberg2011-06-29 10:50:11
We are trying to develop a simple tool to cooperate with die designers in stamping processes for robot automated press lines.
We need to create a "solid" path of the part the robot transfers from one press to the next one.
To do so, we create a solid square and we need to substract several times the part the robot is moving from the solid cube to create this "path".
I have managed to program this simple process but creating the two bodies, but I need help to use this method with one existing body in my station.
Body[] cut = Imported.Cut2(Bloc);
And, any idea of how to create the iteration?
Your help will be really appreciated!!
Thank you in advance, regards.
Anna
Best Regards,
Anna
Anna
0
Comments
-
So what you are saying is that you want to create 3d parts along the path when the robot is moving or is it just a matter of creating parts along a known path?Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi Per,
I want to copy the part the robot is handling several times during the robot movement to create a solid that represents the space the part occupies.John Wiberg from Product Support has helped me in creating the basic code, and now I only have a problem with the Tick event to repeat the process.When I try to create the Tick event (in the way the API documentation suggests) I get an error:VSTABridge.SimulatorTick += new TickEventHandler(myTick);I have read it is something related to static events, but I have no idea how to solve it. This would be the last step, any suggestion will be really appreciated!Thank you in advance.Best Regards,
Anna0 -
Hi Anna,I suggest that you create a hosted Add-In (a stand alone dll) and use Visual Studio 2010 to develop it instead.It gives you more freedom to use the entire API, and a better development environment.But if you still want to use VSTA, can you share the exact error you get, with me?
Niklas Skoglund2011-07-06 13:15:130 -
Dear Niklas,It's nice to talk to you, as a beginner I needed to follow the documentation, and it was really helpful.As suggested in it, I also tried to use Visual Studio (2008) to avoid the problems with the static events, but then I had a problem when including the right references.In VSTA I get the following error:Error 1 An object reference is required for the nonstatic field, method, or property 'ABB.Robotics.RobotStudio.Stations.VSTABridge.SimulatorTick' C:DataRobotStudioVSTAProjectsSolidOptimalPathSolidOptimalPathThisApplication.cs 44 17 SolidOptimalPathIf I solve one of the problems I will be able to go on. I have tried to find alternatives to Tick event with timers and threading management, without success.The macro is really simple, only 3 instructions! but I need to repeat the process along the robot path while the simulation is running.Thank you very much for your help.Best Regards,
Anna0 -
Here is a short test code for VSTA, I've run it on my system so it should work.[code]public void Macro_TickSetup()
{Logger.Clear();Logger.AddMessage(new LogMessage("Tick Setup"));VSTABridge b = new VSTABridge(); //only necessary if run in VSTAb.SimulatorTick += new TickEventHandler(b_SimulatorTick);}void b_SimulatorTick(object sender, TickEventArgs e){Logger.AddMessage(new LogMessage("Tick: " + e.Time));}[/code]Load a station with a working sim, then just use the sample project and paste below the other macros and build. Run the TickSetup once first.Then when you run the sim the output window should be full of tick events. As you can see by the volume of ticks you shouldn't do fancy stuff in each tick, but if you keep a tick counter you could do something every 500-1000 or so.John
Developer Center0 -
Hi John,Perfect!It surprises me that I was using VSTAbridge for setting colors, for instance, without needing to declare it as you did in the example, but anyway, the macro is working now. I am using a counter to use the Tick event only once of each 10, it looks great!Thank you very much, and thanks to everyone for all the advices!Best Regards,
Anna0
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