I am trying to do the live plot of a sensor data.The UI consists of a chart, a start and stop button.
When the start button is pressed, the data from sensor is plotted on the chart using a timer of 100ms. But it throws an exception like System Execution Engine exception. There is no exception or other issues if I replace the timer way of updating values with a while(true) loop.But in that case I will lose my control over the other parts of UI, as I am using only 1 thread.
Suggestions / opinions / help welcome!
while (true)
{
chart1.Series[0].Points.Clear();
// Get data from sensor using sensor sdk,
// The function returns 2 arrays, x-array and y-array of values to be plotted
// Display x and z values
chart1.Series[0].Points.DataBindXY(adValueX, adValueZ);
chart1.Update();
System.Threading.Thread.Sleep(100);
}