05-05-2010 06:08 AM
Thank you,
If i don't use a local variable, what are my options when using the tank reservoir to fill the other tanks. I would need to add to those tanks but subtract from the reservoir at the same time. Mmmmm ?
05-05-2010 07:24 AM
You lost me with that last post.
Can you describe what you are trying to achieve? Maybe I'm missing something.
Isn't the reservoir what you want the 10 tanks to fill into? Or do you want to fill the individual tanks from the reservoir (which is the opposite of the example)?
05-05-2010 08:18 AM
Sorry, should of been a bit clearer... 🙂 the reservoir that has been filled by the 10 tanks(rainfall) must then supply treated water back to ten other tanks(domestic tanks) for use in the home.
05-05-2010 08:52 AM
05-05-2010 10:41 AM - edited 05-05-2010 10:44 AM
Okay.. now I understand.
Well. I modified the code to show you what the original code as a sub-vi would look like. That is if you have a While Loop in your main VI.
In order to understand the code, you should look at the differences and explain to me why the differences exist. That way, you'll be able to do the next step easily.
It's not that difficult.
Your next step is to understand the dataflow within LabVIEW and why code is architectured in a certain way. Coding (model) is way easier (by order of magnitudes) than the real thing.
05-05-2010 11:53 AM
Ok...this is the bit where you see how bad i really am...
Here goes....
With this vi i would take the ten tanks out from the array as before, Ican then use the reservoir out to feed into a subtract block then to a tank, on the other side of the subtract block i would have the tanks that i will be drawing water from the reservoir to, i'm nearly finished a possible vi for this, will post in 20 min....
Do you mean to use the 90 as a control to vary settings easier?
I'll finish the tank-vi i'm at....
You can tell me where i'm wrong 🙂
Thanks again 🙂
05-05-2010 12:57 PM
Yes/No/Maybe ?
05-05-2010 01:46 PM
Sort of what i was thinking/ish......I don't even know anymore, needless to say i does sweet F all 😞
05-05-2010 02:28 PM
Simone 27 wrote:Ok...this is the bit where you see how bad i really am...
You're doing well.. Just don't give up and you will see how easy it really is.
Simone 27 wrote:With this vi i would take the ten tanks out from the array as before, Ican then use the reservoir out to feed into a subtract block then to a tank, on the other side of the subtract block i would have the tanks that i will be drawing water from the reservoir to, i'm nearly finished a possible vi for this, will post in 20 min....
This is where a predefined "Requirements Spec" is useful at the beginning of any coding exercise. If the code is to grow and do other things, then the architecture needs to support the scalability requirement of the software. It almost looks like you either: a) have a State Machine which does all what you need, or b) have separate sub-vi's that do individual functions.
Both approaches have their pro's nd cons. If it is purely to model the behavior, then the State Machine may be the better choice. A single place to play with all the code. If the model is to run an actual application (control & data acquisition), then separate sub-vi's may be better as the sub-vi's will expand in complexity and probably have State machines of their own..
--- did I just loose you? 😉 ---
Simone 27 wrote:Do you mean to use the 90 as a control to vary settings easier?
You got it. You can create a "max level" or "max tank fill %" to decide when to empty the tanks. It can be a single value for all or individual values within an array.
05-05-2010 02:31 PM
Simone 27 wrote:
Yes/No/Maybe ?
I'm not sure why you placed a Case Statement. Is the above supposed to represent the sub-vi code that I posted or the stuff you described in your previous post? Probably the latter.. Lemme check it again.. But still, why the Case Statement (with Start). What would be in the False Case and would you want to run this without executing the code at any time?
In other words, why "start"?