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: 

Making a square wave analog output with a Daq 6008, is it possible?

Here is a simple example. Again, you will be limited to low frequencies (i.e. no more than several hz).

 

Message 11 of 16
(1,463 Views)

I have found a solution which works for my application. I will try out that vi also, but what I have is working well. 

 

I can get frequencies of a Hz up to kHz, and be able to control output voltage and duty cycle and have it run for as long as I could want. 

 

I know its not the prettiest vi but it does a pretty good job of making square waves out of the daq. 

 

 

0 Kudos
Message 12 of 16
(1,459 Views)

Just a word of caution, you will see a performance degradation over time with the VI you posted.  This is because the DAQ assistant creates and destroys the task with each loop iteration.

 

You also aren't going to get kHz rates, period.  Why?  Because, as has been pointed out to you several times, your 6008 board has a maximum specified analog output rate of 150 S/sec.  It can't output faster than that.  The hardware on the board does not allow it. 

 

Dennis' solution is a far better one than the VI you're using.  With the way Dennis sets up his task (creates the task once, outside the loop, and clears it once, after the loop has finished executing), you will not see the performance degradation I mentioned above.

 

Just figured I'd answer the inevitable, "Why does my VI cause the computer to crash after I run it for a long time?" question before you had a chance to ask it.  Smiley Happy

 

Good luck!

0 Kudos
Message 13 of 16
(1,443 Views)

Thanks for that. You raise good points that I was not really aware of. I will update when I setup and try that other vi. 

0 Kudos
Message 14 of 16
(1,441 Views)

Thanks Dennis - this works very well.  I made some change by putting the whole thing in a while loop so you can change the duty cycle too.  As you all have rightly pointed out - it is limited to low freqs only.  I wish NI could make the 6008 a little more powerful without increasing the costs. 

 

rungun

0 Kudos
Message 15 of 16
(1,367 Views)
The 600x is designed to be a low-cost board. If you want performance, the 600x isn't the right tool for the job.
0 Kudos
Message 16 of 16
(1,358 Views)