locked
How to eliminate the 'NaN' values in the continuous real time data in c# application RRS feed

  • Question

  •  I have a c# application which reads the real time data from the board. I frequently get the NaN values in between . How to get rid of them? Help me

    public void Test()
            {

                /* Flow board variable declaration */
                UInt64 frpHandle = 0;
                ushort Serial = 0;
                ushort Version = 0;

                /* Flow-rate acquisition variables */
                byte sensor_index = 0; // sensor index coresponds to flow-unit port on the flowboard from 0 to 7
                byte TimeCheck = 0;
                float flow_rate = 0;
                uint loop = 0;

                frpHandle = frp_initialization(0);


                frp_get_serial(frpHandle, ref Serial, ref Version);//to display board serial num



                if (Serial != 0)
                {

                    for (loop=0;loop<=30; loop++)
                    {


                        frp_read_flow(frpHandle, sensor_index, ref TimeCheck, ref flow_rate);


                            RTBox.Text += ("\n Flow-rate:" + (flow_rate) + "\t ul/min");

                           this.chart1.Series["Random"].Points.AddXY("", flow_rate);

                    }
                    Thread.Sleep(100);

                } 

                frp_close(frpHandle);


            }

            private void button1_Click(object sender, EventArgs e)
            {

                Test();

            }

                                                                                                                                                   
    Tuesday, November 26, 2019 10:38 AM

All replies