03-24-2009 06:07 PM
I have a PCI-6221. I am trying to output an sine wave from my computer. The voltage output changes only once every 1/10 sec. I there a way to increase the frequency? Attach is sample program and a resulting graphs.
03-24-2009 10:37 PM
You seem to have found one of the more convoluted methods of generating a sine wave. Have you looked at any of the example programs? Go to Help>Find Examples and for Hardware Input & Output>DAQmx>Analog Generation, look through some of them.
You major problem is trying to generate it one point at a time with the single sample mode of DAQmx Write. Not at all sure why you are using the Elapsed Time function or the Mathscript. There are built-in functions (even an Express VI) to generate a sine wave.
p.s. You have also posted to the wrong board. This has nothing to do with Counter/Timer hardware.
03-25-2009 08:56 AM
leaf34,
I agree with Dennis, you should take a look through the example programs for Analog Generation as there are several example that will show you how to adjust the output frequency of your analog signal that you are wanting to generate.
03-25-2009 04:53 PM
The reason I was using mathscript is because I am generating the sin wave and manipulating the wave it in a more complex code. I tried to add a sample clock to increase the speed but every time I tried I get the following message:
"Measurements: Generation cannot be started, because the selected buffer size is too small."
But I do not get the this message when I am using "Cont Gen Voltage Wfm," a VI that I have found in examples finder, which has the same vi's that are in my code and gives the desired outputs.
Thanks