Hi, I'm trying to write a VI that takes in continuous data from a few thermocouples, displays the current temperature through a chart, and also saves the temperature for a certain period of time when specified by the user via a button. The code seems to be mostly working with one small issue, the log time of the saved data and the log time set in the VI do not match up. For examples, if I set the log time to 10s in the VI, the saved data from a single recording will only be for 8.8s or something similar. Any help you could provide with fixing this would be greatly appreciated, thank you.
Solved! Go to Solution.
Let's just say that you are dealing with different timing sources that are not quite the same. You are also fighting the fact that the Elapsed Time will output a TRUE when the time is greater or equal to 10 seconds. So if 10.1 seconds has passed, whatever you just collected will not be recorded.
The better route here would be to determine the number of samples you actually want to collect. If you have a sample rate of 5 S/sec and you are collecting 5 samples per iteration, that comes out to 1 second loop rate. So if you want 10 seconds of data, just collect for 10 iterations. So you just keep a simple counter in a shift register.
Thanks, I redid the data reading with your advice and was able to make it work. Not sure if it's the most efficient way to do it but it gives me the result I want.