RobotStudio event

FPSDK - How to write to Rapiddata

Hello,
 

 I have been working with the flex pendant. Now, I created some buttons in my application, when these buttons are clicked, numbers are returned, I want to convert these numbers to rapidatas.So this is where my problems lie. How do I do this?


Thanks...
John Wiberg2011-10-04 14:19:10

Comments

  • You can do it in the following way:
     

    Declaration of a value in VS:


    ABB.Robotics.Controllers.RapidDomain.
    Num nMyValueVS;

    Write that numerical value to the controlller:

    double newStatus = 0;

    Rd = AController.Rapid.GetRapidData("T_ROB1", "MyMod", "MyNumValue");

    nMyValueVS= (ABB.Robotics.Controllers.RapidDomain.Num)Rd.Value;

    nMyValueVS.FillFromNum(newStatus);

    this.Rd.Value = this.nMyValueVS;

    Good luck and BR

    chaos


  • Hey Chaos,
     
    Thank you very much. This really helped.
     
    SchA?nen Tag noch.
     
    - Jay

  • Hi Chaos,

    Have a little question about your example.

    When I use the code you provided i get 2 errors on the last line of code. Here is the code I used:
    [code]
                RapidData rd;
                ABB.Robotics.Controllers.RapidDomain.String sRecipeName;
                string sNewRecipeName = "Teststring";

                rd = aController.Rapid.GetRapidData("T_Recipe", "Recipe", "RecipeName");
                sRecipeName = (ABB.Robotics.Controllers.RapidDomain.String)rd.Value;
                sRecipeName.FillFromString(sNewRecipeName);
                this.rd.Value = this.sRecipeName;
    [/code]
    on the last line I get the following errors:
    1- Error    1    'TpsViewTestCSharp.view_test' does not contain a definition for 'rd' and no extension method 'rd' accepting a first argument of type 'TpsViewTestCSharp.view_test' could be found (are you missing a using directive or an assembly reference?)    D:ABBHoliday IceRobotvb2008TpsViewTestCSharpTpsViewTestCSharpview_test.cs    149    18    TpsViewTestCSharp
    2 - Error    2    'TpsViewTestCSharp.view_test' does not contain a definition for 'sRecipeName' and no extension method 'sRecipeName' accepting a first argument of type 'TpsViewTestCSharp.view_test' could be found (are you missing a using directive or an assembly reference?)    D:ABBHoliday IceRobotvb2008TpsViewTestCSharpTpsViewTestCSharpview_test.cs    149    34    TpsViewTestCSharp

    I don't know what I'm doing wrong. Looks like I'm missing a reference or something, but don't know which one.