Convert VSTA AddIn to Standard AddIn
In http://forums.robotstudio.com/forum_posts.asp?T ID=2007 "Henrik Berlin" wrote this:
[quote]A rule of thumb:
Small, basic add-in: VSTA
Advanced add-in: Standard add-in written in, say, VS 2005 Express...[/quote]
I started my programming in VSTA but encountered several difficulties and comments in the API-documentation telling that some features are not usable within VSTA.
So I decided to try converting my existing project into a "Standard add-in" and took my VSTA-code to VS 2005.
In my project I work in the first place on the one hand with RAB to control robots and on the other hand with RobotStudio classes ABB.Robotics.RobotStudio.Stations.RsIrc5Controller and Station.ActiveProject to get the Robot's MechanicalUnits and for creating parts and copying some the robot's geometries.
For initializing communication with the station in VSTA I used "Station.ActiveProject as Station" which now throws an exception in the Standard add-in. What do I have to do to gain control of the RobotStudio station in this case?
2nd question: How can I debug a Standard add-in? At the moment I build my program and place it into RobotStudio/bin/Addins/ - therefore I do have to restart RobotStudio each time I want to change something and debugging is not possible.
Btw: Please tell me if I the idea to change to Standard AddIn to get more control is rubbish.
Comments
-
Hi,
First of all make sure you do NOT reference ABB.Robotics.RobotStudio.Proxy.dll in you standard add-in; it is only intended for VSTA!
Also as you noted before the API is not thread safe (except for some standalone stuff like the Math classes). You should only call the API from the main thread (e.g. the same thread that calls your AddinMain()).
To debug your add-in you should configure your project debug settings to "Start external program" RobotStudio.exe.
It is true that you have to restart RobotStudio when you rebuild your add-in. This is perhaps the main disadvantage when compared to VSTA, but on the other hand you get much better performance and functionality in a standard add-in.
regards,
Johannes
Johannes Weiman
Software Engineer
ABB Robotics0 -
Thank you for your reply.
I changed the reference to RobotStudio.Proxy.dll to the other dlls and now it works.
Will the rebuild-and-restart constraint be solved in future releases of RobotStudio or is there any workaround? My station takes about 2 minutes to be loaded completely.
0 -
The restart limitation will probably never be solved, simply because .NET doesn't allow a assembly to be unloaded once it has been loaded into an application domain.
A VSTA add-in runs in a different application domain than RS itself, therefore it is possible to unload. But it also means all method calls must be marshaled across domain boundaries, and that is the root of all problems with VSTA.
Johannes Weiman
Software Engineer
ABB Robotics0 -
And what about "API is not thread safe"? This also took me several days thinking I wrote wrong code. Will this change in upcoming releases?
Btw: Is there any updated API-documentation? My docs are from 2008-01-28.
0 -
RS 5.11 will have complete API documentation including many examples: Download
I have suggested that methods that aren't thread safe should throw an explicit exception if they are called from the wrong thread. But that probably won't make it into 5.11.
Johannes Weiman2008-9-5 14:13:24Johannes Weiman
Software Engineer
ABB Robotics0
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