How can I write to Rapid Data by using PC SDK ?
Koyu
✭
Hello all
I'm trying to write to Rapid Data (RobTarget) by using PC SDK.
I'm using 'Value' property and 'FillFromString()' method as in the code below.
However, if I do this, I will get this error:
C0048409 : An argument specified by the client is not valid for this type of operation.
RapidData rd = controller.Rapid.GetRapidData("T_ROB_R", "Module1", "Home");
I'm trying to write to Rapid Data (RobTarget) by using PC SDK.
I'm using 'Value' property and 'FillFromString()' method as in the code below.
However, if I do this, I will get this error:
C0048409 : An argument specified by the client is not valid for this type of operation.
RapidData rd = controller.Rapid.GetRapidData("T_ROB_R", "Module1", "Home");
IRapidData data = (RobTarget)rd.Value;
data.FillFromString("[[630.47,115.19,-65.24],[0.921282,0.346739,0.0368297,-0.172205],[0,0,-3,4],[-85.8249,9E+09,9E+09,9E+09,9E+09,9E+09]]");
using (Mastership m = Mastership.Request(controller.Rapid)) {
rd.Value = data;
}
I'm just a beginner of PC SDK that I might make mistakes in this code.
Would you tell me where I'm wrong?
Best regards,
Koyu
I'm just a beginner of PC SDK that I might make mistakes in this code.
Would you tell me where I'm wrong?
Best regards,
Koyu
2
Comments
-
I have not ever used it but I am taking a wild guess that the SDK ought to have the same datatypes as Rapid. As such, see if you have a robtarget datatype in the SDK and an equivalent function to fill from robtarget.Lee Justice1
-
Try reading this page
https://developercenter.robotstudio.com/api/pcsdk/articles/Manual/Using-the-PC-SDK/Rapid-domain/Working-with-RAPID-data.html
Systemintegrator - Web / C# / Rapid / Robotstudio
If I helped, please press Vote Up
☑️2024 - RobotStudio® User Group1 -
Hello.
Did you declare the robot target as pers? If it is const or var you will get this error message.
You should also use FillFromString2() as FillFromString() is obsolete.—Nils OlofssonPC Software Support Engineer3 -
Thank you so much for your comments.
I declared the robot target as const, and after I changed it to pers, the writing went well !1
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings