LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling solenoid valves and pumps on a timed schedule

Hi, I'm new to labview and trying to find the best way to control my system.

 

There are 5 solenoid valves, 2 pumps and a stir plate which all have to be run every half hour in a strict sequence. It will run for 16 hours a day and the system will run for 3 or more months. I've been trying to use timed loops, but have seen a lot of stuff about state machines. Do state machines require user input every day? Or can I still use a state machine and have the code loop for me? 

 

Each of the pumps/valves will only turn on for a few seconds to maybe a minute before turning off again. Is there a way I can time a case structure or something so that the pump/valve is only turned on for a few seconds before turning off again? 

 

Any help is greatly appreciated (especially any screenshots of examples)!

0 Kudos
Message 1 of 9
(5,396 Views)

Yes - you can do this with a state machine. 

 

A recent example in the forums of a state machine with varying wait periods can be found in this thread. Although it won't do exactly what you want, you can see that it does something, then waits, then does something, then waits.

 

Given the very long waits you're considering (half hours) you might want to consider alternatives, depending on your hardware setup and if you need to use it for anything else. What hardware do you have, and do you need to use it for anything else? (For example, the computer?)


GCentral
Message 2 of 9
(5,354 Views)

We have a computer set up in lab solely to run this experiment, so that shouldn't be an issue. Currently I'm trying to connect everything with a NI-DAQmx (USB-6008) to hook everything up to the computer, but I think I might have to get an arduino with relays to supply enough power to the valves (I think they will short out the DAQ).

Can I use both the DAQ and Arduino together, or would it be easier to just use one? And can I code for the arduino directly in labview, or must I use the arduino software with c++?  

 

The example was very helpful, thank you! 

0 Kudos
Message 3 of 9
(5,324 Views)

Then you can go ahead and use a state machine, I imagine. 

 

You can use both the DAQmx to DAQ board and Arduino code, but your picture made it look like you were using the Arduino to control the DAQ board, which I would guess is not the most straightforward method. There's a LabVIEW library for Arduino I believe but I'm not familiar with it.


GCentral
0 Kudos
Message 4 of 9
(5,311 Views)

@katistro wrote:

We have a computer set up in lab solely to run this experiment, so that shouldn't be an issue. Currently I'm trying to connect everything with a NI-DAQmx (USB-6008) to hook everything up to the computer, but I think I might have to get an arduino with relays to supply enough power to the valves (I think they will short out the DAQ).

Can I use both the DAQ and Arduino together, or would it be easier to just use one? And can I code for the arduino directly in labview, or must I use the arduino software with c++?  

 

The example was very helpful, thank you! 


Why not get relays that can be triggered using 5 volts and use the digital outputs of the DAQ to control them?

0 Kudos
Message 5 of 9
(5,303 Views)

So I can wire the relays between the DAQmx and the instruments without an arduino board? Do they still require a power source, and the DAQ just signals them? 

0 Kudos
Message 6 of 9
(5,275 Views)

Yes, you can connect the DAQ to the relays.  You need a power supply to power the valves through the relays.

Message 7 of 9
(5,271 Views)

Personally, for long-duration cycling, I would implement the cycle using a programmable logic controller (PLC). Once programmed no potentially unreliable computer (crashing) is needed.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 8 of 9
(5,258 Views)

We have PLCs that we have used before, but my boss is very set on using a computer and labview. Do you know the pros and cons of each system?

 

(besides the PLC being easier and quicker to setup for someone who has never used labview before)

0 Kudos
Message 9 of 9
(5,250 Views)