09-14-2009 09:47 AM
Hello,
I have done that VI to simulate a simple tank. It is works, but i would like to do the graphic slowly. I would like to do the graphic according to theupswing of the tank. What do i have to change on my vi. thanks |
09-14-2009 10:03 AM - edited 09-14-2009 10:04 AM
Put a longer wait in your For Loop?
09-14-2009 10:10 AM
I don't quite understand why all of that code is in the for-loop, since none of it depends on the loop iteration. You are calculating the same exact thing 10 times.
If you are trying to do something interactive, such as being able to change the input parameters while the code is running, then you need a while loop, not a fixed-length for-loop.
09-14-2009 12:46 PM
hello smercurio_fc
I´ve put in a for-loop because i was trying to put a delay. But it didn´t work. Do you know how i can do what i want?
09-14-2009 12:59 PM
no need to have it all in the for-loop to feel the delay
09-14-2009 01:03 PM
You have a for loop that has the i terminal going to the tank indicator. That makes it look like the tank is filling.
You have other code completely unrelated in that For Loop as well which will calculate the same information 10 times and send it to an XY graph indicator (though when I run it, I don't see anything on the graph.)
What do the two bits of code have to do with each other?
09-14-2009 01:04 PM
You can have a wait in a while loop as well.
Just wire the condition terminal to the tanks level.
For example, if the tank holds 100 L,
have a boolean check:
if Level >= 100: stop
09-14-2009 01:44 PM
i would like that each interation of euler vi, should step up my tank. But i don´t know where to connect my tank. I would like to see my tank increasing the level and the graphic converging in the same time
09-14-2009 02:23 PM - edited 09-14-2009 02:31 PM
Somewhere along the way my Euler's Method example stopped working so well. I reverted to it and modified it as well. Some points to consider:
The Euler Method VI returns all of the values, if you want each individual iteration you'll have to modify the code.
Please set current values to default before saving and posting VIs.
This modified example (saved for LV8.5) calculates all of the values, then slowly graphs them and updates the tank.
Edit: Plot style doing weird things for me, make sure Plot 1 is a point plot for proper appearance.