05-29-2012 02:31 PM
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.
Solved! Go to Solution.
05-29-2012 03:35 PM
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.
05-30-2012 08:02 AM
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.
05-30-2012 09:53 AM
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
05-30-2012 11:54 AM - edited 05-30-2012 11:58 AM
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.