11-28-2006 02:45 PM
I really could use some advice with how my main program passes data to my SubVi, and how the SubVi handles it. Right now my main program passes values into the SubVi as fast as it gets it. The whole point of the SubVI is to perform an integral on my data. However, the change in time (dt) is never constant, so I need to always be calculating dt as I go. So I take current time T2 and subtract from it time T1, which has been passed back through the shift registers.
My questions are these:
1. Is a while loop in the SubVi the best way to go? In the main loop, the program runs continuously until I hit the stop button. So I want the SubVi to run until the main loop finishes. How do I stop the Subvi?
2. Suppose the 4 fuel flow channels don't come in at the same exact time? Let's say Fuel Flow 2 gets fed to the SubVi .002 seconds after Fuel Flow 1, and Fuel Flow 3 comes in slighty after 2? How is the SubVi going to run? Will it wait until all four channels of data are received before executing?
3. If there is no timing control for the while loops, like a wait function, I understand the the while loop will execute as fast as it can. Since I have a while loop in the main program feeding data, and a while loop in the SubVi, am I going to need to syncronize these at all?
I included the SubVi itself, and a picture of the main loop, since it has a lot of functions that are custom.
I appreciate any help.. starting to get into more advanced programming!
Thanks,
Alex
11-28-2006 02:46 PM
11-28-2006 03:03 PM
11-28-2006 03:21 PM
11-28-2006 03:24 PM
Brad,
Thanks, I'm going to have to think about what you said. In the meantime, here is a pic of the SubVi, although I don't think it'll change anything you said. It's pretty simple.
Thanks,
Alex
11-28-2006 03:59 PM
11-29-2006 11:30 AM
11-29-2006 11:43 AM
11-29-2006 01:45 PM
11-29-2006 03:05 PM