08-13-2018 08:17 AM
I have a problem with this i, i's value isn't passed to the Tank variable and block this Loop work.
Can you help me?
I would like changing my work from this
To this modul
Solved! Go to Solution.
08-13-2018 08:41 AM
Please clean up your block diagram so you don't have backwards running wires. And attach your VI. Partial screenshots don't tell us what else is going on in your VI and are impossible to run to try out for ourselves.
I'm afraid I don't understand your English where you say "and block this Loop work."
08-13-2018 09:09 AM - edited 08-13-2018 09:11 AM
You do strange.
While loop... if i >= Fluido, then Fluido = i Looks like you want Fluido = integer (Fluido)
Looks like you want Fluido = integer (Fluido)
So, your code should be
08-13-2018 09:35 AM
@RavensFan ha scritto:
Please clean up your block diagram so you don't have backwards running wires. And attach your VI. Partial screenshots don't tell us what else is going on in your VI and are impossible to run to try out for ourselves.
I'm afraid I don't understand your English where you say "and block this Loop work."
I'm sorry for my english. I would like to do this code in Untitled1.vi
while/for {
if(buttonstop==false){
tank=i; The value is not assigned to the tank.
}
}
08-13-2018 10:00 AM
See my comment on picture.
You need to understand dataflow
08-13-2018 10:00 AM - edited 08-13-2018 10:01 AM
Do you realize in both of your VI's you've created a data dependency where the later loops can only run after the first loop stops because you've run a wire through the loops?
Turn on highlight execution and watch your code run.
08-13-2018 10:04 AM
@Artem.SPb wrote:
See my comment on picture.
You need to understand dataflow
Actually in loops 2 and 3, you don't know if they'll only run once because you don't know if stop has been pressed. We also don't know if the value that i is being compared to is negative or positive. It has to be negative since i starts out as zero in order for the loop to run more than once.
08-13-2018 10:21 AM
@Artem.SPb ha scritto:
See my comment on picture.
You need to understand dataflow
I understood the dataflow. My problem is in the first cycle, the value of i is not passed to the Tank variable. The view remains locked if I run it and does nothing even if the stopbutton is false.
The second and third cycle is not a problem, I can not understand why the first cycle does not do anything.
08-13-2018 10:24 AM
What is the value on the orange wire? On the first iteration, i=0 So if the orange wire is anything greater than 0, the loop will stop after the first iteration.
08-13-2018 10:29 AM
@RavensFan ha scritto:
What is the value on the orange wire? On the first iteration, i=0 So if the orange wire is anything greater than 0, the loop will stop after the first iteration.
Set its value through the view before starting the program, set any value other than 0, but it does not do anything.