I am doing a Data System Using LabVIEW, I have finished the VI, But I am facing a problem that when i close the VI, I lose my data and Calculations, I tried to use Read From Spread Sheet, I get the old array and old data but with New Calculations not related or added to old array
How Can i fix this problem in a simple way. and here is my vi in the attachments.
To retain data in controls and indicators, you need to do a "edit, make current values default", then save the VI.
(Your VI is extremely ugly and inefficient. You might want to ask for help here cleaning it up. Using local variables of controls that don't have a label is just plain dangerous! There are many things that could be done with 10% of the current code. There are many things that don't make any sense. There is nothing determining the loop timings. You constantly inserting into arrays while the array should be fixed size and you should be replacing. You only need to write the headers and define the combo string once. uninitialized shift registers are pretty meaningless here. How are you running this (continuous run button???)?
I tried to use "make current valules default" but when i open the VI again and run it, it doesn't use the old data and start to add new data and delete the old one
and I Press Run not continuous run
also i am new to labview maybe the VI isn't that good, but it does what i want, what i want is to overcome that problem.
Your data is partially contained in uninitialzed shift registers.
You really should do a few tutorials and ask advice about general code architecture. This cannot be fixed well with the current code without making an even bigger mess..
Properly done, the code will be 90% simpler and fit on a postcard, still with the same (and more!) functionality!
NO, you still need to simplify! The least efficient way to keep a running sum is to keep prepending to a 1D array (growing without bounds!) and taking the array sum for each item. All you need is an 1D array that contains the sum and you would increment a certain element if the numbers change. After each change, format it back into the bottom left table (Please give it a label!!!! If you don't want to see the label, you can hide it on the front panel)
All you need is the following:
Your loop currently spins millions of times per second. It only needs to spin whenever OK is pressed. Lewarn about event structures.
The cases of your big case structure only have minor differences. You can probably combine most of the code, avoiding all these duplications.
Use an enum for the "Select" and write the strings exactly once before the loop.
Same for the table headers! These things don't need to be done over and over and over....
Your initialized arrays are too big, especially if you "insert" instead of "replace". You could just use "build array" combining the two rows.
To retain the data when the loop ends, write it to a file and read it on program start to initialize the shift registers.