Using .ini Files Tutorial

Hi All,
I recently took the LV intermediate courses and I've been trying to incorporate some of the items we discussed into my program.  One of the topics we very briefy skimmed was .ini files.  In fact we didn't really go over them, but the instructor said that's the preferred method for initilizing variables etc.  I've got about 65 variables that need to be initilized to either 0, T/F, "  "(empty string), etc.  They are initilized either whenever we put a new unit on for test, restart a unit, or after a full test cycle (Little under 2 days for full test.)  We didn't really go over how to create the .ini or link it to labview.  I did explore some of the File I/O functions, but none talk about .ini useage that I could find.  May have missed them, but couldn't find the examples in LV either.
Anyone seen a good tutorial or have a simple program that shows how to use a .ini for the various data types LV uses?
(Or if anyone recommends not using this method why?  I suppose the instructors could be bias or just wrong?)
LV7.1, LV8.5

Its a good example and not too hard to follow.
What I noticed though is how large that program is and the subvi's called inside it.  What seems a bit crazy, its only init. 5 variables and the space that program takes up on the block diagram is already larger than manually init. now (and thats with the 65 or so variables!)
It seems as though it would be significantly easier just to send an initilized value into each control individually.
Am I missing something?  From that example it seems like a bad idea to go down that route...
LV7.1, LV8.5

Similar Messages

  • Memory leakage when using Ini-file VIs

    I'm using the Configuration File Vis to read and write data to different .ini files. The files contain both standard keys and clusters written as a segment using the Open G toolkit. Instead of opening the files and keeping them in the memory of the Config VIs I'm just using them to read and write, decode and encode...the references are all closed using the Close Config Data.vi. The problem is that even though immediately close the config data the application keeps grabbing more and more data...every time a configuration file is open, read or written to and the closed everything from 4K to 50K of additional memory has been allocated by the application (this is a stripped down application that only deals with the config files, so
    there are no other sources for the memory leak).
    Has anyone else experienced this? How can you repeatedly open and close config file slike this without it continoulsy allocating more memory?
    Attached is a copy of the VIs, the directory structure must be kept intact if the ini file is to be read correctly.
    I've been stearing so hard on this the whole day that I might just be overlooking something obvious...
    In the full application the VI init and write operations are only done when the user reconfigures the system, which may be a couple of times per month...so the memory leak would not cause a problem right away, but it would not be healthy to leave it there...
    MTO
    Attachments:
    Memory_Leak_Demo.zip ‏1391 KB

    Could you post a 6.1 version?
    LV7 is still about two weeks away for me.
    Does the problem show up in 6.1?
    I ran across an error while writting to a FP output that was not configured that would cause a "drop of memory" to leak every time the VI performed the write. The leak did not show up in the profiler but windows would show te memory foot print growing continually as long as the writes continued. The work around was "don't do that!".
    I bring this up because I found and reported this just prior to LV7 release and the featur may still be present in LV7. I also believe that Jean-Pierre used a "write and check" metod to detail with the unknown data types of of complex data structures.
    If you just read does it leak?
    If you just use simple data types do
    es it leak?
    Is the ini file growing?
    I really appreciate the effort you have been putting into the Dev-Exchange Mads! I wish i could do to more to help.
    Keep us posted.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Using ini-files with write-key/read-key (double) and defined accurarcy

    Hello,
    in a popup the user can insert a numeric-double-value.
    This value is saved in a ini-file using the Write-key-vi with Type = double. Works fine.
    What do i have to do to set the values after the comma?
    So if user inserts 1,532 i want to round to two digits after comma and save it. (-> 1,53)
    Thx
    Solved!
    Go to Solution.

    I don't know how LV deals with different decimal seperators (e.g. comma instead of point), I guess it 'just works' depending on the system locale.
    A few different options are available as follows...
    The Write Key function has a 'precision' input which will set the number of decimal places to save the DBL to (in your case, set this to 2):
    If you are using a numeric field, you can set the 'increment' property with 'coerce to nearest' to prevent them from entering more precision than is available:
    The obvious method for post-rounding the input is to scale up the number, round to the nearest integer and then divide again to limit the precision:
    I couldn't see anything in the numeric/math palettes that does this.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Cant silent install DPM using ini file.

    Hello I am attempting to install DPM on a standalone server. I have a local sql server 2012 SP1 installed with all the prerequisites installed for both DPM and SQL.  Significantly,
    using the setup.exe I can install the DPM from the GUI no problem.  
    I am however having issues installing DPM via the command line using a silent install.
    ini file as follows:
    [OPTIONS]
    UserName="<DOMAIN>\Administrator"
    CompanyName="My Company"
    ProductKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
    command line:
    start /wait setup.exe /i /f <path>\Dpmsetup.ini /l <path>\dpmlog.txt
    With the silent install procedure however I hit an issue. I am convinced this is due to my INI file as I assume a requisite line must be missing as the install fails stating
    that prerequisites are not met although. -However all the pre-reqs are met as reinforced by the sucesfull GUI install.
    I have used the same Administrator account to run the install via the GUI (successfully) and Command line (unsuccessfully).
    Said Administrator account has local admin rights and sql sysadmin rights.
    One line I suspect I may need to add is #SqlAccountPassword. -I have attempted setting this with the password of the Administrator account. My understanding is
    the 'yukon' lines are not applicable as the sql server is local.
    Using the ini file does the install assume the sql install is remote? Any thoughts would be appreciated.
    One error I found in error log using the command line 'DPM requires TCP/IP protocol' to be
    enabled on the selected SQL server instance'. I've checked this however and again this is not applicable.

    Hi,
    The Yukon parameters are applicable even for a local SQL install.  Below are the minimum parameters.  See if that works for you.
    [OPTIONS]
    UserName = DOMAINNAME\USERNAME
    CompanyName = MYCO
    ProductKey = <The 25-character DPM product key in the format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx>
    SqlAccountPassword = PASSWORD
    IntegratedInstallSource = DRIVELETTER:
    YukonMachineName = SQL_SERVER_MACHINE_NAME
    YukonInstanceName = SQL_INSTANCE_NAME
    YukonMachineUserName = DOMAIN\USERNAME
    YukonMachineDomainName = DOMAIN
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Using INI files!

    Hi,
    I am new to the concept of INI files.
    I would be glad if any one call tell me which r the tutorials which explain the concept of INI in detail.
    Thanking in Advance.

    INI files are not particularly a java concept. If you need to read them, then by all means go ahead and do so. But if you are starting with a new design, property files are probably more java-centric, and have more support by default.

  • .bat file and .ini file

    I have a batch file with the following contents, I need to substitute the paths \\folder\projectname\formatter\saxon8\ with a variable using .ini file. Could anyone please tell me how do I do this
    @echo off
    cls
    echo.
    set CP=\\folder\projectname\formatter\saxon8\saxon8-jdom.jar;\\folder\projectname\formatter\saxon8\saxon8-sql.jar;\\folder\projectname\formatter\saxon8\saxon8sa.jar;\\folder\projectname\formatter\saxon8\saxon-license.lic
    ...If the path of the needed files gets changed in future, the user need to change the path only in the .ini file and that should reflect in the .bat file.
    Message was edited by:
    Simmy
    Message was edited by:
    Simmy

    I am reading the INI file in my code whose value C:\\temp\\ is getting displayed in my Batch file, but I need to display only the keyword Path in my Batch file. Can you please tell me what modifications I need to do in my code.
    This is the contents of my INI file
    [INI file : user.ini]
    Path="C:\\temp\\"
    The following is my code
        public void createFile()
            try
                p = new Properties();
                p.load(new FileInputStream("D:/user.ini"));
                JarPath=p.getProperty("Path");
                p.list(System.out);
            catch(Exception e)
                System.out.println(e);
            File file1=new File("D:/temp/ps1.bat");
            BufferedWriter bw1;
            try
                bw1=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file1)));
                bw1.write("@echo off\n");
                bw1.write("cls\n");
                bw1.write("echo.\n");
                bw1.write("set CP="+JarPath+"saxon8-jdom.jar;"+JarPath+"saxon8-sql.jar;"+JarPath+"saxon8sa.jar;"+JarPath+"saxon-license.lic\n");
                bw1.flush();
            catch(IOException ioe)
                System.out.println("Error creating \"ps1.bat\". Process terminated.");
    Currently, the following is my Batch file contents
    @echo off
    cls
    echo.
    set CP=C:\temp\saxon8-jdom.jar;C:\temp\saxon8-sql.jar;C:\temp\saxon8sa.jar;C:\temp\saxon-license.lic
    But I need my Batch file to display
    @echo off
    cls
    echo.
    set CP=Path\saxon8-jdom.jar;Path\saxon8-sql.jar;Path\saxon8sa.jar;Path\saxon-license.lic

  • .INI FILES

    How can I use .INI file to run my executable jar file?
    You see i have two applications the first one is a user interface for my barcodereader and the the other one is a JMF application which plays an mpg file.
    Whenever , the first program is idle or when nobody is using the scanner i have to play my media file.
    thank you in advance..............

    If you are talking about windows INI files then those files are
    for storing some properties(say). It is related to registry.
    What you want to do any way ?

  • Visual c++ load .ini files to combobox

    I create pop up program for my company, I use Visual c++ CLR. I use .ini files for load and write data in my program. 
    than I have confuse when I want to load .ini files to show in combobox. I already use "GetPrivateProfileStringA/WritePrivateProfileStringA", but it can't read .ini files to combobox. please give my suggestion for my program. thank you (:

    Hi,
    Welcome to MSDN.
    I found that you have posted this issue with the following thread in C++ forum.
    Visual
    c++ load .ini files to combobox
    You could focus on that thread to get support.
    Have a nice day.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • Should I use .INI or .XML config files on cRIO?

    I'm looking to make a configuration file for an application running on a cRIO-9022. It will contain a small amount of configuration data (like numeric offsets, file paths, and IP addresses). I have 2 questions:
    1) Which file format should I use (.ini or .xml)? I have used .INI in the past because it is human readable/configurable with notepad, but it seems like .xml is becoming the new standard
    2) I would like to be able to modify config parameters on the PC that connects to the cRIO. What is the best way to modify the config file if it is stored on the cRIO hard disk (FTP the file to PC, make changes, FTP back? Network Streams?)
    --CLD--
    LV 6.1, 8.6.1, 2011 SP1, 2012 SP1

    JimMacD wrote:
    Thanks for the info.
    Any clever ways of accessing and changing the Config File data from a LV application running on a PC that doesn't require manually editing the file? I want the operator to just be able to click a button that says "cRIO Config", open a dialog, and change the values from there.
    uhm.... Yes!
    In This Post I show a bit of my hand on just exactly what I keep in a ini.config file (wel,l 1 section of a config file)  It would be nearly idiotic of me to not provide a Config editer since there are numerous Enum type defs in the delimited value for each key.  so since I, as the developer, know what sections (and possibly keys) are there I can read the file and load them to indicators on a config editor GUI.
    I've actually done this two ways-
    1) a seperate app that only "admin Engineers" know the location of "Launch Config editor.exe.
    2) In the application referanced above I have a button that opens a MODAL panel to edit the file (remember- I know what is in the file).   Users need permissions (Users- Passwords and permissions are kept in a config file, of course!) to even display the "Edit Sequence" button. but the "super user" can edit the step parameters. 
    HINT: one of these "Steps" loads a xml file to expose telnet commands and config for the uP on the DUT.   I expect the firmware on the Linux DUT will change in the future and did not want to rebuild my app whenever a typo was fixed in a command line tool.  BUT, since there are "special characters" that do not fit nicely into a .ini I exposed the telnet commands and line ends IP address and the login script  in a xml file.
    I know this did not directly answer your question!  but It should provide some food for thought.
    If you can share your data structure- I can be more specific. 
    Jeff

  • Using CookieName in the iisproxy.ini file

    Hello All,
              According to the Weblogic 451 docs, In the IISProxy.ini file, you should
              set the "CookieName= "
              property to whatever value you have specified for the
              "weblogic.httpd.session.cookie.name="
              property in your weblogic.properties file. (If it is anything other than the
              default name which is "WeblogicSession").
              We have an IIS proxy fronting 2 Weblogic App Servers which run in a
              clustered mode. Also the
              cookie name is specified in the properties file to something different than
              the default WeblogicSession
              (lets say it is "mySession").
              When we do this we see the strange behavior of the application routing us
              back to our Login page in the middle
              of a session. We assume this is happening because when our request is
              switched to a different App Server it
              cannot be associated with any session. And so we are asked to login and
              create a new session.
              This started happening only when we switched to using IIS Proxy and have the
              CookieName
              set to "mySession". This problem goes away if we change the cookieName to be
              the default and remove
              the entry from the IISProxy.ini file.
              Our App Servers are running Weblogic 4.5.1 with sp8.
              Any ideas ??
              Thanks
              Ketan.
              

    The cookie name in your ISAPI plugin and weblogic.properties should be the
              same in all your plugins and weblogic servers. This is required. Plugin and
              WLAS share the same cookie. However, plugin and WLAS are in different
              processes. In order for plugin and WLAS to locate the same cookie, same
              cookie name in the configuration is required.
              Cheers - Wei
              Ketan Bhukhanwala <[email protected]> wrote in message
              news:[email protected]...
              > Hello All,
              >
              > According to the Weblogic 451 docs, In the IISProxy.ini file, you should
              > set the "CookieName= "
              > property to whatever value you have specified for the
              > "weblogic.httpd.session.cookie.name="
              > property in your weblogic.properties file. (If it is anything other than
              the
              > default name which is "WeblogicSession").
              >
              > We have an IIS proxy fronting 2 Weblogic App Servers which run in a
              > clustered mode. Also the
              > cookie name is specified in the properties file to something different
              than
              > the default WeblogicSession
              > (lets say it is "mySession").
              >
              > When we do this we see the strange behavior of the application routing us
              > back to our Login page in the middle
              > of a session. We assume this is happening because when our request is
              > switched to a different App Server it
              > cannot be associated with any session. And so we are asked to login and
              > create a new session.
              >
              > This started happening only when we switched to using IIS Proxy and have
              the
              > CookieName
              > set to "mySession". This problem goes away if we change the cookieName to
              be
              > the default and remove
              > the entry from the IISProxy.ini file.
              >
              > Our App Servers are running Weblogic 4.5.1 with sp8.
              >
              > Any ideas ??
              >
              > Thanks
              > Ketan.
              >
              >
              

  • How to use Transformer.INI file

    Hi All,
    Please let me know how to create and use Transformer.INI file SSM .
    How to upload data through Transformer.INI file in SSM
    Thanks
    Chavi

    Hi Tino,
    sapmsg.ini is opend by LIBRFC32 - not NCo directly.  You can look into RFC SDK documentation for details (this is install with SAPGUI).
    you can try to resolve the problem by setting the following environment variable:
    RFC_LOGON_INI_PATH=<PATH_TO_SAPGUI_DIRECTORY>
    Regards,
    adlin

  • How to use sapmsg.ini file?

    Hi,
         Whats the function of the sapmsg.ini file? How to use it?
         And I searched my computer but didnt find it......

    Hi Tino,
    sapmsg.ini is opend by LIBRFC32 - not NCo directly.  You can look into RFC SDK documentation for details (this is install with SAPGUI).
    you can try to resolve the problem by setting the following environment variable:
    RFC_LOGON_INI_PATH=<PATH_TO_SAPGUI_DIRECTORY>
    Regards,
    adlin

  • Use configuration file VIs to set AppFont in INI

    I am using the following code in an attempt to set AppFont, SystemFont, and DialogFont in an executable's .ini file all to Segoe UI 15. I was disappointed to discover that the configuration file VIs don't seem to write the key correctly. When I use this code, I get the following in the .ini file:
    AppFont = ""Segoe UI" 15"
    SystemFont = ""Segoe UI" 15"
    DialogFont = ""Segoe UI" 15"
    What I really need is:
    AppFont = "Segoe UI" 15
    SystemFont = ""Segoe UI" 15
    DialogFont = "Segoe UI" 15
    In other words, the configuration file VIs add an extra set of quotation marks. With this extra set of quotation marks, the executable ignored these settings. The "write raw string?" input didn't seem to affect this behavior. 
    Does anyone know of a way to get the configuration file VIs to write this key/value pair correctly, or do I need to write extra code to either remove the quotations or do the whole thing myself? It seems like the configuration file parsing/editing VIs that NI provides should be able to parse and edit NI-provided configuration files...

    There is no way to do this with the current config file API. That "write raw string" input only pertains to escaping certain characters. We also have an internal API for writing data specifically to the LabVIEW.ini file, but it has the same problem with extra quotes.  For now, you'll need to either refrain from using the config file VIs, or add some post-processing code to go in and remove the extra quotes.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • I tried to upload the Pxisys.ini file and MAX is showing the slot ID ...but i need a function to return those slot numbers..such that i can use in my DLL

    hi hamilton,
    thanks for your reply .
    I already tried the option or pxisys.ini file
    The MAX is showing the slot number ..but My requiremet is to use the slot ID in a DLL
    so I need a function type of statemen to return or get the slot number of the NI devices on the PXI.
    I think I clearly explained.
    I would like to get the slot numbers through a software fucntion such that i can use the slot numbers values for some other purpose ,,like configuration ,,

    jayamurugan,
    This functionality currently is not built into National Instruments software. You can get the device number, but not the slot numbers programmatically.
    Trey Hamilton
    Applications Engineer
    National Instruments
    http://www.ni.com/support

Maybe you are looking for

  • Playing audio to dock thru lightning to 30-pin adapter?

    Hi folks.  I just bought a new iPad mini w/ retina display.  I own two iPod docks.  I'd like to be able to play music and podcasts--all audio, really--from the iPad through the docks.  The docks have 30-pin connectors.  I bought the lightnig to 30-pi

  • (Very Ergent)Email Notification...

    Email notification on: 1 changes within workflow status 2 requests to join libraries 3 changes to library membership to be emailed to library owner 4 requests to read documents 5 requests to join groups 6 changes to groups to be emailed to group owne

  • Trigger Event based on Execption

    Hi, Does anyone know if it it possible to somehow trigger an event (not an alert) based on a query exception or query result value?  I have a process chain that I want to execute only if a query exception occurs.  I'll be damned if I can't figure thi

  • Changing Apple ID to reconfigure business phone.

    Hi, my boss has asked me to create a new itunes account for our office iphone (3g). I have created the new ID with the business email, however the macbook I use as for the business is his old personal macbook.Having signed into the new account I can

  • Down loaded flash player still not working.

    I have down loaded flash player,and have updated. When i attempt to watch a movie, i get a message saying i need to download adobe flash player.. could you possibly tell me how to fix the problem?