LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help controlling valves and pump in different timed steps

Hello Labview users,

 

I am relatively new to using labview. I know some basics of what we are using in the lab but that is it. 

For a new Project i have to design a semi continuous extraction unit. This unit will consist of 12 recipients, 24 valves and 1 peristaltic pump.

I will have to pump the liquid from one reactor to the other by choosing the valves. 

 

To make my life easier i opted to write just different VI's to do different steps, because one huge program would be to difficult. 

Currently i can open the valves i need and make the pump work for a certain time and a certain RPM. (This is the base)

The next step i would like to repeat this action for example 7 times. But each time i need different valves opened. So some sort of routine. 

(open valves, pump certain minutes at certain RPM, stop pumping, close valves and then go through the same again until all actions are completed. 

 

One of the VI's should also have some sort of time delay because it needs to do these pumping actions after 4 hours when i have left the lab. 

Now the application starts running as i press the run button but i only want it to start when i press a switch. I tried an event structure but could not get it to work.

Since these are steps, i also tried a flat sequence function, but the while loop runs very slow in that...

 

Could you please give me some advise on these matters? Once i have this base program i can use it however i want by making different VI's.

I added my base VI's on here. 

 

Thank you for your help!

 

Kind regards,

Cédric

 

0 Kudos
Message 1 of 2
(538 Views)

I'd first invest so time in making a mechanism to specify a value by an enum (type def of course), label or index.

 

You could do this in a normal VI as well. Make a DO VI that has an input to specify the specific DO. The VI would simply have a case structure with the right shared variable in each case.

 

By doing this, you can make SubVIs with inputs specifying the IO. The behavior would be the same, but the details (IO) can be specified with enum values given as an input.

 

An alternative is to make a variable bus (for instance FGV) that holds all values. You'd be able to set a value by an enum (DO_1, DO_2, etc.). All variables will be read\written in a single DAQ loop, but you'd be able to write outputs and read inputs every.

 

This will make it a lot easier to make subroutines, etc.

 

You can then use this in a number of architectures. State Machines, State Patterns, Sequencers, but even the way you are doing it (simply putting VIs in sequence) will work. The problem is it doesn't really scale up well. For instance, adding an emergency stop will be easy in a state machine, but might not be easy in a sequence of VIs (it could still be easy though)..

 

So, read into architectures...

 

 

0 Kudos
Message 2 of 2
(514 Views)