LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating sinusoidal signal with variable frequency

I'm new to LabVIEW programming. I have a DAQ (NI USB-6363), using which I am generating a sinusoidal output signal and then acquiring the same signal. I want to change this sinusoidal signal's frequency from 100kHz-1000kHz automatically with a step size of 10kHz. Right now I can only change the frequency manually by using frequency control. I have attached my program's block diagram for reference. Any help will be useful. Thanks in advance.

0 Kudos
Message 1 of 3
(1,351 Views)

You are a New Member, and I'm guessing you haven't been reading other Posts on this Forum where we say "Please don't send "pictures of LabVIEW Code", send the actual VIs (possibly saved for earlier LabVIEW Versions, like LabVIEW 2018 or 2019, so those of us who haven't "installed the Latest Version" can open it).  From a .jpg image of a Block Diagram, we can't duplicate the code, can't examine "hidden features", can't see the Front Panel, can't try to run the code and "fix it" so it works.

 

Please help us to help you by attaching your VI!

 

If you are going to be doing what you say you want to do (generating a sinusoidal signal with variable frequency), you'll definitely want to avoid the Dreaded DAQ Assistant and learn to use DAQmx (it's not so difficult).  Go browse the Web for "Learn 10 Functions in NI-DAQmx and Handle 80% of your Data Acquisition Applications" (or a very similar title...).  Go ahead and read about the Dreaded DAQ Assistant in this article, but do not use it -- use the material in the rest of the article.

 

The most important (early) concept, for you, IMHO, is the concept of a Task, namely "What kind of Measurement do you want to make with what kind of Hardware".  For someone new to LabVIEW, you need to plug your device into your computer and open MAX, the Measurement and Automation Explorer.  You'll want to create two Tasks -- one to generate a Waveform, and one to sample a Waveform.  It might be helpful to do these one at a time, testing (if possible) with a known signal (if writing the Sampling Waveform loop) or looking at a generated waveform with an oscilloscope.  Sometimes it is easier to do half the problem at a time ...

 

Bob Schor

0 Kudos
Message 2 of 3
(1,321 Views)

@Ritu06 wrote:

I'm new to LabVIEW programming. 


This means you probably should start with the learning resources listed at the top of the forum. LabVIEW is a full featured programming language and you can generate any frequency value based e.g. on the iteration count or elapsed time, right? So work that out first, before adding hardware.

 


@Ritu06 wrote:

I have attached my program's block diagram for reference.


No, you actually only attached a useless image of your block diagram. We cannot see any of the express configurations, the content of dynamic data, or and values of your controls.

 


@Ritu06 wrote:

I want to change this sinusoidal signal's frequency from 100kHz-1000kHz automatically with a step size of 10kHz..


Please define the problem in more detail. For example what should happen once 1MHz is reached? (start over? sweep down? stop the program?) What is the duration of each step?

 

Your device can read up to 2MS/s, so at 1MHz, all you get is an alternating wave because you don't have enough points to approximate a sinusoidal waveform (and if the phase is wrong, you might even get nothing at all.). How are the AO and AI clocks linked? 

0 Kudos
Message 3 of 3
(1,321 Views)