LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Tank Flow Auto Control - Weird Problem

I did this for a internship type thing at my school, we started by learning LabVIEW basics. I did the program fine with a simpler version of this that worked as needed but I wanted to make it better to keep learning LabVIEW (I am new to it and really like it, I want to master it haha). Anyway what I was trying to do was make the leveling of the fluids more... fluid. I am focusing on the automation of it (the automation switch is set to true and thus the left side case functions are true and the seperate tank controls remain 0-default until the set level is met then they turn off and remain at the master flow rate until another adjustment is made). Everything works pretty well I think but I have a weird problem where the tank levels level out at the set level + master flow rate, I cannot understand what is causing this, possible my set up is getting unnecessarily complicated in turn creating flows?

 

Sorry if my setup is confusing as I am just learning and havent really labeled things or made them extremely clear. But any input would be helpful, the point of this project is to be able to apply the idea to a power distribution network (generation vs load).

 

VIs attached, the Multi-Tank Flow is the main VI and then a sub-VI along with globals. Thanks in advance and sorry is there is a simple solution, I looked around but I couldnt find anything that similar, it seems most controls are using PIDs which I have not even looked into yet. Smiley Happy

 

edit: the wait timer should be longer (~100-250ms) but I turned it down to see what was happening a little easier.

0 Kudos
Message 1 of 2
(2,263 Views)

Hi Turtlegrip,

I have looked into your code and I have two things to say.

1) The code is very messy first

2) You have overused global variables. Never use global variables unless you don't have any other alternative. Global variables including local variables may cause race conditions causing unpredictable outputs. You can replace local variables with shift registers where possible and replace global variables and local variables with Functional Global Variable (FGV).

 

 

 

157+ CLDs & 9 CLA Trained
LabVIEW Training resources
0 Kudos
Message 2 of 2
(2,250 Views)