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: 

Digital output and USB 6009

Hello, how can I do this?:
I have USB 6009 and I would like to work with digital output. I would like to have switch button.

When I switch I would like to get one digital output from logic 0 to logic 1 ( from zero output voltage to highest digital output voltage).

Any tips for me?

 

 

Thanks!

0 Kudos
Message 1 of 12
(3,540 Views)

First tip: Please try to be as specific as possible with your questions.  Are you using LabVIEW? Which DAQ driver are you using?  Have you looked at and tried the examples?

 

If you mean by "switch button" a boolean control on the front panel, then consider a while loop containing an event structure set to Boolean button: Value Change event.  Inside the event case have a digital write connected to the button terminal.

 

Lynn

0 Kudos
Message 2 of 12
(3,534 Views)

Yes, I am using Labview 12 with nevest DAQ drivers. Yes, I looked on examples but I didnt find right for me.I would like to drastically change voltage on some button from zero voltage to max voltage on one digital output.

0 Kudos
Message 3 of 12
(3,529 Views)

DAQmx Write (Digital Bool Line 1Line 1Point).vi.  You will need to create a task. I do not have the examples but I suspect there are several which could be used.

  

Lynn

0 Kudos
Message 4 of 12
(3,525 Views)

Hi 

This is one example I made.

I think this would help...

 

Mark your solution... kudos are welcome  Smiley Wink

 

A_A

Message 5 of 12
(3,502 Views)

To A_A_ENG:

 

Its going pretty well 🙂 Thank you!! very much!
Btw. 5V volts is maximum voltage on digital output? And how can I do that when I always start program the output will be in log 0?

 

 

0 Kudos
Message 6 of 12
(3,486 Views)

@adssad wrote:

To A_A_ENG:

 

Its going pretty well 🙂 Thank you!! very much!
Btw. 5V volts is maximum voltage on digital output? And how can I do that when I always start program the output will be in log 0?

 

 


Yes 5V is the max. This is quite common. Did you read the spec of the device? Sometimes you've got to try some things on your own Smiley Wink.  What do you mean output will be log 0? 

 

Anything you want the program to do at startup you should put outside that loop. Put it with all the initialization code. Write whatever you want/need to the device before your loop starts.

 

Also, the code that was attached by A_A_ENG, the switch should probably be inside the case structure by convention. If it was a button with "latch" as the switching type, then it pretty much has to be in the event structure to ensure no weird behavior. There is no need for the 50 ms wait in the loop, just wire the tiemout to the event structure. Or, better yet, no need for a timeout. Just make an event case for the stop button. Have the stop button value change event stop the loop. The code you were given works, yes, but it's not the best code.

0 Kudos
Message 7 of 12
(3,482 Views)

I need with this otuput switch relay.Relay is on 9V, that I asked if 5V is maximum. When I start program I would like to have always on digital output log. 0 ( it means 0 volts) and when I switch button I want there maximum voltage for switch my relay.

0 Kudos
Message 8 of 12
(3,474 Views)

Then take the VI that is in your event structure that writes to the digital line and put another one outside your loop. Write false to it when the program starts.

0 Kudos
Message 9 of 12
(3,471 Views)

The USB-6009 always starts (when the power is turned on) with all digital lines as inputs.  Inputs have a 4700 ohm resistor to +5 V internally, so the line voltage will be high. It will stay that way until you do two things: 1. Configure the line to be an output. 2. Write a 0 or boolean False to that line.

 

To drive a 9 V relay you will need a buffer such as the ULN2003.

 

Lynn

0 Kudos
Message 10 of 12
(3,458 Views)