08-24-2006 07:20 AM
08-24-2006 08:35 AM
Consider multithreading your application, pass the data using a queue to a seperate thread (loop) which will wait for 1 minute and then empty the queue and append the new values to a file (tab delimited). This will take the overhead from the main loop and should help. Remember that if you are logging large sums of data (MBs ) at a time you will eventually see a slowdown when the application overwhelms your ram and your virtual memory kicks in so try to avoid this with multitreading and load balancing.
Paul
08-24-2006 12:28 PM
08-24-2006 11:12 PM
Dear Johnsold,
Thanks for the input buddy, ya that is wat i think could be the best option for me, because i am also doing some value addition in the variable at the same time, so it also be done on the same period, and this is what i think is the best option, but for i think i have to convert the curret time into the relative time, isnt it? but what could be the method to do so? should i convert it into the miliseconds or seconds? and relative to what?
Thanks,
Nishant
08-24-2006 11:26 PM
Dear Paul,
As you told me, i am not sending datas into the MBs, and my vi is round about 1 MB, but the problem is vi is taking more time in gethering the signal and then converting that array to the string and giving that data to the Excel file and because of that codr slows down in each loop, so i m not able to place the another code, either i can modify this code, and there is no other option.
Thanks,
Nishant
08-25-2006 04:11 AM
When you have an inaccurate timing, that keeps adding up, then you should make the reference time different.
In stead of timings against the last save time (which includes all previous timing errors!), you should time against the start time of the experiment. You only need a counter that keeps track of the number of times you saved allready. (Often simply the 'i' in one of your loops)
Thus save when:
current time >= start time + (counter * interval).
(Can be done with the elapsed time vi, by putting (counter*interval) at the time target input.)
This method assures that even after many hours, you still have at most the 1 second inaccuracy from the vi that's checking the current time. The error in the timing can never add up.
08-25-2006 04:57 AM
Dear Anthony,
Thanks for the reply and even i like the idea, now what i have done is to use the Tick Count/60, which gives current second, store the initial into the shift register and then each time after 60 seconds, we will make the option true to log the data and that second will be logged into the shift register and loop continues for n time, and it also works fine for me. anyways thanks for the input, its real nice one.
Thanks,
Nishant
08-25-2006 09:35 AM