Showing results for 
Search instead for 
Did you mean: 

Serial port number savings in .ini file (executable with application builder)


I have a builded application (with Application builder) that uses a serial port.

I want to save the last serial port number used in an .ini file when I close the executable.
So, I can use the same number for the next use of the application

How can I use the .ini file to configure the VISA resource name control ?

More generally: is there any documentation for the .ini file for executable ?

0 Kudos
Message 1 of 31
Hi etillol,
you can find the VIs you need in the "Configuration file VIs"- palette, it's located in the file-IO palette. To save the serial port, you could make a VI looking similar to this:

Hope, this helps,

Message Edited by daveTW on 11-06-2006 11:52 AM

Greets, Dave
0 Kudos
Message 2 of 31
That's what I need!

thanks a lot!
0 Kudos
Message 3 of 31

Hi dave 

I am trying something similar I guess you could help


I want to change or control VISA Config  controls (visa resource name, parity, stop bit, etc) through .ini file when I create a Executable.

I tried deploying VISA resource settings from the properties of the Build->executable and it does create .ini file with the .exe application but not taking or reading the changes I do in config.ini file(which is created while building .exe )

I needed this because when I connect different usb cable or in different usb socket COM value changes . I need to check the COM value from Device Manager and I want to simply edit this .ini file part where COM value is stored to the one I am using. 

Hope you get the point I am trying to make.


Thanks and Regards





0 Kudos
Message 4 of 31

Hi Baig,


you need to read those INI keys on your own and set the parameters for VISAOpen with them.


As has been asked in your other threads too: Attach your VI so we can give recommendations on how to improve it!

Best regards,
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 5 of 31

The ini file generated by Application Builder is normally created brand new every time, however you can define your own file in the Advanced tab of the Application properties (see the Use custom configuration file option). The custom ini file must be added to the project before.

Another possibility is to use an alternative ini file. Personally I prefer not to mix my settings with LabVIEW settings. I always define an application folder (e.g. C:\MyApp or similar to be located in the Windows user folder), where all settings and data will be stored/retrieved. My ini file would be typically located in the MyApp\Config folder.


LV 7.1, 2011, 2017, 2019
0 Kudos
Message 6 of 31

Hi GerdW


I am attaching the VI that has a glimpse of how I am using VISA communication for RS232 protocol. Since  my main application have many subvi's and .cntls and would be like troubling you guys more for no reason.


In the second tab of tab control there are bunch of VISA config controls. I want these controls to be changed from .INI file so that i can completely  remove them from FP.

In my application com port, baud rate and stop bit are the things I might need to Change for every run.


Thanks and Regards





0 Kudos
Message 7 of 31

I think the recommendation from MS is to not write/use the Program Files-folder for dynamic data. Instead, use the File variable block (i don't remember the name) to point to 'Public program data' (which gives the %programdata% folder) and create a structure from there, such as %programdata%\[company name]\[program name]\setup.ini


G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
0 Kudos
Message 8 of 31

Can you explain with example please


Thanks and regards 


0 Kudos
Message 9 of 31

Yamaeda simply reminds you that Microsoft's recommendation is not to write application data into the %ProgramFiles% subfolders, use %ProgramData% instead.

Here is is an example following his suggestion:



LV 7.1, 2011, 2017, 2019
Message 10 of 31