02-02-2016 10:44 AM
Hello,
In my setup I need to change waveform parameters (e.g. amplitude, frequency, offset in runtime).
For this I've employed "Event Loop" inside "While Loop".
In the event loop there are (except timeout) one event - "Amplitude Control Changed".
The VI works ... except considerable latency (about 5 sec) between I modify control value and see changes on oscilloscope.
Did I miss something in my setup.
Thanks in advance
Pavel.
P.S. Code is in attachment
02-02-2016 10:51 AM - edited 02-02-2016 10:54 AM
You have no timeout wired, so the event structure will never timeout (default is -1)
You don't need the event structure or shift register. Simply place the control terminals inside the while loop. (Offset, freq, ampl.).
The second while loop can never be reached, because the first while loop cannot be stopped.
I would recommend to start with a few basic LabVIEW tutorials and learn about the principles of dataflow.
02-02-2016 11:20 AM
Thanks,
I've followed your suggestion (code in attachment).
It runs during 1 ... 2 sec, then stops generating error:
I've already followed LabView core 1 ... also I've already tried with single "While Loop" (but with DAQ assistant).
The experts from this forum dissuaded me from using "DAQ Assistant" but rather use DAQmx staff.
That what I did. Because of DAQmx includes start task item, I considered (probably erroneously), that some staff should be activated once some of control changed (to relance it).
That's why these erroneous attempts.
All these problems - I didn't find any example (except thoses employing DAQ assistant) allowing to change waveform parameters in runtime.
Also there are no DAQ VI templates in my LabView installation.
Thanks
Pavel
02-02-2016 11:21 AM
02-03-2016 08:15 AM
Here is final version of the analog form generation VI, wich allows to modify waveform parameters in runtime.
I adapted an example that I've found on the web.
The key features here are (encircled by red lines on the snapshot below):
Before closing this topic I just want to clarify 2 issues:
Regards
Pavel
02-03-2016 10:46 AM - edited 02-03-2016 10:48 AM
@Pavel_47 wrote:
Where can I find (in which palette) the "sampling info" block (encircled by blue line on snapshot below) ? Actually I create it by right-clicking the corresponding port of "Sawtooth Generator", then Create Control
That's the right way to do it. I would not want a gigantic palette containing all possible clusters.
Of course, since you overwrite both elements, having it as a control is pretty useless. Since you are only using it as a template for "bundle by name", it would be sufficient to have it as a diagram constant. Don't clutter the front panel with UI elements that don't do anything useful.
(To multiply by two, you should make the diagram constant the correct representation (orange, not blue). Even better, use scale by power of two).
The "OR FALSE" for the stop condition seems pointless.
02-03-2016 10:52 AM
02-03-2016 11:11 AM
Ok, thanks
What about DAQ VI missing templates ?