This widget could not be displayed.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arbitrary signal generation with user control for frequency and amplitude variation

Hello

 

I'm trying to generate an arbitrary waveform. I've gone through numerous methods and none of them are satisfactory. The 'Simulate Arbitrary Waveform' block is excellent for my needs. You can enter your arbitrary waveform (or load it from a .lvm), and it generates the output signal. However, I need to control parameters like frequency and amplitude, and I didn't see any way of doing that, since it's all in the dialog box. Can anyone suggest a method to use the block and control my freq and amplitude?

 

My second doubt is pertaining the file I've attached. I decided to generate my own own arbitrary waveform generator. I took 2 triangle wave generators, used 2 build waveforms, and then used the 'merge signal' block to merge them into one. Finally, I output through my DAQ. But it's giving an error.

 

ERROR

Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.
When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.
Number of Channels in Task: 1
Number of Channels in Data: 2

 

 

Any help is appreciated. My end motivation is to basically generate an arbitrary waveform (probably triangular based), whose parameters will change automatically.

 

Thanks

0 Kudos
Message 1 of 9
(4,466 Views)

Hello saksham,

 

What version of LabVIEW are you using? Was it the Simulate Arbitrary Signal express VI?

 

As for the second question, the merge signals VI is converting your two waveforms to dynamic data containing two signals.  Since the DAQ Assistant is only expecting to write one signal, it is throwing an error.  To make the VI do what you expect, use 'add' rather than 'merge signals'.

 

Regards

Patrick W.
Applications Engineer
National Instruments
Message 2 of 9
(4,426 Views)

Hi Patrick

 

Thanks for the reply. I am using LABVIEW 2010. You are correct, I'm talking of the Simulate Arbitrary Signal Express VI.

 

With the add signals, it's working fine. I'm having a tough time figuring out the different 'types' of signals, like dynamic, and what block I should use for conversions between these 'types'. For example, when is dynamic data used, what blocks require that input? How should I go about getting familiar with them?

 

Thanks

Saksham

 

 

0 Kudos
Message 3 of 9
(4,419 Views)

Saksham, 

 

To change the frequency, right-click on the simulate arbitrary signal express VI, then go to Define Signal.  Then you can change the dX value.  To change the amplitude, multiply the output of simulate arbitrary signal by a numeric constant.  

 

Dynamic is a special data type LabVIEW uses in Express VIs.  For information about how and when to use them, please see the following link:

http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/dynamic_data_type/

 

Hope this helps!

 

Regards,

Patrick W.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(4,409 Views)

It's great that I can change the amplitude externally. This way I can run a for loop loop, vary my amplitude and observe my output. However, I would similarly like the freedom to change the frequency on-the-fly. Isn't there any place where I can 'feed' a dX? Also, any way to feed the data points for the arbitrary signal? Since I couldn't find that provision, I set out to generate the arbitrary signal using those simpler blocks.

 

Thanks

0 Kudos
Message 5 of 9
(4,402 Views)

Well, you cannot change the frequency on the fly with the simulate arbitrary signal express VI.  There might be another way to write your data though, what exactly are you trying to do?

 

 

Patrick W.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(4,395 Views)

On a system level, I want an output of a sin^5x waveform. However, it's not a simple waveform generation. I want the waveform's amplitude and frequency to be changeable, much like the diagram below.

 

 

Here, after one cycle, the frequency doubles. Similarly, I'd like the amplitude to be configurable. Once I have this, I'd like to be able to generate various such combinations, and output them.

 

I've now left the 'simulate arbitrary waveform' VI, and I'm generating these from a custom VI, using the Formula Waveform VI, and Append Signals VI. So far so good. I am having some other problems though, but it's a seperate issue, so I'll start a separate thread, and also post a link here.

0 Kudos
Message 7 of 9
(4,390 Views)

Saksham,

 

Sounds like you are using exactly the right VIs to do what you need!  Good luck building your application.

Patrick W.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(4,379 Views)

Patrick, Thanks for helping out.

0 Kudos
Message 9 of 9
(4,374 Views)