Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Help using labview and the usb 6259

Hi, Im new to labview and the NI USB 6259 device. Im trying to create a program that would let me use this hardware to output 4 different voltages (2V to 5V) and switch them in time.

Like output 1, 4 volts for 10 minutes, then output 2, 2 volts for 1 hour, then output 1 and 4, 3 volts for 30 minutes.

and also something like leaving output 1 and 4 static and setting output 2 and 3 to switch voltages back and forth.

 

So, do you know if theres already some labview modules that let me do this or where should i start looking?

 

Thanks in advance/

0 Kudos
Message 1 of 4
(4,033 Views)

gpetre,

 

What you are looking to do is possible from a software standpoint. Let me introduce you to the Example Finder, in LabVIEW go to the Help menu and then look for Find Examples. This is always a good place to start when doing any programming because there are built in examples that you can reference as you write code. Specifically in your case you should look at an example called Voltage - On Demand Output.VI, most of the examples are also available online, so I linked it for you.

 

You will define the channels in the Physical Channel(s) terminal and you can have a single channel or multiple channels. By default the terminal is Dev1/ao0 in the program but you can change that to whatever you want. If you wanted 4 channels, let's say channels 0-3 then all you would need to do it have Dev1/ao0:3 as the channel list. You can also use the drop down arrow on the control and use the Browse option to select different lines that might not be adjacent. 

 

Now, the next thing you will notice is that there is a 1D array of values going to the DAQmx Write VI, with a Control for Output Array. This array needs to have the same number of elements as channels that you define in your Physical Channel(s). The values in this array correspond to the output value of the analog channels. You will just need to write a program to change the elements in that array when you want to change an output voltage. If you only change element 0 and leave the other elements the same, only your first channel's analog value will change.

 

Since you are new to LabVIEW, I would recommend looking at a good quick start guide for it. There is the Learn LabVIEW in Three Hours white paper, it will walk you through the basics and hopefully help you get started.

 

Finally, before you go and start outputting voltages in your program, reference the NI-625X specifications and realize you have a maximum Output Current Drive of 5mA on each analog output line. You can damage is the card if you try and use the analog output lines to supply more current than that.

 

Other than that, you should have enough to start programming. Good luck!

Aaron W.
National Instruments
CLA, CTA and CPI
Message 2 of 4
(4,018 Views)

Thanks, ill look into it

0 Kudos
Message 3 of 4
(4,012 Views)

gpetre had another question that was sent in a message related to this:

 

how do i set a schedule for the tasks i have programed on labview? like a calendar. I want to tell a task to run all monday and tuesday up to a certain hour. then again on friday for 5 hours and so on... is there some kind of schedule input for the labview?

_______________________

 

There is nothing that I am aware of that has already been written for LabVIEW (doesn't mean it doesn't exist somewhere) but basically what you will want to do is use Get Date/Time in Seconds.vi which will return a timestamp from your computer. You can use a Time Stamp Constant as well. For your Time Stamp Constant you will want to set your stop time and then compare your computer's timestamp against your constant. You will see if the current timestamp is past your timestamp constant, if so, turn off the voltage line you want to.

 

There will need to be a decent amount of programming to make it work for multiple channels, but if you spend a couple of hours working on it, I'm sure you can figure it out.

 

If you have problems with it, post the questions on this board (if it's more related to DAQ) or on the LabVIEW board if it's more programming related (like timestamps).

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 4 of 4
(3,996 Views)