LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to create a filled tank auto / Manual one tank

Solved!
Go to solution

I am trying to create an automatic tank filler where when the manual option is selected it will increase or decrease depending on what the user chooses and if it is set to automatic it will fill by itself.
The problem I am having is in the condition that it locks and only fills and empties indefinitely and when I try to select the other option it simply does not give me the change.

DonRoonin_0-1749617389497.pngDonRoonin_1-1749617396886.pngDonRoonin_2-1749617406781.png

 

0 Kudos
Message 1 of 25
(1,240 Views)

Hi Don,

 


@DonRoonin wrote:

The problem I am having is in the condition that it locks and only fills and empties indefinitely and when I try to select the other option it simply does not give me the change.


Because you forgot to "THINK DATAFLOW!"…

 

When you want to change the condition inside the while loop then you should place that code inside the while loop (enum and case structure)!!!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 25
(1,216 Views)

@DonRoonin wrote:

I am trying to create an automatic tank filler where when the manual option is selected it will increase or decrease depending on what the user chooses and if it is set to automatic it will fill by itself.
The problem I am having is in the condition that it locks and only fills and empties indefinitely and when I try to select the other option it simply does not give me the change.

 

 


I suggest you to go through basic State Machine Architecture, which will help you to start your LabVIEW Learnings  in a better way.
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 25
(1,189 Views)
  • As has been said in different words, your code is "inside out".
  • There should be one top-level while loop containing all relevant code paths and terminals.
  • All terminals need to be polled and indicators updated with each iteration. They should not be hidden inside cases.
  • There is no need for any local variables and you can leave the stop button at latch action.
  • The toplevel loop needs to be paced at a reasonable rate by placing a wait. Currently, the default state spins the loop millions of time per second, draining your battery or increasing your electric bill, while starving all other processes running on your computer. 😄
  • When attaching code, do a "save for previous (e.g. LabVIEW 2019) so more can look at your VI. I can't at the moment.
0 Kudos
Message 4 of 25
(1,168 Views)

Here's a quick draft that you can use as a starting point...

 

altenbach_0-1749660551679.png

 

0 Kudos
Message 5 of 25
(1,158 Views)

i want to create a filling and basing in automatic and manual mode. so far the filling and basing part is automatic but when i want to change to manual mode it doesn't change, it stays in automatic mode
i don't know how i could change it.

DonRoonin_0-1749785982289.pngDonRoonin_1-1749785991843.png

 

0 Kudos
Message 6 of 25
(1,123 Views)

I moved your post to your existing thread here. No need to scatter the discussion.

 

(Your last code is not scalable! Have you looked at my example? All you need is a simple state machine, no sequences, no inner loops, no mountains of local variables, no disconnected terminals, no property nodes. One outer loop with a shift register. Never do equal comparison on orange wires, even though it is safe here! All terminals must be labeled. You switch only gets read every 20 seconds according to dataflow principles. )

 

I can only look at your pictures because you did not "save for previous", 2020 or below.

0 Kudos
Message 7 of 25
(1,115 Views)
Solution
Accepted by topic author DonRoonin

See if this can give you some ideas (LabVIEW 2020)....

 

altenbach_0-1749829301359.png

 

Message 8 of 25
(1,076 Views)

how did you create the cluster with the leds and avoid the array to cluster not to give you an error message?

0 Kudos
Message 9 of 25
(1,041 Views)
  • To create a cluster, you just place a cluster container and drop controls into it.
  • Cluster have a fixed number of elements, so you need to set the cluster size for array to cluster (and that works of course only if all cluster elements are of the same type, boolean in this case).
  • Nobody forces you to use a cluster, you could use index array with four output and wire to LEDs.
0 Kudos
Message 10 of 25
(1,027 Views)