thanks for the info., but the case never executed!
Use the "time has elapsed" boolean output to switch the case structure. (and yes, there are simpler solutions that don't require express VIs)
It is very unlikely (=impossible!) that the final elapsed time is exactly 300 and nobody should ever do equal comparisons on floating point values!
It is NEVER a good idea to use an EQUALS comparison on floating point numbers due to rounding errors. Machine epsilon - Wikipedia
In your case, it's even worse since you have to wait on your DAQ to collect its data. You are just skipping over the 300. Why didn't you just connect the Time has Elapsed boolean to you case structure? The Auto Reset function defaults to True, so it should work as is.
Or, you could change the EQUALS to GREATER or EQUALS.
EDIT: Altenbach beat me to it. 😎
BTW, you should also feed the DAQ reference out the right side of the loop and close it. Just like you did with the file reference. 😉
your code will only execute when elapsed time is exaclty 300, if by any reason the loop time is different from that it will not execute.
As an alternative, take a look on the example I attached, you can modify and include part of that on your code.
At every time the the saving happens, you need to reset the elapsed time .
@altenbach wrote:
(and yes, there are simpler solutions that don't require express VIs)!
and I typically use the high resolution time so we have units in seconds.
Thanks all for your help.
But I have this problem now "The application is not able to keep up with the hardware acquisition.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."
Also, I would like to add headers.