10-19-2025 12:32 AM
I am trying to implement a two-loop automated control sequence in LabVIEW, involving multiple valves, a vacuum pump, and a water circulator (chiller).
Each loop corresponds to a specific operation mode, and I want to be able to switch modes as needed.
Here is what I want the control logic to do:
Open the valve of device A, start the vacuum pump.
When the pressure of device A reaches the target value (1.7 kPa), close valve A.
Open valve B.
When device B reaches its target pressure (1.82 kPa), close valve B and turn off the vacuum pump.
Open and activate device C for 10 seconds, then close valve C.
Start the water circulator (this should also be controlled by code).
Open valve D, keep it open for 5 minutes, then close valve D and stop the water circulator.
Open valve A, start the vacuum pump.
When device A reaches its new target pressure (4.24 kPa), close valve A.
Open valve B.
When device B reaches its target pressure (3.78 kPa), close valve B and turn off the vacuum pump.
Start the water circulator (controlled by code).
Open valve E, keep it open for 5 minutes, then close valve E and stop the water circulator.
I plan to implement both loops and switch between them using a mode selector in LabVIEW.
However, I am struggling with:
How to properly connect and organize the block diagram to execute these sequences step by step,
How to manage timing and pressure conditions between each step (e.g., using Case Structures, Sequence Structures, or State Machines),
And how to ensure that valves, pumps, and the water circulator are synchronized correctly.
Could you please explain how to structure this logic in LabVIEW,
and whether it would also be possible to simulate for verification before hardware implementation?
10-19-2025 01:07 AM
If mode 1 and mode 2 are two different states, you only need one loop and a simple state machine architecture. States change as a function of mode and the various threshold comparisons.
Is the user allowed to switch modes in the middle of the current mode or is switching only possible when a mode has completed all steps? The two states are very similar, differing only in some threshold and one valve.
What have you tried?
10-19-2025 01:13 AM
Thank you for your response.
Currently, I am planning to allow switching to another mode even if the current mode has not yet been completed.
So far, I have been working on setting up the system based on an example I found.
As this is my first time attempting this, I would greatly appreciate any guidance or support you can provide.
Thank you very much.
10-19-2025 08:59 AM
@jhkjhk424 wrote:Currently, I am planning to allow switching to another mode even if the current mode has not yet been completed.
So far, I have been working on setting up the system based on an example I found.
As this is my first time attempting this, I would greatly appreciate any guidance or support you can provide.
Thank you very much.
If you switch to a new state in the middle of the other state, should the new state start from step 0 or from a similar state?
I currently cannot open VIs saved in version 2025. I recommend to do a "save for previous" (LabVIEW 2020 or below) and attach again.
10-19-2025 09:12 AM
Thank you for your additional reply!
You should start from the very first step.
As shown in image 1, there is a problem that prevents saving with Save for Previous. However, although the setup I’ve put together is very incomplete, I will show it to you in the image.
Best regard
10-19-2025 10:46 AM - edited 10-19-2025 10:47 AM
You did not select a proper file name for the save for previous.
(Showing a truncated picture with a broken wire going outside the visible area is pointless.)
10-20-2025 03:57 AM
Thank you for reply!
I renamed the file and save previous version.
If it doesn't work, please...check the image...
Best regard..!
10-20-2025 08:37 AM
If you hover over the broken boolean wire with the mouse, it will tell you that the wire has no source. Where should it's value come from?
The rest of the code seems rather incomplete.
10-22-2025 01:21 AM
I understand that the code looks incomplete — that’s actually why I’m asking for help.
It would be really helpful if you could show me how to fix or complete the missing parts.... 😞
Thank you for your understanding.
Best regard
10-22-2025 01:36 AM
Hi jh,
@jhkjhk424 wrote:
I understand that the code looks incomplete — that’s actually why I’m asking for help.
It would be really helpful if you could show me how to fix or complete the missing parts.... 😞
Christian Altenbach already told you you only need ONE loop to create your statemachine.
Have you started to implement this ONE statemachine in ONE loop?
@jhkjhk424 wrote:
However, I am struggling with:
How to properly connect and organize the block diagram to execute these sequences step by step,
How to manage timing and pressure conditions between each step (e.g., using Case Structures, Sequence Structures, or State Machines),
And how to ensure that valves, pumps, and the water circulator are synchronized correctly.
There are 5 valves (outputs) and 2 pressures (inputs).
Additionally there are 2 pressure limits (config inputs) and a mode selector (user input). Some states should handle time measurement by evaluating timestamps.
Your statemachine needs to:
When creating statemachines it often helps to draw their flow chart on a sheet of paper. Really!