06-25-2014 09:33 AM
I am try to generate signals with a function generator VI block,with a for lop and array fill with values of frequency and amplitiude
as in the block diagram below.
When the programs run at the end an error message pop up
- Specified operation cannot be performed with task is running.
Solved! Go to Solution.
06-25-2014 09:56 AM
Try this:
Place the DAQ Start Task before instead of after the Analog WFm Read. This is how I set up my Data aquisition and I don't have any issues. i can look more into it you could upload your vi.
-ncm
06-25-2014 10:29 AM
Try with the examples in LabVIEW ... Help/Find Examples/Hardware Input and Output/DAQmx/Analog Output
07-02-2014 04:12 PM
I have change the position of the DAQ start task and it does not work.
I have attached the vi
07-02-2014 04:39 PM - edited 07-02-2014 04:39 PM
Try building up one large waveform and output that. Then you only have the one call to the DAQmx Start.
07-02-2014 04:46 PM
What, exactly, are you trying to do? And with what hardware?
Your Front Panel shows an array of frequencies and amplitudes -- are you trying to generate 21 channels of sinusoids corresponding to your 21 frequencies? Are you trying to generate a complex waveform comprised of the sum of these? Are you trying to generate a single sinusoid at one of the 21 frequencies?
It appears that you have set a clock rate for outputting your waveform at 1KHz, yet you seem to have frequencies in your table up to 10KHz. It is impossible to generate a 10KHz signal from a 1KHz output.
Look at a DAQmx example. Notice that the Start and Stop commands are not inside the FOR loop generating the waveform.
Try to find a patient LabVIEW guru to give you some guidance. You can also look for Introduction to LabVIEW tutorials on NI's site.
07-03-2014 03:25 AM
Thanks,pls could you send me the vi so that I can run it.
Inside the case structure block, how many cases are you using.
07-04-2014 03:28 AM
I am trying to generated a single sinwave with one of values of the 21 fequencies and amplitude.
generating the first sinewave with 100Hz and amplitude of 1.5 for 1000milesecond then the next value of frequency and
amplitude for 1000milsecond still the end value of frequency which is 10KHz and amplitude of 0.5.
07-04-2014 04:23 PM
@juz wrote:
I am trying to generated a single sinwave with one of values of the 21 fequencies and amplitude.
generating the first sinewave with 100Hz and amplitude of 1.5 for 1000milesecond then the next value of frequency and
amplitude for 1000milsecond still the end value of frequency which is 10KHz and amplitude of 0.5.
Consider just the last "sine wave", 1 second of a 10 KHz sinusoid. I assume that you want to have the output "look like" a sine wave. Recall that this is a digital output, so the waveform will be a bunch of points. Draw a single sine wave and put 10 points on it uniformly spaced -- if they were connected by straight lines (or were step functions), would that be "close enough" for you, or would you want more points? Note that you need at least two points, one high and one low, to get something that alternates at 10 KHz (but with only two points, it will definitely be a square, not a sine, wave).
Suppose you say 10 points is enough. Then since you have 10,000 sinusoids per second, and 10 points per sinusoid, you'll need to generate points at 100KHz! Does your D/A convert support such a high output rate? Note that the sample code you provided seemed to be outputting points at 1 KHz.
There's no difficulty, in principle, with having LabVIEW generate data points at 100,000 points/second (you probably would want to "do the math" yourself, using the Sine function from the Math Palette instead of using an Express VI), but getting all of this data smoothly to an output device might be a bit of a trick. What hardware are you using?
BS
07-04-2014 04:28 PM