03-23-2013 06:04 PM
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!
03-23-2013 06:25 PM
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
03-23-2013 06:48 PM
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.
03-23-2013 07:01 PM
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
03-24-2013 05:11 AM
Hi
This is one example I made.
I think this would help...
Mark your solution... kudos are welcome
A_A
03-24-2013 09:07 AM
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?
03-24-2013 09:17 AM - edited 03-24-2013 09:22 AM
@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 . 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.
03-24-2013 09:24 AM
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.
03-24-2013 09:32 AM - edited 03-24-2013 09:33 AM
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.
03-24-2013 10:38 AM
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