From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling digital output of usb-6501

So I have more or less been pushed into the deep end of Labview and feel like I'm making a simple task much harder than it should be so any help would be appreciated. 

 

Basically I am looking to use the 24 I/Os on the USB-6501 as outputs and when I turn on/off the output an LED on my breadboard turns on/off. It works perfectly when I use the USB-6501 Interactive Control.vi and simply check and uncheck the Drive box for the current output I am using.

 

My question now is how would I be able to create a new VI where I can wire a button to the Drive variable? Looking at the block diagram for the Interactive Control the Drive variable is nestled pretty deep and I'm not entirely sure how to control it. There must be a simpler way to do this than somehow using the interactive control.vi as a subvi and unbundling the drive variable correct?

 

Once again sorry for being so ignorant with Labview, today is pretty much my first day trying to figure it out and I just feel I might be in over my head here. Hopefully I am just overlooking an extremely simple method of doing this.

 

Thanks for your help 🙂

0 Kudos
Message 1 of 6
(3,947 Views)
That Vi you mention is not an example that comes with LabVIEW so I don't what it does. You should start with one of the on line tutorials and then look at the shipping examples. A very simple method is just have a Boolean array wired to a DAQmx Write set for n channels.
0 Kudos
Message 2 of 6
(3,921 Views)

Yea I found the digital write example and was able to change that to get it to work for me.

 

One thing I'm curious about now is how to change the output level. For some reason when I use one example program it outputs 2.3V and my LED is quite bright. However, when I use my program it only outputs .37V and the LED is noticably dimmer. Other than that they behave exactly the same so I was wondering if there is some kind of function or structure I can use to bump up the output.

 

I noticed if I add a "Wait until next ms multiple" timing thing and just set it to ~50 it makes my LED even dimmer than it already was. Is there any way to achieve the opposite effect of this?

0 Kudos
Message 3 of 6
(3,910 Views)

For the Interactive Control I am assuming you are referring to this: http://digital.ni.com/public.nsf/allkb/AF0F31EE5D2AD23F862573140009D7C2

 

The default configuration of the ports is open-collector, meaning they are intended to act as sinks. Are you connecting the LEDs assuming a source for the digital I/O and not configuring the port for this mode? If you change the output mode to active drive then the output voltage should be 3.3V. It would be in your best interest to review the manual for that device. You may also wish to read this: http://digital.ni.com/public.nsf/allkb/D9B4018C3E540CE4862570F30068C0DB?OpenDocument

0 Kudos
Message 4 of 6
(3,886 Views)

I tried changing it from 0-5V to 0-3.3V in the configuration utility but the end result is still the same and I can't figure out why.

 

I just cant find the difference between the interactive control panel (which is the one you just posted) and my program. For some reason their program outputs a higher voltage than mine does even though they both behave identically other than that. I'm thinking it must have had something to do with the way they programmed it but I'm having trouble figuring out what causes their output to be so much higher

0 Kudos
Message 5 of 6
(3,878 Views)

nvm got it. turns out they were only dim because they were flashing so fast between on and off.

0 Kudos
Message 6 of 6
(3,845 Views)