I'm trying to time an event as part of larger VI, I've attached the bit I want to do the timing, it's based on the example VI. My input will be initially true then go false for a period of time (which I want to measure) and then go back to true at which point I want to stop the timing and stop this VI so it then moves on to the next step. I can see why my timer doesn't work, but I can't see what to do to make it work. Basically when the case structure goes back to true it goes back to outputing a zero, so it always just returns the value of the final timer. Is there some way i can make it store the initial value and save that to then subtract off the final value?
Solved! Go to Solution.
You need a shift register or feedback node to store the millisecond timer value at which the boolean input first goes false. If the existing feedback node is equal to 0, and the value from the DAQ assistant is false, store the millisecond timer value - that's the point when the input first changed to false. Otherwise, just pass through the value from the shift register (or feedback node).
Cheers, but I've already tried that and can't make it work. The feedback node only stores the last value, but I need it to store the first value. The problem is that each time my while loop runs it re-runs the true/false case structure and overwrites the value in the feedback node. I can right click the tunnel on a case structure loop and say "Default if unwired" but what I really need is "use the previous value if unwired" or some equivalent way of doing that.
I can right click the tunnel on a case structure loop and say "Default if unwired" but what I really need is "use the previous value if unwired" or some equivalent way of doing that.
Again, you need a feedback node, as shown below:
Cheers, I see now, I've tried it and that does just what I need. That timer VI looks like it would be pretty handy too, but the feedback node option works fine for me.