LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Im a student having trouble with a Municipal Water Managment System Project......Help please !!!

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 ?

 

 

0 Kudos
Message 31 of 77
(1,633 Views)

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)?

0 Kudos
Message 32 of 77
(1,622 Views)

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.

0 Kudos
Message 33 of 77
(1,612 Views)
That's why i was trying to make it a sub-vi with the output being the reservoir so as the 10 new tanks filled they would subtract from the reservoir... TRYING being the operative word !!
0 Kudos
Message 34 of 77
(1,601 Views)

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.

 

 

The comment in the code is no longer applicable.  It should say "Reset counter if > (# of tanks - 1)".
Hint:  A sub-vi should allow flexibity to the main VI by passing parameters.  As a matter of fact, there is another constant that should be a control.  Can you identify it?  It's really easy and no trick question.
Message Edited by Ray.R on 05-05-2010 11:44 AM
0 Kudos
Message 35 of 77
(1,580 Views)

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 🙂

0 Kudos
Message 36 of 77
(1,561 Views)

My tank.jpg

Yes/No/Maybe ?

0 Kudos
Message 37 of 77
(1,551 Views)

pic111.jpg

Sort of what i was thinking/ish......I don't even know anymore, needless to say i does sweet F all 😞

0 Kudos
Message 38 of 77
(1,539 Views)

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.

 

 

0 Kudos
Message 39 of 77
(1,524 Views)

Simone 27 wrote:

My tank.jpg

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"?

0 Kudos
Message 40 of 77
(1,523 Views)