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.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Time delays between signals

Solved!
Go to solution

I use the AWG NI PXI-5412 to generate sine wave signals of certain frequency and amplitude and change these parameters “on the fly”. I use Standard Function as the Output Mode and the Property Note to set new frequency and amplitude values.

 

Change of parameters is always followed by 15-30 ms delays during which I assume the parameters of an old waveform are cleared from the onboard memory of the AWG and the parameters of a new one are saved.

 

Is it possible to calculate the upcoming delay in ms based on the frequency and amplitude of new and old signals, onboard memory size and number of cycles stored in onboard memory? I have only found information on the memory usage of Arbitrary Waveform Generation Mode in specs. Am I generally right in thinking that delays are related to memory usage?

 

whole.png

0 Kudos
Message 1 of 9
(5,124 Views)
Solution
Accepted by artkop

@artkop 

Is it possible to calculate the upcoming delay in ms based on the frequency and amplitude of new and old signals, onboard memory size and number of cycles stored in onboard memory? I have only found information on the memory usage of Arbitrary Waveform Generation Mode in specs. Am I generally right in thinking that delays are related to memory usage?

 

 

You are indeed correct. The 5412 is an Arbitrary Waveform Generator and doesn't have DDS hardware. So Function Generation is implemented on top of Arbitrary Waveform Generation functionality.

There's no good way to calculate the delay, because unfortunately the timing is not deterministic.

As a workaround, you could use Script Mode, download full cycles of the waveforms at the frequencies you need, and switch between them using a script trigger using Send Software Trigger. This gets you contiguous performance but will only work if you know the frequencies you need ahead of time.

Good luck

Marcos Kirsch
Chief Software Engineer
NI Driver Software
Message 2 of 9
(5,109 Views)

Thank you for the reply, kirsch!

 

If Function Generation is implemented on top of Arbitrary Waveform Generation, then, according to specs, its Onboard Memory Size is by default 8 MB and Minimum Waveform Size must be 16 Samples, right?

 

So am I correct that, generally speaking, in Function Generation mode, an AWG fills the memory buffer with 16 (?) samples and then keeps sending signals based on these samples. When the parameters of a waveform are changed, it clears the buffer and fills it with new samples?

 

May I also ask you what other factors the delay is usually determined by?

0 Kudos
Message 3 of 9
(5,102 Views)

@artkop So am I correct that, generally speaking, in Function Generation mode, an AWG fills the memory buffer with 16 (?) samples and then keeps sending signals based on these samples. When the parameters of a waveform are changed, it clears the buffer and fills it with new samples?

 

May I also ask you what other factors the delay is usually determined by?


The implementation of Function Generation will create waveforms of one or more cycles and also change the Sample Rate in order to "best" accomplish the requested frequency. It tries to balance frequency accuracy with waveform size, and generate at the highest Sample Rate that makes sense. I don't recall the specifics nor are they simple.
 
The delay comes from the driver stopping generation, downloading new waveforms, reconfiguring Sample Rate, and restarting.
Marcos Kirsch
Chief Software Engineer
NI Driver Software
Message 4 of 9
(5,096 Views)

Thank you for the explanation, kirsch!

 

Is possible to read the automatically configured Sample Rate with some VIs?

0 Kudos
Message 5 of 9
(5,089 Views)

Try reading the Sample Rate attribute (use the property node assuming you're using LabVIEW). I believe that will give you the value in use but I'm not 100% sure.

Marcos Kirsch
Chief Software Engineer
NI Driver Software
Message 6 of 9
(5,087 Views)

@kirsch wrote:

As a workaround, you could use Script Mode, download full cycles of the waveforms at the frequencies you need, and switch between them using a script trigger using Send Software Trigger. This gets you contiguous performance but will only work if you know the frequencies you need ahead of time.

Good luck


Hi kirsch,

 

I think Script Mode is not supported on my signal generator PXI-5412; I receive an error message “NIFGEN_VAL_OUTPUT_SCRIPT not supported on this signal generator”.

Is there any other way to download waveforms into the memory of the AWG and switch between them on the fly?

0 Kudos
Message 7 of 9
(5,058 Views)

@artkop

 I think Script Mode is not supported on my signal generator PXI-5412; I receive an error message “NIFGEN_VAL_OUTPUT_SCRIPT not supported on this signal generator”.


Hi kirsch,

Duh! My bad. Look into NIFGEN_VAL_OUTPUT_SEQ.

Marcos Kirsch
Chief Software Engineer
NI Driver Software
Message 8 of 9
(5,054 Views)

Thank you, kirsch

 

I have another question.

I have been also using the code provided by Aaron O to switch between various waveforms without stopping generation and experiencing any delay with PXI-5412:

https://forums.ni.com/t5/Example-Programs/FGEN-Arbitrary-Waveform-Switch-Waveforms-While-Generating/...

 

My question is, is it possible to generate arbitrary waveforms of different frequency without stopping generation and clearing the memory, like in this code?

 

If I am not mistaken, the frequency of the output signal in Arbitrary Waveform mode equals the sample rate divided by the number of points in Waveform Data Array received by niFgen Create Waveform (poly) VI. Therefore, in order to change the frequency of the output signal, one has to change either the sample rate or the number of points in Waveform Data Array. However, after the very first waveform is downloaded to the AWG’s memory, all the next ones have to have the integer multiple of the number of points of the very first waveform. Which means that it is impossible to overwrite the first waveform with the new one that has a different frequency "on the fly". Am I correct?

0 Kudos
Message 9 of 9
(5,044 Views)