04-15-2017 09:03 AM - edited 04-15-2017 09:14 AM
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.
04-15-2017 02:21 PM
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).
Here it is in action ...
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
04-15-2017 02:50 PM
04-19-2017 05:06 AM - edited 04-19-2017 05:08 AM
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?
05-30-2017 08:38 AM
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.
06-06-2017 09:59 AM
How can i reset the daq? What block should I put after the while?