From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change function generator parameters in real time without re-running the 'Standard Waveform Generation' example VI?

I found an example VI with the AFG3022 (a function generator) instrument driver which can produce any standard waveform I want, once I start the VI. But, I need to be able to change the frequency dynamically and in real time. To do this, I have to type in a new frequency in the frequency text box and run the VI again which causes the function generator to reset and run with the new frequency I entered. How can I  dynamically (in real time) change the frequency without resetting the function generator? The VI I am using s attached.

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

You will need to write your own program.  That VI was just an example.  Save off a copy of your own and edit it to do exactly what you want.  I would use an Event Structure to detect when you changed values on your front panel and perform the needed action inside of the event case.  For instance, when you change the frequency, you should just call the Configure Standard Waveform VI with the appropriate settings.  If you dig into that VI, you may find for specific VIs for just handling the frequency.  I don't have the drivers so I can't tell if that is true.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,436 Views)
Why do you think you have to run the entire example? Configure it and then have a while loop with an event structure. Use a value change event with the set frequency subVI.
0 Kudos
Message 3 of 3
(2,435 Views)