LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

, Memory wasting



IngoWolf wrote:
IQ-Data is filled up in other parts of the code (other event cases), its the global container for my IQ-Data.
I have to use local variables to work with in my event cases.

No, you could use the "new value" terminal of the event structure. However I don't see why you want to use an event structure at all here, since the data is not something that gets changed by the user via the front panel.

IngoWolf wrote:
Isn't the temporary memory freed when the event case is completely processed so it  can be used
when other event cases are processed?

Buffers are typically not deallocated for performance reasons. If you have a subVI that uses a lot of memory once, you can place a "request deallocation" node inside it and it will free the memory when it completes. Most of the time, a subVI is called over and over with data of equal size, so constant allocation and deallocation would not be beneficial and would actually hurt performance very significantly.
 
If you keep your data structures reasonable and at fixed size (e.g. inside a shift register), you can do all operations "in place", even from different event cases.
 
You'd be surprised how efficient LabVIEW can handle all that of you code it right. 😄



Message Edited by altenbach on 02-27-2008 03:30 PM
Message 11 of 12
(641 Views)

Yes I've some more ideas now how I could optimize the code.

My Program is controlled by several buttons which makes the messages and than action has to be done with the data, writing to file, reading from file reading from device etc.

I have 11 cases in my event struct, less than half deal with IQ-Data, but a shift register used need to be wired trough all 11 cases, not to funny.

I tryed to work with replace array subset today but it seems like I cant partial replace data in 2D-Arrays like in 1D ones in 2D I only can replace only complete rows, cols or single datums with the complex type I have a 1D array but I have to test if the writespreadshetfile-vi can handle complex or if Ihave to cast to 2d-array somehow.

 

0 Kudos
Message 12 of 12
(612 Views)