From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

signal generation using DAQMx.vi

Solved!
Go to solution

 

 

 

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

  • Error -200479 occurred at DAQmx Start Task.vi

-    Specified operation cannot be performed with task is running.

 

 

block diagram.jpg

Message 1 of 16
(5,782 Views)

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

-ncm
0 Kudos
Message 2 of 16
(5,767 Views)

Try with the examples in LabVIEW ... Help/Find Examples/Hardware Input and Output/DAQmx/Analog Output

0 Kudos
Message 3 of 16
(5,754 Views)

I have change the position of the DAQ start task and it does not work.

I have attached the vi 

0 Kudos
Message 4 of 16
(5,692 Views)

Try building up one large waveform and output that.  Then you only have the one call to the DAQmx Start.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 16
(5,685 Views)

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.

0 Kudos
Message 6 of 16
(5,682 Views)

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.

0 Kudos
Message 7 of 16
(5,657 Views)

 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.

 

0 Kudos
Message 8 of 16
(5,621 Views)

@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

0 Kudos
Message 9 of 16
(5,601 Views)
I don't remember the exact name, but look in the shipping examples for one that uses non-regeneration mode. You will, of course, also need to fix your sample rate issue.
0 Kudos
Message 10 of 16
(5,596 Views)