Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I apply voltage to a digital output?

Hello,
 
I am trying to turn on the voltages supplied to three digital outputs. The voltage of the three digital outputs will be used to switch (open/close)three 3-5V relays. What type of routine would i have to set up if I wanted to switch the relays according to a inputted numeric value? I am using a USB 6251 DAQ and Labview 8.2.  I would appreciate any feedback. Thanks! 
0 Kudos
Message 1 of 7
(3,743 Views)
If you want to specify a number, in your case 0-3, look at the shipping example called Write Dig Port.
0 Kudos
Message 2 of 7
(3,732 Views)
I found the "write to data chan.VI" which seems to work fairly well in switching the digital outputs on(high) and off(low) . The problem that I am having right now is that I want to switch three digital outputs on and off according to a specific input voltage. Example:
 
Input Voltage: 4-5  V,       Digital Out 1: On (5V),  Digital Out 1: Off (0V)  , Digital Out 1: Off (0V)  
Input Voltage: 2-4 V,        Digital Out 1: On (5V),  Digital Out 1: On (5V)  , Digital Out 1: Off (0V)  
Input Voltage: 0-2V,         Digital Out 1: On (5V),  Digital Out 1: On (5V)  ,  Digital Out 1: On (5V)  
 
I was thinking of using a case structure to conditional disable parts of the VI but I have not been successful.
In the attached VI i am trying to switch the outputs on and off using a boolean switch placed in the frontpanel. Sadly it doesn't work as i hoped it would work.I would greatly appreciate itIf anybody could help. Thanks !
 
 
0 Kudos
Message 3 of 7
(3,688 Views)
How your program is written and what you described does not match. The program has 8 lines defined but you say you only want to pulse 1 (Digital Out 1). I've modified the program to match your description. Only one line is defined and the pattern is set in the input array. A for loop around the DAQmx Write (1 line - 1 point) will auto-index the input array and run the pattern. You also have no analog input so I don't know where you will be getting this. If you really want to apply a pattern of 3 digital lines, then please explain a little better.
 
p.s. I cleaned up the wires at the same time. Neatness does count. And please spend some time at http://zone.ni.com/devzone/cda/tut/p/id/5434.

Message Edited by Dennis Knutson on 07-17-2007 05:15 PM

0 Kudos
Message 4 of 7
(3,684 Views)
I made a mistake  describing what i wanted to do with the VI. There are three, not one digital outputs that needed to be controlled according to an inputted analog signal (Voltage) in the form of a  double. In the file that I posted I did not have an anlog signal open and close the digital voltage output, I wanted to uses boolean switches  on the front panel instead.
 
Input Voltage: 4-5 V,       Digital Out 1: On (5V),  Digital Out 2: Off (0V)  , Digital Out 3: Off (0V)  
Input Voltage: 2-4 V,        Digital Out 1: On (5V),  Digital Out 2: On (5V)  , Digital Out 3: Off (0V)  
Input Voltage: 0-2V,         Digital Out 1: On (5V),  Digital Out 2: On (5V)  ,  Digital Out 3: On (5V)  
 
I am still attempting to come up with an appropriate case structor to control digital outputs but I still wasn't able to make it work the way I want it to work. I am sorry If I seem amateurish, I fairly new to labview. Thanks !
 
The attachment contains the modified VI.
0 Kudos
Message 5 of 7
(3,657 Views)
I was able to make the voltages turn on and of according to a true false condition. The only problem that I having right now  is that the switch period bewteen "on" and "off" is somewhat long. My next step will be to set the case loops to switch according to the inputted voltage. Thanks Again!
0 Kudos
Message 6 of 7
(3,656 Views)
Okay, now that I know exactly what you want to do, let's simplify what you have written. I put the case statement inside the loop because I assume you want to continuously monitor something. I wired a numeric to the case selector to give you an idea how to approach the selection of your different sense voltages. You will have to do some further modification if you are reading floating point numbers. I also change the DAQmx Write to use multiple channels. You don't need three separate tasks running.
0 Kudos
Message 7 of 7
(3,648 Views)