LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Big latency while changing "run-time" parameters of waveform

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

0 Kudos
Message 1 of 8
(3,610 Views)

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.

0 Kudos
Message 2 of 8
(3,603 Views)

Thanks,

 

I've followed your suggestion (code in attachment).

It runs during 1 ... 2 sec, then stops generating error:

error_in_generation_IV.JPG

 

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

0 Kudos
Message 3 of 8
(3,590 Views)

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):

  1. Repeating 2 times "Sawtooth Generator" and "DAQmx Write" blocks: before "DAQmx Start Task" and inside while loop
  2. Specifying "Number of Samples" constant for the 1st "Sawtooth Generator" grater than for the 2nd one (which is insaide while loop)
  3. Inserting "DAQmx Write" property node between "DAQmx Create Channel" and "DAQmx Timing" blocks and spacifying RegenMode to "Don't allow Regeneration"

Before closing this topic I just want to clarify 2 issues:

  1. It seems that DAQ VI support isn't properly configured (or installed) ... for example I don't see DAQ templates while creating new VI. How to workaround this ?
  2. 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

 

Regards

 

Pavel

 

working_sawtooth_generation.JPG

 

0 Kudos
Message 5 of 8
(3,537 Views)

@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.

0 Kudos
Message 6 of 8
(3,521 Views)
Another basic problem is that you are using a USB device. According to NI support USB devices have an extra buffer over which you have NO control.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,513 Views)

Ok, thanks

What about DAQ VI missing templates ?

0 Kudos
Message 8 of 8
(3,505 Views)