LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory problem when reading in a binary file


JRaetz wrote:

Thanks to everyone responding and trying to help.

 

I am using LabVIEW 8.6, and I cannot find a Read from SGL File block.  I have found through subsequent testing that  I can read the file in in 3 separate parts, but only once.  After running the file to read it into 3 sub-arrays, if I try to run it again it will produce a memory error again.  Shutting down and restarting LabVIEW fixes it again.  Monitoring my memory usage, when I can succesfully read into 3 arrays, I jump from ~400MB of used memory to just under 1 GB.  The second time, when reading the file does not work, I'm up to 1.2 GB used, of my 2GB available.  I don't know if any of that is helpful or not, but I thought I'd add it.

 

What do you mean by taking a dive into the code for the block?  I'm a C programmer who started using LabVIEW 3 months ago, so if I could see what was going on behind the scenes it would help, but I don't know how to do that.

 

Thanks again,

JR


 

LV handles memory management behind the scenes but it just doing mallocs and checking to ensure pointers stay in mapped regions.

 

Take a look at this thread since it was a similar issue.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 14
(653 Views)
You find the VI you want here.......National Instruments\LabVIEW 8.6\vi.lib\Utility\file.llb\Read From SGL File.vi. If you double click on it you can open it and study/modify it. That was the thing I meant then I said take a dive into it. Almost all built in Labview functions can be modified so they fit your need better. Just be careful so you do not overwrite the original functions then you are saving your modifications


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 12 of 14
(646 Views)

Hi JR,

 

Just some thoughts:

 

-Are you displaying your data in arrays on the front panel? This essentially copies the data from the block diagram.

-Use the Request Deallocation function on the block diagram. This will deallocate the VI after it has finished running and reclaim memory for the rest of the program/ next run.

-As others have indicated, processing the data in smaller blocks and removing buffer allocations will be a great help.

-Reading in to 3 sub arrays sounds potentially memory hungry. It depends on what operations/modifications are done on the data.

 

Hope that helps.

 

Ruben 

 

0 Kudos
Message 13 of 14
(630 Views)
Also post your code. If you are new to Labview your code may have some optimization potential;) We will not laugh about your coding. We have all been new to labview sometime


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 14 of 14
(627 Views)