06-12-2012 08:49 AM
Hello Friends,
I have a problem regarding timestamps.
I acquire 12 temperature signals and store them in an excel sheet at an interval of 3 sec.
However, before I switch on recording, I observe if the temperature signals have reached a
quasi stationary value. Therefore I use a case structure.
If I directly start recording without first observing the signals, I acquire the data at exactly 3 sec interval.
However, if I first observe and then switch to recording then I receive unwanted intermediate measurements.
Can anyone tell me whats wrong with my code?.
Thanks and regards,
Chirag
Solved! Go to Solution.
06-12-2012 09:55 AM
I don't notice anything particularly wrong with your code.
Can you give us an example of the output that has the "unwanted intermediate measurements"?
06-12-2012 10:20 AM
Here it is. You will notice the timestamps exactly at 3 sec interval in
"T_measured_desired.xls".
Regards,
Chirag
06-12-2012 10:36 AM
What values are you using in your controls?
In your False case, you are using 500 samples at a rate of 50, with a 20 second timeout. That means you'll get data every 10 seconds.
In your True case, you are using the values in the controls, which are defaulted to 0.
Also, what about your "Time Limit in Seconds"? You have it set for 5 seconds which means it will hit its timer and your while loop will stop running after the 1st iteration of the while loop when the switch is True.
06-12-2012 11:07 AM
I am using the False case just to visualise the data.
In the True case, I am using 30 samples at a rate of 10, with a 10 sec (default) timeout. Therefore data every 3 seconds.
I am running a test with timelimit of 30 seconds.
After opening the file again the set values are disappearing, hence probably you were unable to
see them.
06-12-2012 12:30 PM - edited 06-12-2012 12:34 PM
In that case, you should right click on those controls and do a Data Operation Make Current Value Default, then save the VI so we know what values you are using.
One possibility is the use of the blue dynamic datatype wire which is caused by using Express VI's. You are taking either 500 or 30 samples, but in the end, you are only using 1 of those. I'm not sure if it is the first or the last. But you can see the blue wire being coerced to a single element at the Build Array function with the red dot. You might be better off using the From DDT Express VI to more explicity define how you want to get the data out of the blue wire.
Your loop timing is defined by the acquisition rate of the DAQ assistant, so I can't see any reason why your loop would run faster and you'd get closer timestamps.
06-13-2012 11:48 AM
Thanks for the help...I still did not figure out why the intermidiate values are stored..but I can live with it..:)
this problem occurs when I turn the switch for the case structure ON during the run. If I first stop 'True' the operation,
switch to 'False' and then run again, I don't run into problem..its not nice but a functioning workaround..
06-13-2012 04:34 PM
@chirag.joshi wrote:
Hello Friends,
If I directly start recording without first observing the signals, I acquire the data at exactly 3 sec interval.
However, if I first observe and then switch to recording then I receive unwanted intermediate measurements.
Can anyone tell me whats wrong with my code?.
Thanks and regards,
Chirag
I'm just trying to get a better understanding of your problem. What do you mean by "observe the signals?" How do you observe them? Is it just visually with the graph or is there some other method that I don't see on you bd?
06-14-2012 03:05 AM
I set a temperature (say 60 °C) in a thermostat and wait till all the sensors
show a quasi stationary temperature. I observe the signals graphically.
As soon as the sensors reach this state, I start recording by switching the case to "True".
The time limit of the recording is pre-set.
06-14-2012 07:30 AM
I'm not exactly sure what's going on either. Does your sampling/timeout etc in your false case match what you have set on the fp, or are you sampling at a different rate when not recording?