LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is In place structure really help in run time.

From your description, I have a vague (and admittedly unsubstantiated) notion that your problem isn't really about compiler optimization.  If you're describing a continuous waveform generation and output process, and your output has discontinuities/glitches/gaps, you may not be looking at the source of the problem.

 

The attached snippet is a brief (and incomplete) attempt to portray a way to structure your code that should at least give you an idea to pursue.  I realize your waveform generation is undoubtedly more complex, but the structure is the salient point.  The attempt is to get the actual writing of output samples into DAQmx to run in parallel with the next round of sample generation.  Notice how, after a set of samples are written, DAQmx is queried for remaining buffer space, then that number is fed back via shift register to drive the next iteration's computation.  (Also note in the example that the sine gen's phase out feeds back to the phase in, so the waveform is contiguous.  You'd want to keep track of this in your own code - an updating index and a modulus, perhaps, into your own sample array.)

 

Why do it this way with the shift registers? Well, if the sample computation's output were to directly be the input to the DAQmx write in the same loop iteration, the compiler must serialize those two operations. As shown, those two operations can be multithreaded.  And generating only the number of samples as can fit in the DAQmx buffer means the loop won't pend on a hardware process in large blocks of time.

 

And, if this isn't applicable, just ignore it... 😉

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 11 of 12
(493 Views)

Thanks to all for the quicker response and sorry for the delayed reply.

 

I was doing the real time (PC based) FM generation using NI PXI. I have got the solution as problem was with my code.

 

Thanks to all and really appreciated for quicker response from all.

 

Hemant

 

 

0 Kudos
Message 12 of 12
(460 Views)