Unable to use ValueChanged Property

Hi’

I am trying to make the value of rapid data available at all times on the FlexPanadant custom GUI. So I used the valuechanged property code to retrieve these data value everytime it changes. This is giving me problems by throwing exeptions everytime I run the flexpandant application.

I am using VisualStudio2008, RobotWare5.11.0160.00 and RobotStudio5.11.

Any assistance on how to solve this is greatly appreciated!

Thanks’

Please post a sample of the code you are using to do this.

Here is the sample code!

public TpsViewIRC5App1410test()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

//

// ToDo: Add any constructor code after InitializeComponent call

//

RapidData collect = aController.Rapid.GetTask(“T_ROB1”).GetModule(“MainModule”).GetRapidData(“startPr”);

this.collect.ValueChanged += collect_ValueChanged;

}

void collect_ValueChanged(object sender, DataValueChangedEventArgs e)

{

this.Invoke(new EventHandler(UpdateGUI), sender, e);

}

private void UpdateGUI(object sender, EventArgs e)

{

//bool test = Convert.ToBoolean(collect.Value);

//ExecutionStatusChangedEventArgs args;

//args = (ExecutionStatusChangedEventArgs)e;

this.led1.Value = 1;

}

============================================================
Thanks’

Where are you declaring and instantiating your controller object? What exception type are you getting? I would assume its a NullReferenceException if you are not instantiating the controller somewhere. Also, you might want to consider using the DataBinding control to do this instead, its use is described elsewhere in this forum.

You might want to try acontroller.GetRapidData((taskname,modulename,varname), and make sure that your variable is a PERS.