03-26-2013 01:55 PM
Hi. I have built a gaussian noise generator nad need some timing help. The VI needs to count time only when the signal is too low. Currently I have an Elapsed Time express VI instide a case structure. It begins timing when the signal drops just fine, but continues to count time until the program stops running even when the signal increases again. I'm not sure how to program an if and only if sort of situation for this. Any ideas would be wonderful, and I have attached the VI.
03-28-2013 09:46 AM
My gut reaction is that you should not be using the "elapsed time.vi" to measure time. You will get a very innacurate measurement.
Instead, you should be looking at your raw data, and counting the number of samples that are below your threshold.
But of course, if you are OK with innacuracy (which you might be ... depends on your application) then you should probably use a shift register to track when the value goes below your thrshold, and then add the elapsed time to the shift register.
You may also want to start here to learn more about structures.