LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to view the curve of the past on Strip Chart ?

Hi !

It's a fake data file created for testing purpose.But even if the data  is saved  according to correct  date order .

Our field workers find this problem on the scene. I could not obtain the data on the spot,so creating a fake data file.

 If  psm data playback 

int CVICALLBACK HfCallback (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)

 and yibiao data playback

int CVICALLBACK FhCallbck (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)

 function code has no error, where the mistake may occur ? It should have no mistakes in autosave datas function code.Whichever interface swiches to,it will autosave all datas on "Power Supply Monitor" and "Instrument Display(gas concentration and temperature, humidity)"interface.I have set two .txt files for autosave datas on each interface. Such as yibiao.txt is for the convenience of our customers access to datas.

f = fopen ("yibiao.txt", "a+");
if( f != NULL )
 {
   fprintf (f, "%s  %s     ",DateStr(),TimeStr()); 
   fprintf(f,"CO2 %g, O2 %g, Temperature %d, CO %g,Humidity %d, H2S %g, CH4 %g\n\n",CO2,O2,TEM,CO,HUM,H2S,CH4);
   fclose(f);
  }

 and yb.txt is for the convenience of dataplayback on "Instrument Display Data Playback" interface.

 f = fopen ("yb.txt", "a+");
 if(f!=NULL)
  {
    fprintf (f, "%s  %s     ",DateStr(),TimeStr()); 
    fprintf(f," %g,  %g,  %d,  %g, %d,  %g,  %g\n\n",CO2,O2,TEM,CO,HUM,H2S,CH4); 
    fclose(f);
  }

The datas replayed on   "Instrument Display Data Playback" interface have no temperature and humidity datas.

Our costomers required to add to these two kinds of datas on  "Instrument Display Data Playback" interface .

A regular data file is similar to the fake data file created except for its correct date order.

 

Best regards.

 

xiepei

I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
0 Kudos
Message 21 of 23
(850 Views)

I have recreated a data file with correct figures in it: it's a 800kB, 22k lines long file and reloads correctly without errors, so I suppose there may be some problem in original data: you absolutely need to obtain a copy of the data file where the problem arises, possibly with a screenshot of the program.

 

The only correction to your code is when extending data arrays, as you are wrongly realloc-ing 'et' array (look at highlighted names:  et = realloc (c5, aSize * sizeof (double)); ).

Nevertheless, this has no effect on the data file you provided, since there are only 800 lines of data and array extension occurs over 30k lines.

 

Attached your project with new data file for you to test on your system.



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?
Message 22 of 23
(846 Views)

Hi !

Thank you very much for your help indeed !

I will obtain a copy of the data file when we do the experiment next time.

If it still appears similar mistake,I will upload the copy of the data file and a screenshot of the program.

Thank you very much !

Wish you happy every day !

Best regards.

 

xiepei

 

I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
0 Kudos
Message 23 of 23
(842 Views)