LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a Solenoid Valve using NI USB-6008

 

Dear all,

 

I am trying to control a solenoid valve using NI USB-6008 and I am trying to understand how I can signal the valve using LabView. I have been searching through the forums and have seen many threads suggesting reading the examples. The example VI's have not helped me as the do not have any discussions. All I need to know is how I can use the LabView to signal the digital output to energize/de-energize the solenoid valve (or any other device). I do have many more questions regarding the application but at this point this apparently simple question is driving me crazy! To restate the question, I need to know how I can have 5V output from the DAQ for a few seconds and then 0V output from the same pin so that I can alternate between a closed/open solenoid valve. Any help that directly addresses the question would be highly appreciated. 

0 Kudos
Message 1 of 8
(9,023 Views)

The action that you are asking about is as simple as it gets. You can control a digital output using a boolean value. Here's a full walkthrough. I would suggest testing your setup with MAX before coding in LabVIEW.

 

The real question I would have if I were you is if your solenoid can be triggered by a low power USB 6008 signal. You may need to use a transistor/relay with an external power source in order to supply enough current to trigger your solenoid. I believe the USB 6008 can only supply a maximum of 200mA and that gets split up to all the channels.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 8
(9,020 Views)

The solenoid needs more current, so you could not use digital out put to drive the solenoid directly. we can use it to control a relay, relay to control solenoid.

LabVIEW is very easy to do this, you can try MAX first, to see the hardware is working.

 

0 Kudos
Message 3 of 8
(9,009 Views)

I've used a relay board like this with a USB 6008 in the past to control components that needed more power.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 8
(9,003 Views)

James,

 

Thanks a lot for your straight to the point answer. I do have the suitable relay for my purpose and have already tried the whole system and can now control the solenoid valve manually. The main question, which you addressed, was how to do it automatically using lab view. The link you provided gives a lot of useful information although I still don't know how to make a boolean array. I assume I can figure it out easily though, and I hope it would be easy then to set the boolean to true/false for specific time intervals. However, if you think there is any info that can help me get there faster, I would be very grateful.

0 Kudos
Message 5 of 8
(8,980 Views)

Thanks for your answer Weiping. However, my question was regarding the VI code to do this task. I have the required hardware including the relay and power supply. I understand it should be a simple code, but I still don't know how it goes.

0 Kudos
Message 6 of 8
(8,977 Views)

If you're unfamiliar with how to make a boolean array, you should follow some general labview tutorials before you continue. That example I linked to shows you how to make the basic program and change between true and false values. Creating a program that manipulated the true/false values effectively and the way you want is a bit more involved (with timing and the user experience). You're trying to captain a ship when you haven't learned how to swim yet.

 

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 7 of 8
(8,968 Views)

@SiaVahidi wrote:

Thanks for your answer Weiping. However, my question was regarding the VI code to do this task. I have the required hardware including the relay and power supply. I understand it should be a simple code, but I still don't know how it goes.


Here is a basic example how to use DAQmx, and use the physical pins: PI0.0 & GND for line 0:

(this png is a snippet, you can drag&drop to your block diagram to get the code itself)

 

UserInterfaceEventPattern 1_BD.png

 

 

 

 

Message 8 of 8
(8,953 Views)