02-07-2006 03:56 AM
02-07-2006 04:08 AM
I'll try to describe it with words, so that you can try to create the vi yourself.
So as you already mentioned, you need a while loop, where you read and compare boolean values. To detect an edge you need the old and the current value. So this means you need a shift register, so that the current value of loop x is available as old value in loop x+1.
The pattern of a rising edge is oldvalue = false & currentvalue = true, right? So this is what you have to code.
Hope this is a usable starter.
Just have a try and don't hesitate to ask, if you get stuck.
02-07-2006 08:26 AM
02-07-2006 08:45 AM
05-15-2012 04:48 AM
I have a similar problem.
I have two voltage meters that output a "high" and a "low" signal.
I want to measure the duration of a drop when the first signal is low and the second is high, but only when the signal falls, not when it rises.
This is the screenshot of the current output.
As you can see it detects both cases instead of just the first.
I can also provide the VI if needed.
05-15-2012 05:04 AM
Well, I don't work with LV anymor as I changed my job, but let's give it a try...
Obviously, you already measure the first duration correctly. As you measure the second duration as well, there must something be wrong with your "triggers". I'd suggest you to build kind of a truth table for the trigger conditions.
For example U1 is high and U2 is high = idle, U1 is low and U2 is high = start measurement and so on. This can guide you to the current problem or it may help you create another trigger logic.
05-17-2012 04:03 AM
Yes, I'ver come this far, but I can't figure out how to build the truth table you mentioned.
For now it's like this:
if the signal is high, it records the time. If the signal is low, it doesn't.
05-17-2012 01:35 PM
Please post your VI along with some typicla data and a clear indication of what you want it to do. Someone will likely be able to help. It is very difficult to troubleshoot from a few sentences.