09-16-2010 10:47 AM
Hey guys,
I'm somewhat new to labview, and I'm working on a relatively easy program right now. Just to fill you in on what it's basically going to do.. It reads a voltage from a NI-DAQ which is hooked up to a machine that controls the filling of a liquid nitrogen phase separator. The voltage is read from the LED, so the signal will be about 0 V when off and about 2 V when filling. Anyway, I want to be able to just count how long the machine is filling (2V) and export this to a spreadsheet. The problem is.. I can't run/test the program with the NI-DAQ right now.. so I need to simulate a signal. No big deal, but now I'm stuck with trying to figure out how I want to count the time. I'll attach the simple lil .vi for reference. I'm trying the idea of using a while loop and count the iterations and use it as a timer. The issue is that once in the while structure, the program ignores the signal and doesn't care if or when the signal drops below 1 V in order to signal it has stopped filling. I had the idea of using a global variable and have that as a signal to have in both the main structure and the while structure so that when it does drop below 1 V, then the stop condition is triggered. Any other better ideas goin about this? Any help is greatly appreciated. Thanks, guys.
09-16-2010 11:49 AM
Use the highlight execution mode (the light bulb of the buttons below the menu) to see what you program actually does. Once you enter the while loop inside the stacked sequence, you constantly have the same value to the comparison, because the simulate signal never runs again.
To make it better, just use a single while loop and hold data in a shift register (right-click on the loop and select create shift register). In this shift register, you can place a boolean flag for isFilling and the start time. Help this idea helps you to get started. Keep posting as new questions arise.
Felix