From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automatic tank level with timer

Solved!
Go to solution

hi guys once again am stuck with a prblm...prblm here is in my VI my aim is fill the tank automaticlly n record the time when the tank starts filling the prblm here is my timer is starting asusaul when tank strt filling but dosent stop when tank reaches to it's max level .....n 1 mre thing is i want calculate the difference of the time i.e.., the strt n end time of tank in seperate cluster.... plz sugget a solution for me if possible plz sugget me a bettr VI...here i am attaching my code so tht u cn hav btr idea wat i am supposed to say

0 Kudos
Message 1 of 11
(3,143 Views)

You should be using a proper design pattern instead of using two seperate while loops. Check here which gives you some usefull links on State Machine design patterns. (One small suggestion: Do not write in SMS language)

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 11
(3,140 Views)

hi could be more specific where i need to correct my VI

0 Kudos
Message 3 of 11
(3,132 Views)

I would say better re-write the whole code with the state machine.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 11
(3,130 Views)

I think there is something wrong with your keyboard. Quite a few keys seem to be missing.

 

You did not include the converter subVI or the type definitions, thus we cannot test your VI. But looking at the code, it makes very little sense. Why do you do this exceedingly complicated formatting operation using three for loops and lots of shift registers and primitives. I am sure it could be done with much less. Anyway, your timer loop runs completely independent from the tank loop, so how are you expecting them to synchronize?

 

Maybe you can run both code segments in the same loop, for example?

 

I have the feeling that the functionality of your program could de done with 10% of the code you currently have. try it!

 

 

Message 5 of 11
(3,124 Views)

i have no idea about state machines....without sate machines can i slove my code

0 Kudos
Message 6 of 11
(3,102 Views)

@arvi wrote:

....without sate machines can i slove my code

Yse, of crouse!

0 Kudos
Message 7 of 11
(3,072 Views)

then tell me how can i do that thing

0 Kudos
Message 8 of 11
(3,048 Views)

What have you tried so far?

0 Kudos
Message 9 of 11
(3,042 Views)

only using different loop structure...which are not working properly

0 Kudos
Message 10 of 11
(3,030 Views)