LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Strip Chart to Show curve is too slow

Hello every,

 

I use CVI to collect save and display data, which from Serial port (Data from a custom equipment. Use a NI RS422 board and NI industrial PC to receive).

 

The baud data is 256k (parity:0, dataBits:8, stopBits:1), and the real transmission speed is 15kB/S,each group of data contains 3 bytes.

After processing the requirements of the curve displly rate is 10Kpoints/s.

 

Data collection and saving are going well (that means save data at 15kB/S to files is OK), but when I add show curve funciton ( PlotStripChart()), the runing become so slowly (the speed down to 2kB/s). So up to 80% of the data is lost. 

 

Due to the integrity of the data related to the integrity of the waveform,so it is not feasible to reduce cuve of sampling points.

So ,I can only separate data acquisition and waveform display, to ensure the integrity of the waveform.

But it can only realize the waveform playback, and unable to realize to the real-time display of waveform.

 

I want to know what controls or methods in CVI can realize the real-time display of the waveform(10Kpoints/S).

 

The following is the code of serial port callback

void uartcallback(int portNo,int eventMask,void *callbackData)

{

...

       if(i<=SIZE_BUF)

       {

              ComRd (COMNU, buff, i);

              flag_err=0;

       }

       else

       {

              err_count++;

              flag_err=1;

              SetCtrlVal (panelHandle, PANEL_NUMERIC3, err_count);

       }

...

                                           

       for(k=0;k<i;)

       {

              //Head parsing

              if(buff[k]==170)

              {

                     //data processing

                     value[0]=(double)fabs((buff[k+1]-(64+0)))*10*0.038912;

                     value[1]=(double)fabs((buff[k+2]-(64+0)))*10*0.038912-3;

                     //data save

                     fprintf(fp_ys, "%d", buff[k+1]);

                     fprintf(fp_ys, ",%3d\n", buff[k+2]);

                    

                     fprintf(fp_ch, "%f", value[0]);

                     fprintf(fp_ch, ",%3f\n", value[1]+3);

                    

                     //show curve,lead data lost

                     PlotStripChart (panelHandle, PANEL_STRIPCHART, value, 2,0, 0, VAL_DOUBLE);

                    

                     k=k+3;

              }

...

       }

 

Thanks!

0 Kudos
Message 1 of 2
(4,021 Views)

Duplicated post: follow the discussion here



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,995 Views)