LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Load a Large File Once

Solved!
Go to solution

How can I keep the data I load from a large file in memory so I don't have to reload it everytime I make a minor change to another part of the code? The snippet below is representative of my problem.

 

LoadOnce.png

 

I larger problem is I don't know how variables live in LabVIEW memory. Does LabVIEW clear variable values from memory before running?

Andrew
0 Kudos
Message 1 of 6
(3,018 Views)

Use an action engine, functional global etc! As long as you don't close down LabVIEW, the data should remain in memory in the shift register. However, I must admit, I'm not sure if this is the case if you change something within your code before pressing run again. But, I believe it should still work.

0 Kudos
Message 2 of 6
(3,008 Views)
Solution
Accepted by topic author arcranda

I usually roll with a quick-and-dirty solution, simply use an array constant until the code is complete.  Put an indicator on the output of the Read from Spreadsheet File VI and run once to populate the indicator, Right-click create constant, and use that while debugging the code.  Dump the indicator and the File Read until you are finished debugging and just use the constant.

 

Of course your VI carries some extra "weight" around on disk for a while, but it hasn't caused me trouble.

Message 3 of 6
(2,994 Views)

@Darin.K wrote:

I usually roll with a quick-and-dirty solution, simply use an array constant until the code is complete.  Put an indicator on the output of the Read from Spreadsheet File VI and run once to populate the indicator, Right-click create constant, and use that while debugging the code.  Dump the indicator and the File Read until you are finished debugging and just use the constant.

 

Of course your VI carries some extra "weight" around on disk for a while, but it hasn't caused me trouble.


 

Rustic. I like it.

0 Kudos
Message 4 of 6
(2,990 Views)

I often use Darin's method except that I often change the indicator to a control, make current value default, then save.  That way it is very easy to change a few data points to test the behavior of the software.

 

Lynn

0 Kudos
Message 5 of 6
(2,979 Views)

Quick and Dirty is my middle name - and that techniques works perfectly. Thanks, Darin.

Andrew
0 Kudos
Message 6 of 6
(2,966 Views)