LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time Amplitude Control in a Sinusoidal Waveform VI

Hello,

I'm currently working on a VI that ramps up a sinusoidal waveform and then holds the final amplitude indefinitely. However, I would like to adjust the amplitude of the sinusoidal waveform in real-time. While the attached VI does allow for this adjustment, the changes take a long time to take effect (~ 1 MINUTE)

Do you have any suggestions on how I can make the amplitude changes immediate while maintaining the sampling rate at 250 kHz? Your insights would be greatly appreciated.

0 Kudos
Message 1 of 5
(305 Views)

Please attach the VI in LV2019 or older as most regular LV users are not up to date on the latest LV release.

 

The trick is to put the DAQ into continuous sampling mode, write 1 cycle of the waveform, let the HW loop over the samples for 1-cycle, update the 1-cycle waveform as needed.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 5
(294 Views)

Thank you so much for sharing this with me. I've attached the 2019 version of the VI for your reference. I didn't fully grasp the trick you mentioned—could you please elaborate a bit more? I would greatly appreciate your insights.

0 Kudos
Message 3 of 5
(274 Views)

I would recommend the Dynamic Signal Generation (DSG) Soft Front Panel (SFP).
DSA Soft Front Panels Download - NI

It is field-tested and free.

Doug
NI Sound and Vibration
0 Kudos
Message 4 of 5
(260 Views)

I would check how quickly your while loop is iterating. You're generating 10 samples per iteration and writing that to the output, but if the DAQmx function isn't blocking you may be writing a lot more data to the DAQmx buffer than you think.

 

If that's the case then it may take a while for you to see a difference in the output because you've built up a big buffer of output data that the output needs to work though first.

Message 5 of 5
(251 Views)