LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I turn a solenoid on and off?

Hello.

 

The hardware is as follows:

Labview 2009

PCI-MIO-16E-1

SCB-68 shielded I/O connector block

 

 

My job is to create a program that can work as a base from which we can create more complicated programs.  I am new to Labview.  I have watched some youtube tutorial videos and have a basic understanding of the program operation.  I built a program that reads voltage values as you rotate a potentiometer, very complex I know, as a training exercise.  From that, I see how to acquire data from an input.  The next step is to write a program that turns on and turns off a solenoid via a button.  Once I have that down, I can figure out more complex methods of turning it on and off using timing, pressure, etc.

 

I tried looking at some of the code from other projects, but it isn't clear what is going on.  I keep searching for an example online, but I the examples are all beyond my level of understanding.  Any help would be appreciated.  Even if you just point me to a site that has step by step examples. 

 

Thanks.

 

0 Kudos
Message 1 of 8
(2,824 Views)

Hi Zack,

 

don't search online, search in LabVIEW help menu: "Example finder"!

LabVIEW comes with a lot of examples...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(2,806 Views)

Thanks.  I will commence the search immediately.

0 Kudos
Message 3 of 8
(2,771 Views)

GerdW,

 

I think the main problem is I don't know exactly what to search for.  Nothing came up when I searched "solenoid."  I think I'm being too specific. 

 

Is the act of turning on/off the solenoid called a trigger, or is a trigger an event that, when it occurs, triggers something else...like the trigger in an oscilliscope?  I know, or rather I think I know, that DAQmx is what I need to do this.  I also know I can use the DAQ assist or I can program it myself.  I believe the former is currently above my skill level and the latter is even worse. 😉  Does the DAQ need to read in a value from the solenoid before it can tell it what to do?  Should I just read the entire help topic on DAQ?  I'm sure that wouldn't hurt.

 

I appreciate your help on this.

 

Darren

 

 

0 Kudos
Message 4 of 8
(2,758 Views)

goto Help>>Find Examples...>>Hardware Input and Output>>Daqmx>>Digital Output>>Digital-SW-Timed Output.vi

 

there you will find an array of buttons that output a digital TTL signal to port0, lines0-7 of your Daq  Smiley Wink

 

next question: does your solenoid take a TTL signal as an input? If not, you will need a driver like a ULN2003

 

you can use your AI to measure your pressure then use LV to algorithmically manipulate your DO's

Message 5 of 8
(2,750 Views)

**

goto Help>>Find Examples...>>Hardware Input and Output>>Daqmx>>Digital Output>>Digital-SW-Timed Output.vi

 

there you will find an array of buttons that output a digital TTL signal to port0, lines0-7 of your Daq  :smileywink:

 

next question: does your solenoid take a TTL signal as an input? If not, you will need a driver like a ULN2003

 

you can use your AI to measure your pressure then use LV to algorithmically manipulate your DO's

**

 

Thanks for the response.

 

There is no Digital Output in Daqmx.  The sub folders are: Alog Gen, Alog Meas., Control, Counter Meas., Dig Generation, Dig Handshaking, Digital Meas., Events, Generating Dig Pulses.  I assume we're talking Digital Generation.  In that folder there are two that look like they might work: Write_Dig_Chan.vi and Write_Dig_Port.vi.  They are write digital output to channel and port, respectively. 

 

I should mention I have a VI that works and turns on the valve, but I don't know what it is doing.  I think I have a lot of reading ahead of me.  There is a lot of vocabulary that I'm unfamiliar with, despite my larger than average vernacular.

 

I'm going to start reading and come back here once I have a good foundation of what everything does.

 

Thanks again for your help.


 

 

 

 

0 Kudos
Message 6 of 8
(2,741 Views)

yes, that was for LV ver 2012, but you are on the right track...do come back with your questions Smiley Wink

Message 7 of 8
(2,735 Views)

Thanks everyone for your help.  The solenoids are actually controlled via a relay and that's controlled with a simple one line digital out.  Thanks again!

0 Kudos
Message 8 of 8
(2,630 Views)