LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate chirp on daq

Good afternoon. My problem is this: I have created a vi and by that I can generate a chirp  giving the start frequency, the end frequency, the sampling frequency and the sweep time. When I press run it will generate perfectly the function I want. My question is how I can launch this chirp in a DAQ assistant. I think I'll have to use a while loop to do this.

 

I made another vi where i create the waveform going to vary the frequency inside a while loop into a simulate signal. But this vi seems doesn't generate the first part of the waveform desired.

 

Thanks to all. Excuse me for my bad english.

Download All
0 Kudos
Message 1 of 6
(3,865 Views)

You do not have to apologize for your English -- it is so much better than my Italian!

 

I have a suggestion for you that should make Generator 1 work (I have not worked out where the problem might be, but I'm hoping to show you a better way to code it, one that might produce a better answer).

 

Note that at each point in time, t, you want the value of A sin (f(t) * t), where the frequency, f(t), is a function of t, itself, say a linear sweep from fstart to fend as t goes from 0 to T.

 

Write a sub-VI that has, as input parameters, t, T, fstart, and fend, and returns f(t).  For the linear case, this is simply fstart + (fend - fstart)*t/T.  Call this sub-VI "f(t), linear".  Here's a Snippet -- note the use of Compound Arithmetic to do the final product-division (invert) operation.  [Why bother, you ask?  Because "hiding the details" makes the rest of your VI much clearer -- it is easy to see that you are varying the frequency as a function of time).

f(t), Linear.png

Here it is in action ...

Linear Sweep.png

Note you can either create three f(t) functions, or one with an Enum (I prefer an Enum, "Linear", "Log", or "Quadratic", to a number selector, 0, 1, or 2) input that returns the specified f(t) function.

 

Bob Schor

Message 2 of 6
(3,803 Views)

You might as well have a look at the Chirp Pattern.vi from the Signal Processing -> Signal Generation palette. Be cautious with how to use it as the frequency inputs are normalized in units of cycles/sample.

 

Ben64

Message 3 of 6
(3,800 Views)

Thanks to both for the answers. I want to do something like this: http://www.ni.com/example/30501/en/

 

I own a NI9263 and three NI9215 of national instruments. I want to generate a chirp through the first port of NI9263 on a shaker and by the port of the NI9215 i want to measures the time analog signal of all connected devices and save it on a lvm file to elaborate it in matlab. On internet I find this http://forums.ni.com/t5/Example-Program-Drafts/Output-Swept-Sine-Wave-in-DAQmx/ta-p/3504463

I added to this logarithmic and quadratic frequencies spacing. It'is right? When I run the main program it generate the chirp but it seems that does not stop when it reaches the time duration. What can I add to acquire from the NI9215?

Download All
0 Kudos
Message 4 of 6
(3,633 Views)

Hello,

the example that you linked should stop the generation when Stop button is pressed. The DAQ should remain at the last voltage generated. If you want to generate Zero Volt there are 2 ways: 

-Reset the entire board through the DAQ Reset API.

-Manually generate zero volt sequentially after the while loop.

 

Use "Continuos voltage acquisition" for test the 9215. You can find it in the LabVIEW example finder.

 

0 Kudos
Message 5 of 6
(3,542 Views)

How can i reset the daq? What block should I put after the while?

0 Kudos
Message 6 of 6
(3,523 Views)