RobotStudio event

Cannot write variable value

Hi all,
 

I'm trying to change a Rapid program variable's value from an FP C# application.

I can read its value using:


RapidData rd = this.Controller.Rapid.GetRapidData("TASK", "MODULE", "VARIABLE");


value = (ABB.Robotics.Controllers.RapidDomain.
String)rd.Value;Unfortunately I can't get it to write a value the similar way:


rd.Value.FillFromString(value);

No error message. Am I missing one final commit instruction?

 

Comments

  • One problem may be that you are passing a Rapid.string into FillFromString instead of a System.string. Here is a snippet that I use for writing to Rapid string data, where "value" is the parameter I pass into my method


    IRapidData iRD = rd.Value;
    ABB.Robotics.Controllers.RapidDomain.
    String iStr = (ABB.Robotics.Controllers.RapidDomain.String)iRD;
    iStr.FillFromString(value.ToString());
    rd.Value = iStr;
     
    RussD2009-02-10 14:59:28
    Russell Drown