I am using National Instrument to do data acquisition and show the collected data on charts. However, the curve has a sharp tip when I zoom in the curve as shown on the image:
I am using the following code to get this chart:
private void timer9_Tick(object sender, EventArgs e)
{
Task analogInTask1 = new Task();
AIChannel myAIChannel1;
myAIChannel1 = analogInTask1.AIChannels.CreateVoltageChannel(
"dev1/AI1",
"myAIChannel1",
AITerminalConfiguration.Rse,
0,
5,
AIVoltageUnits.Volts
);
AnalogSingleChannelReader reader1 = new AnalogSingleChannelReader(analogInTask1.Stream);
double analogDataIn1 = reader1.ReadSingleSample();
tension1Reading.Text = analogDataIn1.ToString("f2");
DataPoint dp0 = new DataPoint(x, analogDataIn1);
chart2.Series[0].Points.RemoveAt(0);
chart2.Series[0].Points.Add(dp0);
x++;
if (checkBox1.Checked == true)
chart2.Series["Series1"].Enabled = true;
else
chart2.Series["Series1"].Enabled = false;
}
I am using a tension sensor to collect data so that I can show them on graph. Is that the problem of x axis not matched with y axis. Since I am using [x++;] to count the x axis while I use analog data Input to get Y axis. How can I get a straight or smooth line?