Write with an Add-In to the RAPID-Editor
matz
✭
in RobotStudio
Hi,
I created some instructions and synchronized them to the VC.
Now I want to change the created RAPID-code by an Add-In! I want to write some auto generated code to the Editor, apply the changes and save the module! But I donA't know how to do this.
For example to crete a new robtarget or a string I can use the classDataDeclaration, like itA's shown in the API-examples! But now I want to write directly to the editor, without creating something in the station and synchronizing it to the VC.
Is this possible?
I want to write also some code with IF and FOR-functions directly to the PROC in the module!
If not, I have to save the module and change its code by a macro, but thats not the thing I exactly want...
Another question: Is there a bug in RS, when I want to save a module? When I synchronize a station for the first time an change the code in the module, the changes will not be saved!
It looks like the module is write-protected! Can this be changed or is it a bug?
When I synchronize the station again to the VC, all manual changes in the code can be saved!
Thank you!
Matz
0
Comments
-
Hi Matz,unfortunately the RAPID Editor has no API, so you can't access it programatically.What you can do instead, is to generate your RAPID code to a file, and then load it to the controller memory using PC-SDK.Can that be a workaround in your scenario?The abstract class RsDataDeclaration, for example, represents a data declaration in the RobotStudio station. A concrete example is the RsRobtarget, which is a subclass of RsDataDeclaration. The only obvious way to go from a RsRobtarget in RobotStudio to RAPID is to use RAPID Sync.The "RAPID-related" objects in the RobotStudio object model, does not mirror the entire RAPID language. Only things that are common between RAPID and the RobotStudio station exists as objects in the RobotStudio object model.Maybe you are looking for an object model for the RAPID language, similar to what you can find in the .NET CodeDOM namespace.Something that lets you create an object that represents a "PROC", add a "FOR" object to its list of statements etc.ABB does not have such object model, so I'm afraid the only hint is to generate the code "on your own" to a file on disk.0
-
Hi Mr. Skoglun,
thank you for the answer.
I found a solution for my problem. ItA's not the best one, but it works.
I create a module with RS as far as possible. Then I save the created module. After that I edit the saved module with a self created macro, that writes the missing code automatically (with IFs and FORs) to the position of the module, where I need it! Finally I load the created module to RS or directly to the robot.
matz
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