RobotStudio event

Write Rapid Data (boolean)

Dear all,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

I have problem to set a rapid boolean. image

To get the actual value of the rapid boolean is working, but I can't write a new value.

Should this working with the FillFromBool() Methode?

 

Can anyone send a code example?

 

Thanks

 

Best regards

 

Roland

Comments

  • Hi Roland
    This works for me

    private void WriteBool(string task,string module,string variable,bool WriteValue)
    {
    RapidData GTPUAppRunning=
    null;
    try
    {
    //Write true to RAPID variable bGTPUAppRun
    GTPUAppRunning=abbCtrl.Rapid.GetTask(task).GetModule(module).GetRapidData(variable);
    IRapidData Value;

    Value=GTPUAppRunning.Value;
    Bool retValue=(Bool) Value;
    retValue.FillFromString(WriteValue.ToString());

    GTPUAppRunning.Value=retValue;
    }
    catch(Exception ex)
    {
    //Do exception handling
    GTPUMessageBox.Show(
    this,null,ex.Message);
    }
    }

    }
    Per Svensson
    Company Specialist
    ABB Automation Technology Products
  • Is there any reasons to cast the bool to a string and parse it to Bool via the FillFromString method?



    Shouldn't :



    GTPUAppRunning.Value = new Bool(WriteValue);



    bee enough?



    Please bear with mee - i'm new to this API.
    Best regards
    JJ