Write Rapid Data (boolean)

Dear all,

I have problem to set a rapid boolean. :frowning:

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

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);

}

}

}

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.