09-02-2004 04:40 PM
09-02-2004 05:27 PM
10-24-2008 04:06 PM
I there,
I used the Get Date/Time In Seconds function in the Time & Dialog pallete with the To Double Precision Float function found in the Numeric - Conversion palette but when I take my data, I have the same result with the express vi for Elapsed Time after my substraction to start at 0. I skip some seconds. I need to acquire
data at every 5 and 10 sec. I do a "modulo" on my time in second but it isn't an integer. I do a "floor" on my result of modulo and then it skip second like the Elapsed Time VI.
Do you know what I mean??? >:-s
Thanks
10-24-2008 04:22 PM - edited 10-24-2008 04:23 PM
You need to put the code that you want to wait on inside the True case of a case structure which is wired to the Time has elapsed function of the Timer.
As it is now, the loop is running as fast as it can (which is why you see some duplicate times) and are recording all the points. You are basically at the mercy of the Windows timer which does not have very good resolution.
10-24-2008 04:32 PM
10-27-2008 02:30 PM
Thanks for your help,
I try to take the data at all 5 sec for the graph and all 10 sec for the data for the test. I use the time stamp of de DAQ with 0,1 for the 10 sec, but I am allways late on the real time. It is the same thing for the time Elapse VI after 3 acquisitions, I'm late of 1 sec. What I have to do to acquire data right on time? I give you an exemple of my code.
Thank you again.
10-27-2008 03:24 PM
Two quick suggestions.
1. Don't use Local Variables such as ind num temps 2. Run a wire from where it gets written to the terminal to each location where you are using a local variable. This prevents race conditions. If the part of code that uses a local variable gets run before the indicator gets updated, it will be using stale data.
2. Create your DAQ task only once outside the loop. Clear the task after the loop. The act of creating the task and clearing it on each loop iteration takes time, and could even cause you to lose data.
10-28-2008 08:12 AM
Thanks a lot!! It works!
Gustave