.Ini file reading chart

I need to read in a short array of strings from a file. I don't want to add other files and I was wondering if there was an easy way to read an array of strings from an ini file. Given that this is a dozen channels up, I guess I could do brute force:

[TABLE]

1 = "string 1".

...

2 = 'string of 12. '

Is there a way mo betta?

Thaniks,

JVH

I just put the picture of the string in a key, comma delimited:

StringArray = xxxx, yyyy, zzzz

When I read the key, I add a return to it and treat it like a string of worksheet.

Edit:

It's probably a good idea to put strings in quotation marks, in case you have commas in strings.

Tags: NI Software

Similar Questions

  • Best practices for the .ini file, reading

    Hello LabViewers

    I have a pretty big application that uses a lot of communication material of various devices. I created an executable file, because the software runs on multiple sites. Some settings are currently hardcoded, others I put in a file .ini, such as the focus of the camera. The thought process was that this kind of parameters may vary from one place to another and can be defined by a user in the .ini file.

    I would now like to extend the application of the possibility of using two different versions of the device hardware key (an atomic Force Microscope). I think it makes sense to do so using two versions of the .ini file. I intend to create two different .ini files and a trained user there could still adjust settings, such as the focus of the camera, if necessary. The other settings, it can not touch. I also EMI to force the user to select an .ini to start the executable file using a dialog box file, unlike now where the ini (only) file is automatically read in. If no .ini file is specified, then the application would stop. This use of the .ini file has a meaning?

    My real question now solves on how to manage playback in the sector of .ini file. My estimate is that between 20-30 settings will be stored in the .ini file, I see two possibilities, but I don't know what the best choice or if im missing a third

    (1) (current solution) I created a vi in reading where I write all the .ini values to the global variables of the project. All other read only VI the value of global variables (no other writing) ommit competitive situations

    (2) I have pass the path to the .ini file in the subVIs and read the values in the .ini file if necessary. I can open them read-only.

    What is the best practice? What is more scalable? Advantages/disadvantages?

    Thank you very much

    1. I recommend just using a configuration file.  You have just a key to say what type of device is actually used.  This will make things easier on the user, because they will not have to keep selecting the right file.

    2. I use the globals.  There is no need to constantly open, get values and close a file when it is the same everywhere.  And since it's just a moment read at first, globals are perfect for this.

  • read and sort the values present in the .ini file

    Hi all

    I have an .ini file in which a set of modules with that execution order is mentioned. I want to get all these values sorted in a table, so that I can proceed with the execution of each one in the order given. The list of the module in the .ini file looks like this:

    .

    Here, the numbers represent the order of execution of the module.

    I should get output as a table with the following values:

    1 MNO

    DEF 2

    3 STU

    4 PQR

    5 GHEE

    6 VWZ

    ABC 7

    8 JKL

    I don't know about the configuration data and reading key live but as the list of modules is huge I don't know how to write efficient code for this. Any suggestions are welcome.

    Thank you.

    The excerpt below should be very close to what you want.

  • Need help with the reading of an INI file.

    Hi all

    I have some difficulty to read an INI file that I created.

    I managed to create an INI using Key.vi file to write so that I can possibly send the baud settings to my RS-232 port. What I have trouble is reading this INI file even I created. What I need to do, is watch a certain line, go to as many characters in, and then enter the settings in the file.

    Any guidance is appreciated.

    Something like that...

  • Paths of reading via the Config Ini file

    I was curious to know how one send or read from a configuration (.ini) file paths in LabVIEW. Any help is appreciated especially examples

    It's actually pretty simple...

  • Help with writing/reading-key key ini files (double) and defined accurarcy

    Hello

    in a pop-up window, the user can insert a digital double value.

    This value is stored in an ini file using the writing-key-vi with Type = double. Works very well.

    What should I do to adjust the values after the decimal point?

    If the user inserts 1 532 so I want to round to two digits after the decimal point and save it. (-> 1.53)

    THX

    I don't know how LV treats different decimal separators (for example, the comma instead of point), I guess that's "just works" according to settings system locale.

    A few options are available as follows...

    The function write key has an entry of 'precision' which will set the number of decimal places to save the DBL to (in your case, set it to 2):

    If you use a number field, you can set the 'increment' property to 'force close' to keep them out in more accurately than is available:

    The obvious method for rounding of the entry is to scale the number, rounded to the nearest integer and then divide again to limit the accuracy:

    I couldn't see anything in the digital pallets / math that does this.

  • Start on BACK reads "Invalid BOOT. Start of the om C:/windows INI file

    Repair Boot.INI file?

    Install the installation cd xp, pc on a bootable cd, select "recovery console".

    In recovery, select 1 for press C: entry password

    Type: Fixboot approved, type: CHKDSK C: /p

    Once through, type: EXIT Let xp start.

  • problem updating the ini file ini file

    I get the ip address of the user's input and to replace the old IP in the .ini to the last ip address file but the problem is when a user enter the IP and I write it in my ini file it does not at once, but if I do it twise in calling the same function of my command button twise then my ini file is updated , it is the strage iniwrite function returnes success although on first attempt. I checked with breakpoint, but when I do it twise, then it is done, please guide me in detail, I am really amayzed by this strange behavior...

    I already gave you the exact order of the functions in my previous message!

    Ini file tool generates an object in memory that allows you to store and locate the values. This object can be filled in reading a file on the disk; Similarly, it can be saved to a file on disk. This is the very first operation and the last to perform if you want a picture to date of your values on the disk. There are three layers to consider:

    1. The file on the disk

    2. The IniText object in memory

    3. The variables specific to your program

    With this in mind, the right order to update the file on the disk so that it reflects the value that your variables have in memory is:

    Ini_New create the object in memory

    Ini_ReadFromFile fill it with the contents of the disc

    Ini_get('sendmail_from') read of the idebugprogramnode2 memory in your program variables

    Here tou can update the values of program

    Ini_Put update the object of memory with the contents of your variables

    Ini_WriteToFile save everything on the disc

    Memory Ini_Dispose clear

    As you save on disk before you call the Ini_Put functions, the disk image is not updated

  • string of text without spaces file reading

    help me to read text file

    my text file contains the following four lines

    //////////////////////////////////////////////////////////////////file start ///////////////////////////////////////

    COM1 = 2

    COM2 = 8

    192.167.0.10 = IP address

    file = "textfile.dat".

    /////////////////////////////////////////////////////////////////file end ////////////////////////////////////////

    I want to only read, 2, 8, 192.167.0.100, textfile.dat,.

    who are my values of desired data. help mw with a code example

    There is no trim function in labwindows which is present in .net, wanting to make sure the cvi function sort of guide to good will be useful in my case as com port can be 18 or 13, which means that not a single character, so that the data in my file such as the ip address, com ports and and file name may not always be the same size so I read correctly in all the case if the IP = ip 192.168.0.8 address = 192.168.244.207 then, how I read it correctly without changing the code in labwindows. guide me in detail, thank you in advance.

    If your file has a title (for example "[General]") you could read it unsing the . Instrument of ini file, which you can find in \toolslib\toolbox\inifile.fp. Also, there is an example program on how to use the instrument.

    No name of the section being present, you can only read line by line and parse on the equal sign. A framework of code (to be developed and completed by you) could be the next. It uses the libraries of the CVI, there is also the possibility to achieve the same thing using bbanniere ANSI functions.

    file descriptor = OpenFile ("MyFile.txt", VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);

    While ((r = ReadLine (fileHandle, tampon, 511))! = - 2) {}
    IDX = FindPattern (buffer, 0, -1, '=', 0, 0);
    If (idx > 0) {}
    Scan (buffer, '%s [xt61] %s', setting, value);
    }
    }
    CloseFile(f) (file descriptor);

    CAUTION: this is only a conceptual framework that handles only checking the line and splitting. IE: it reads the contents of the entire file, she is not a distinction between the parameter names and it just doesn't fit error checking, which is mandatory on the operations of e/s files.

    By looking at help on Scan function, you can understand the meaning of the format code I used (detailed description is here, the same information is present in the help installed on your PC).

  • Noise DC value of the ini file values

    Hello

    I am trying to build a generator of signals (sine, triangle, sawtooth, square random noise, DC). I managed to get the job of waveform using the signal generator of NOR built based on VI. but I want to add the DC case that I managed to do. but I want the values (magnitude and frequency) to be in an ini file. My idea is manual sets the values in the file, once I run the vi and select the case of DC noise, it should read the file values and the data output and once I have stop, it records the values of dc before returning.

    So, I'm stuck trying to figure how to do this. I hope that I was clear enough. I don't have a code to view since I haven't started yet coding on this part. Help, please.

    Clearly enough explained.

    Take a look at the screw configuration file, found in e/s from file > Config File live. There also many examples n the community, as well as in the Finder of the example, illustrating the use of these. A good starting point is the sample Configuration settings file write example Finder, and reading Configuration settings file.

    Your .ini file will look something like this, once created:

    [DC noise settings]

    Amplitude = 1.234567

    Frequency = 8.901234

    This is equivalent to:

    [Name of section]

    Key 1 = value

    Button 2 = value

    When asked to read a specific key in a certain section, VI only through the file for the named section, and then search for they key the name you provided it. Remember, you will need to know what type of data is when you read back.

    You can use VI writing to modify specific keys in specific sections as soon as you close the file.

    This is one of a multitude of methods, you can use to do this, but are probably the simplest.

  • INI file with the characters multibyte to the language question

    Hello

    I am doing research on several language support in our CVI programs.
    I'm new to programming multibyte, as always I coded it in English so far.

    I found the Interface Localizer and have played around with translating my GUI controls. That works well, except on the title bar that is displayed in one code other than the language, I translate. But it will not work for messages popup or dynamic views.

    I read a few white papers. I'm not too worried about Run Time messages, for the most part, I'm worried about specific incentive program and the GUI.

    I've seen several topics suggesting using an external INI file to translate specific messages in my program. So I tried to create an ini file that uses Unicode and a Chinese character.
    When I call Ini_NumberOfSections using this INI file, my software returns a number of sections 0 when there is, in fact, the 1 article. This happens if I format my INI file in any format other than ANSI, Unicode.

    So my question is simple: how to read an INI file and specifically the tag, using characters to multibyte to Unicode?

    Is this a setting? Or I have to write my own read INI and the analysis of function?

    Thank you very much.

    Ok

    I finished my first step in the R & D. Here's what I know:

    I tried several formatting options, including XML, TXT, CSV and XLSX (Excel).

    With the help of the CVIXML is not an option (the less the way I tested it) since it does not accept Unicode in CVI. I did a little research and found out how to configure my XML file to Unicode, but whenever I try to read using CVIXML, the result is a failure. So I gave up this process.

    A .csv file is not a good option, because of how the file behaves in Excel. With characters Unicode, the file does not open as expected, and all my data is in the first column. If you are strictly using a text editor such as Notepad, you can read the .csv file and use it in CVI. The only issue is that you must compensate for the multiple byte characters, which I did not. So, because of the tampering of the .csv, I eliminated it as an option.

    So here's the solution I came up with that. I use the Excel Report commands (via excelreport.fp in toolslib).

    Using this method I can format my language options in Excel, view my Unicode characters and still open as planned in the CVI.  I just have to open my Excel file and load all the options of language in memory, and then close the Excel file.

    The only caviats are speed and Unicode does not appear correctly if your operating system is configured in a non-unicode format. This isn't a problem but it's a windows setting. In my typical American, unicode characters appear as? But if I change my localized language to, for example, Chinese then unicode is displayed normally.

    So, for now, this is the solution I've identified. Thanks for the tips. I hope that others will find it useful.

  • Number of serial port configuration ini file!

    Hello guys,.

    I am creating an ini config file to save the selected serial port of VISA.

    I will adapt if the ini file doesn't exist then look to pc serial ports and choose one of them. If the file is read the value to use when I use data acquisition.

    In the example attached. I have a structure of event (such as my application), where I have a stocking to open the 'options '. If you open the main vi and pass the error, open the Subvi options and choose comport, if you click on 'ok' it save the ini file, if you click on "Cancel" it closes and show in the indicator of the value of the comport the .ini file. The Subvi works well.

    The problem is when I try to read the value of include an application start. I put the code but that's fake.

    I used "simple saving and loading control values" TST ( https://decibel.ni.com/content/docs/DOC-15349 ) and it works well for the control of the Sub - VI.

    Why I got error and I can not read ini value?... section and the key is correct. I can't find the problem.

    Concerning

    Fred.

    OpenG INI example explained on the-openg-vis-that-i-couldn't-live-without

  • Place the ini file in a specific location when the application generating

    Hello

    I have a little problem.  I have an ini file that I use to store some settings.  Lets call this app.ini file.  When I build the Application.exe, it puts this file in the data directory.  I was hoping that it would be at a higher level and be located in the same directory as Application.exe is (otherwise it will not read the file correctly.)  Looked at the settings of the Source file in the list of categories in the Properties window for the construction and all the 'Identical to the appellant' Destination, but he did not where I wanted.  I would really like this file to a directory higher when I do my build so that my application to read correctly.  Any suggestions?

    I use this executable then when I do my Installer and the problem just spreads here also, not good.

    One way to solve the problem:

    (1) in the build Properties window, select Destinations and create a new destination. Select the same directory where the exe file will be stored as 'Path of Destination'

    (2) assign this destination in the .ini file.

    Let me know if it works

    Marco

  • using the .ini file created by EXE

    First of all I would like to say that I have a thorough knowledge of the .ini files and the need for them.  My question is related specifically to the .ini file that is created with the executable.  I searched the forum but have not found any instance of my question specifically.  After installation, the .exe and .ini are placed in my working directory in Program Files, which I expected.  The .ini file that is created is attached.

    Now, I would like to point to a different .ini that stores control settings.  I did it in the App generator under Advanced > Use Custom Config File.  That's fine and dandy, but the network, web, settings etc that have been created in the original .ini does not get included in my new .ini.  If my option is to use an .ini file separated with my control as well as created by the .exe parameters.  This seems redundant.

    My question is: does nothing my executable with the .ini file that is created when it starts to run?  I'd be OK NOT to have attached items if I wanted to point to a custom .ini file?  Why create an .ini with these specific settings file if the .exe does nothing with them?

    The only article I found is this one

    http://digital.NI.com/public.nsf/allkb/5467F7D7895835C186256FAF00600A21?OpenDocument

    but it does not explain what the .exe is done with it, if anything.  I guess you have a total control over the .ini and there is nothing "automatic / backstage" going on here.

    Thanks in advance for your help.

    Why remind you the application builder to a custom INI file if you are going to have to read the chips inside manually anyway?  The reason to use a custom within the app Builder INI file is so that you can include specific parameters of execution (VI, access list server, port etc.) which are different from the settings using the LabVIEW development environment.

    You need not key in the INI file for your run-time application (as evidenced by the fact that if you delete the INI file, your exe will still works, creating a new INI file with default values).  If you leave the defaults, the application adds in the first leg in any case.

    You can store your own data in the same INI file used by the executable file; just put the keys in a different section.  LabVIEW Config File format INI files screws slightly differently (for example adding spaces around the = sign), but I didn't know it causes problems.

  • value/label pairs in control of the ring of the .ini file

    Hello

    Could someone tell me please to functions that will allow me to write the values to the control ring set in an ini file? I am able to read my ini file, but I don't know how to update the values of control ring with the sections. A little help please.

    Thank you!

    Help is here using InsertListitem, ReplaceListitem... should be what you're looking for

Maybe you are looking for