LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with ini files & Memory Error

Hi All,
 
I am attaching my VI which is used to save the control values, I am doing it with configuration file, but sometimes what happens my configuration file got erased completely,and my data got lost otherwise saving control values works perfectly fine,  how can I stop this so my configuration data is safe. or is there any other method to save the control values.
 
2ndly, I have another error in a different vi which keeps coming (image is attached as "Memory Error"), I tried installing LV and XP again, changed the PC but problem persists.
 
Could someone please try to throw some light on these issues.
 
Thanks & Regards
James
Download All
0 Kudos
Message 1 of 2
(2,480 Views)
Your Error2 image is not viewable. Looks like a corrupt upload.

Your fundamental problem lies in the first part of your code. If the INI file doesn't exist, then when you open it, a new one gets created. There is no SVALUE key, so you are trying to loop 0 times. Since the first for-loop does not execute, the INI file refnum does not get transferred through the tunnel, and subsequent INI file functions receive a null refnum. You need to either wire the refnum outside the loops or use shift registers for the refnum.

As to your code: OK...
  • You must really like whitespace, because that's the only reason I can see for having such a huge while loop that just sits there. Smiley Very Happy
  • You really need to learn to draw straight wires.
  • You are jumping through unnecessary hoops. You are taking the control values, bundling them into a cluster, converting the cluster into an array, and then autoindexing the array while at the same time setting the "N" terminal of the for-loop. Whew!
    • Skip the bundling. Just make an array directly!
    • Do not wire both the "N" terminal of a for-loop and autoindex. Do one or the other. Since you have the array, just auto-index.
  • The Index Array function is resizable. You do not need to place 2 of them to get the 2 values.
  • Your string constants are in 2 places. You should have them in one place only. If you decide to change the names then you need to remember to change them in 2 places.
0 Kudos
Message 2 of 2
(2,464 Views)