08-11-2025 02:04 PM
Hi Tim,
@tominsek wrote:
I tried this method as Yamadea mentioed, only for COM port first to see if it works but it doesn't. If i close the app and i reopen it, i have to select the com port again, it doesnt save it in the ini file.
Where did you implement the INI file functions?
I don't see them in the code…
08-11-2025 03:06 PM
Hi Gerdw,
Sorry i sent you the wrong version.
Here is the right version and i implement it in INI section
08-12-2025 12:59 AM
Hi Tim,
you did not follow the suggestions given by Yamaeda!
That's your code (after using CodeCleanup):
You implemented:
Other questions:
08-12-2025 02:18 AM - edited 08-12-2025 02:20 AM
Hi Gerdw
So now the com port is saved and when the app is opened is loaded and i dont need to choose again, but now the program dont work, it dont show me the values of regulator.
How should i load values when program start, When to do that?
And how to write values when program stops?
08-12-2025 02:26 AM - edited 08-12-2025 02:27 AM
08-12-2025 03:43 AM
Hi Gerdw,
I made it like you suggested me, if i place in any state the reading, dont work...no matter where i put stuff in flat sequnce dont work. No offense but i Don't know what i'm doing wrong.
08-12-2025 04:12 AM - edited 08-12-2025 04:18 AM
Hi Tim,
@tominsek wrote:
i Don't know what i'm doing wrong.
You don't seem to debug your own code.
Ever worked with breakpoints and highlight execution?
(This is basic LabVIEW stuff, explained in Core1 training courses. I expect you already knew that! And I expect you to actually take all those Training resources offered at the top of the LabVIEW board!)
Debugging:
Why do you need one more local variable? Using them extensively is (most often) WRONG!
See this:

You already have the data in the shift register, so use that data instead of reading a local!
(You even put a typo in the string constant…)
Why don't you cleanup your code?
Why don't you use subVIs as one step to improve code readability?
Do you use a LabVIEW project file yet?
08-12-2025 05:51 AM
Hi Gerdw,
So lets leave this latest version i was only trying how to do it but lets leave this,
now i understand how that works (writing key to file, reading from it ect...), but i dont understand in wich state in my code i should put write key to file and in wich state i should put read key from file, because i need to save to file not only visa com port but also password for tab (nastavitve), parameters of sql data base( uid, pid ect...) and i have all these parameters scattered throughout the code in different cases. All these parameters should be saved in a file so when the application will be open you don't have to set them all up again and the program will already read data from controller.
08-12-2025 07:01 AM - edited 08-12-2025 07:01 AM
Hi Tim,
@tominsek wrote:
but i dont understand in wich state in my code i should put write key to file and in wich state i should put read key from file, because i need to save to file not only visa com port but also password for tab (nastavitve), parameters of sql data base( uid, pid ect...) and i have all these parameters scattered throughout the code in different cases.
That's why I (probably) mentioned before to use a better program architecture and get rid of all those local variables!
NOW you can:
All this becomes very easy once you have a clear program architecture with a well-defined state machine, cleaned up code, more subVIs ("one VI per function, one function per VI"), and using all the suggestions I already gave…
08-12-2025 08:12 AM
So how can i put for example string of database name to cluster?
if i understant all parameters need to be in cluster and connected to my shift register in the state for example (''read parameters...'')
is it possible that you make me only for visa com port, what you wrote in previous message. Just so i can imagine, for other parameters i will do it by myself