LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deallocate memory array in cRIO

I'm curious to see if anyone knows of anyways on how to deallocate memory from an array in cRIO.  Basically i'm gathering data from an array and saving it to the harddrive on the cRIO, then I no longer need it.  When i use the RT System Manager to keep track of memory, it shows the first time I perform a test and take x number of points, the memory will decrease from y to z.  When I repeat this without turning the power to the cRIO completely off, it will stay at Z, however if I turn the power completely off and turn it back on, it will go back to y.  How can I make it so after I'm done saving it, I can get the memory to go back to y.  Thanks!
0 Kudos
Message 1 of 2
(2,932 Views)
Hi PTLanza,

Correct me if I'm wrong, but it sounds like you are performing different tests in LabVIEW Real-Time and one of the tests involves a large array.  If this is the case and you are using LabVIEW 8.5, you can use the Request Deallocation function found on the Application Control » Memory Control palette.  If you modulate your different tests so that each test runs its own sub VI, you can place the Request Deallocation function at the end of the sub VI (once the sub VI's code has finished executing).  This should deallocate all memory used by the sub VI when your program returns to the main VI.

I suppose the larger question is why is it important to deallocate this memory?  In general, memory deallocations within a time-critical loop will induce jitter and affect the deterministic properties of a LabVIEW Real-Time program.  Memory should be preallocated before the main loop and deallocated after the program finishes if you want your application to run as deterministically as possible.

I hope this helps, please let me know if you have any other questions.

Regards,
Erik
0 Kudos
Message 2 of 2
(2,911 Views)