Dear All,
Data comes to my serial port every 6 seconds.
My application is capturing the data @ 1 data/6 seconds initially, properly and converting it into graphs.
But as the time proceeds the capture rate becomes @ 2 data/12 seconds and again after some time @3 data/18 seconds.
At the end of 10 hours its around @ 50-60 data/6 minutes ... and keeps increasing.
MY QUESTION IS : WHY DOES THE TIME INTERVAL KEEPS ON INCREASING AND WHAT CAN BE DONE TO KEEP TIME INTERVAL AT 6 SECONDS?
Please note that no data is lost even though the application comes to a stand-still for 6 minutes.
I have searched various forums for many days without any success.
I am attaching the code and properties settings.
private void Import_Data_Button_Click(object sender, EventArgs e)
{
if (LiveMenu.Checked)
{
LiveMenu.Checked = false;
Live = false;
SPTimer.Enabled = false;
try
{
if (SP.IsOpen) { SP.Close(); }
}
catch { }
}
else
{
{
LiveMenu.Checked = true;
Live = true;
SPTimer.Enabled = true;
try
{
if (!SP.IsOpen) { SP.Open(); }
}
catch { }
DrawGraphs();
}
}
private void SP_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
try
{
Serial_Data += SP.ReadLine();
}
catch { }
}
private void SPTimer_Tick(object sender, EventArgs e)
{
SPTimer.Enabled = false;
if (lblLive.Visible == false) { lblLive.Visible = true; }
else { lblLive.Visible = false; }
if (Serial_Data.Contains("\r"))
{
WriteToDatabase(Serial_Data);
Serial_Data = "";
}
SPTimer.Enabled = true;
}
Any suggestions will be of great help to me.
Thanks!!!
Rupali