12-04-2014 08:10 PM
Hi everyone,
I'm pretty new to LabView and have been working on a project that uses it. I've run into a problem in part of my code. I have a wave form graph that is reading voltages from a DAQ card and I'm finding the rising edge of it. When the rinsing edge occurs it produces a true boolean that I pass to a case structure to trigger another event. The problem is the waveform data collection is in a while loop, because I think it has to be to keep collecting data, so it continuously sends true booleans until it is no longer on the rising edge. I want it to just send one true boolean when it hits the rising edge and then wait until it hits it again because its a sine wave.
I apologize that I don't have code to post right now, but any thoughts or diagrams would be much appreciated!
Solved! Go to Solution.
12-04-2014 08:23 PM
This is essentially how I'm collecting my data. Except I also have some logic in the loop to find the rising edge and output a true boolean.
12-04-2014 09:02 PM - edited 12-04-2014 09:07 PM
This should be made into a subvi with execution set to reentrant execution. This uses a shift register to pass the previous iteration value of the Boolean so you can detect the rising edge. The shift register is a key way of saving data in Labview.
12-04-2014 09:07 PM
I'm not sure if I understand what it does, or where I should wire it
12-04-2014 09:12 PM - edited 12-04-2014 09:14 PM
You need to take some basic Labview Courses. This is a pretty simple cut and paste into your code. The Boolean connects to your Boolean and the rising edge connects to your case structure. Do you know how to create a subvi?
12-04-2014 09:21 PM
I do know how to create a sub VI yes. So right now my current boolean for the rising edge is in the data collection while loop that I posted a scree shot of. Do I wire that boolean, inside of the data colleciton while loop, to your boolean, outside of the data collection while loop, and then just to the case structure? This gives me one true boolean output everytime the rising edge occurs?
12-05-2014 07:03 AM
Don't reinvent the wheel. Just use the Boolean Crossing PtByPt VI. The output of your rising edge comparison goes into this VI and you specify "false-true" direction. The output will only be TRUE on the first sample of your rising edge.
12-05-2014 03:36 PM
Thank you! That VI worked perfectly!