LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital output daq

Solved!
Go to solution

Hi,

 

This should be very easy, but for some reason I'm having issues. All I want to do is have a switch control a digital output. I am using an NI 9742 Dsub (link) card, which should be capable of digital output. 

 

Attached is my code, with a simulated card. When testing I switch the DAQ assistant properties to the real card.

 

Using this code, I cannot get a DC output at all, my scope just hovers around 100mV. Using other cards, I have the Analog I/O working just fine, but for some reason the digital output on this card isn't? Also, if you look at the card, there are 8 green LEDs towards the top. I believe each one specifies when an output is on. When I turn the switch on, the corresponding light does in fact light up, but I cannot measure a voltage? Is there some setting I'm missing?

 

Hopefully this makes sense. Thanks!

 

-secondary question: Once this works, how do I change the output range. The specs say 6V-30V output, but I do not see where to change this. 

 

0 Kudos
Message 1 of 5
(3,717 Views)

If you dig into the Operating Instructions, you'll notice that you have to supply an external power supply.  The way this card works to by connecting the external supply to the output.  You should also see this on the side of the module.  NI's site doesn't have a good sideways shot, but it looks like a switch.

 

So basically, with no power supply you will get no voltage out.  The output range is also adjusted by adjusting the external supply.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,697 Views)

Okay, I have the powersupply hooked up correctly and thats fine. I tried out that same VI on a usb6008 with the same result. I couldn't get the digital out to work, is there something wrong with the code?

 

Again, I changed the DAQ assistant to the usb6008, and I was able to read the analog ins on that usb6008 so I know I have it connected properly. 

 

Thanks. 

0 Kudos
Message 3 of 5
(3,671 Views)
Solution
Accepted by topic author g_e_m_i_n_i

g e m i n i,
I looked at your code, and noticed it only consists of one DAQ Assistant and a Boolen Array of values to write.

 

As it stands currently, the VI will only write one value, then stop. In order to continually write, you will need to place your code inside of a While Loop.

 

If you still do not see the signal from the 9742 changing, consider opening one of the DAQmx shipping examples. You can find these examples in LabVIEW by going to Help >> Find Examples...

 

Try the following example: Hardware Input and Output >> DAQmx >> Digital Generation >> Write Dig Chan.vi

 

write_dig_chan_snippet.png

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,666 Views)

Jared,

I was running continuously, instead of using a while loop, but that would be better programming. I ended up getting it working with the DAQ assistant. Thanks. 

0 Kudos
Message 5 of 5
(3,658 Views)