LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview with daq card question

I have a quick question. I am using labview 7 on windows xp with a 6024e daq card for a school project. I need to use the two analog outputs and am having problems doing so. a) does the board need +5 volts or does it get it from the laptop. b) what is the easiest way to do this. I need to push a button, and have one analog output a value (on basically) for a certain amount of time, and the other on for a certain amount of time. Any and all help is appreciated. This is probably extremely easy but I haven't used labview before and for some reason I am having errors trying to run both outputs at the same time. Thanks

Josh
0 Kudos
Message 1 of 5
(3,049 Views)
I don't think anybody in these forums will do your project for you, but (a) The +5V is supplied by the laptop, and (b) try a sequence structure and using the driver VIs for the DAQ board (you can probably get them form the NI website). In the first frame of the sequence structure, use a while loop to wait for the button to be pressed.

Martin
0 Kudos
Message 2 of 5
(3,029 Views)
Let me make sure I have this straight. You have two analog outputs starting and stopping at different but overlapping times. Is this correct? Also, if you're just using 5V why are you using analog output. Couldn't you just use the digital lines on the board?

In any event, I would suggest a state machine structure. You basically have three states that you're concerned with here. You have a state for the time when each channel is on by itself and a state for when both channels are on simultaneously. What you need to do is change states at the appropriate time in the program. You will need to use some lower level IO in order to keep from initializing lines every time, etc.

Good luck.
0 Kudos
Message 3 of 5
(3,013 Views)
Thanks re: the 5 volts.

Yes what I was thinking of doing was just using two while loop structures with an external clock and while the time is at certain values, just turn the specific analog output on. The one problem I am having is what type of data goes into the analog output daqmx box? If I set it to a constant, it won't work. What form does the data have to be in, an array or something?

Thanks,
Josh
0 Kudos
Message 4 of 5
(3,006 Views)
Hey Josh,

So it sounds like you've received some good direction and are trying, but the one thing that has yet to have been mentioned are the examples that get installed to LabVIEW with NI-DAQmx.

In LabVIEW, click on Help >> Find Examples. Browse to Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage. Open up Gen Mult Volt Updates - Data Types Example.vi. This example will demonstrate how to output voltages with the different types of data types. This is exactly what you need according to your last post.

Hope this helps.

Jared A
0 Kudos
Message 5 of 5
(2,995 Views)