06-28-2012 09:23 AM - edited 06-28-2012 09:24 AM
Here is a simple example. Again, you will be limited to low frequencies (i.e. no more than several hz).
06-28-2012 09:59 AM - edited 06-28-2012 10:01 AM
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.
06-28-2012 12:31 PM
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.
Good luck!
06-28-2012 12:37 PM - edited 06-28-2012 12:38 PM
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.
12-11-2012 12:56 PM
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
12-11-2012 04:00 PM