creating or reading text files based in compiled vi (.exe)

I did my .vi which contains features for reading/writing of settings and write log files. All goes well until I want to create an executable to distribute to colleagues who don't have labview development. When you run the .exe, it seems that I can't create or read .txt or .ini files. No idea how I can import functions open file in read/write/text to my .exe?

In fact, you try to create or read a file inside the executable.  Of course, this won't work.  Instead, use the Directory of the Application.  It returns the folder that contains your project (in the LabVIEW environment) file or the folder of the executable (when in the execution engine).

So in your example, you just have to the Application Directory and the path to build to get the location of your settings.ini file.

Tags: NI Software

Similar Questions

  • How read text file and decode

    Hi, I have a file which consists of 2 columns, it is first of all time/date stamp and 2nd is ON / OFF text.

    I would like to determine the time when the text is ON or OFF.

    I am not able to analyze the data in separate columns 2 and then read, can someone help me on this?

    The example of the file is attached.

    I was going to throw away the solution, but bob and cruz are probably right, that he is HW.

    What is the problem with your vi above, is that you are matching the model from the OFF, but you don't have a table, so your search through your entire text file and on the OFF first display you text in front of her. You must first create a picture of your spreadsheet from the read text file string. This can be done either by using a string of worksheet function array or as cruz said the spreadsheet file. Im not sure of your desired end result, but from there you can feed in a for loop and find each item ON or OFF.

    That should help you get started.

  • close the reference on "read text file" - Ref num vs prefer class conflicts

    Dear users,

    Vi Analyzer asks me to close the refernce created by VI "read text file". So, I would close a refnum created by primitive VI "read text file". I used a direct wire, wiring by top and bottom of the casting, but each of them attend class conflicts (see the screenshot below). It is even possible to correctly transform the refnum (byte stream type reference) to refer (reference VI generic) and remove the refnum?

    See you soon,.

    You must use the close file.

  • Can I read text files in Multisim 11.0?

    I want to take data outside. So, read text file in Multisim 11.0? Or, can I import Chart 11.0 Multisim LabVIEW?

    Hello

    Here is a step by step tutorial:

    The use of LVM in Multisim

    There is something when you configure the file LVM in LabVIEW. In the window to write in the file of the measurement , value X column field, check that you select a column only. Multisim must have this explicit time column when you import data.

    If you still have problems to fix your VI, LVM file and the circuit.

    Kind regards

  • Reading text file issues

    Hi all

    Long the time lurker, first time poster , like the forums here.

    I'm still new to BB development, so my approach may be the issue.

    I am applying for a deck of cards popular (utilities etc.).  I have a text file with the number of card games n, followed by n lines with 3 character code set and then the number of cards in the game.  I'm trying to use it to create a string array and an array of integers with the size of the number of reading games, then read the rest of the values in a loop to their respective indeces.

    I have read several articles on the forums here, and I can't seem to find a way to do it.  I am able to get the number of games using the:

                  InputStream is;                        String result;                        int numOfSets;
    
                            try {          FileConnection fconn = (FileConnection)Connector.open(fName, Connector.READ);         is = fconn.openInputStream();             byte[] data = IOUtilities.streamToBytes(is);          result = new String(data);            numOfSets = Integer.parseInt(result.substring(0, 1));
    
          }     catch(IOException io) {
    
          }
    

    Is there a better way to do it?  It seems it should be a little more easy/short.  I looked through the API for a class such as Scanner, StringTokenizer or even a SplitString option.

    Thank you

    -Nick

    Lurker welcome!

    I presume that your dataset is all text and not a combination of binary and text?

    There is no easy way to split a sequential string of data.  Most people, when you consider a dataset like this, would introduce formatting, such as XML, JSON or even CSV, to make the data easier to analyze.  Since you don't seem to have anything, then I think you're going to cross the characters at once...

    If you use only standard ASCII, then it would be more effective to go through the array of bytes.

    Otherwise put characters of separation in there and look for using some tokeniser.  It is not a standard, but there are whole number (including at least one on the forum of the memory).  In addition I see StringUtilities - you might be able to use one of its features for tokenized your channel.

  • Reading JSON file based on the selected drop-down list item

    I have little code shown below.

    I'm trying to read data from a JSON file based on certain criteria, in this case all the suburbs on a territory

    I can do that quite easily in a liquid hard coding the territory, however, I want to use the value of the < select > option

    I understand that this can be achieved with JavaScript, is it possible otherwise?

    < select id = 'territory' >

    < option value = "xx" >--please select--< / option >

    < option value = "CBD" > CBD < / option >

    < option value = "North" > North < / option >

    < option value = "South" > South < / option >

    < / select >

    {model module_json json="/_System/shipping/shipping.json" = "" = "shipping" collection "}

    < select id = "suburbs" >

    < option value = "xx" >--please select--< / option >

    {% for section in shipping.territory %}

    {% If the element.} TERRITORY is '< value on top of select >' %}

    < option value = "{{point." POSTAL CODE}} "> {{point." SUBURBS}} < / option >

    {% endif %}

    {% endfor %}

    < / select >

    Hi Craig,.

    You can skip liquid altogether and use JS to get the values you need for json.

    If you want to use liquid you need to load the last part with AJAX/XHR to enter the selected value.

    1. create a new file suburb.html and ajax request after #territory selected with the option as a parameter:

    URL: suburb.html? = north shipping

    2. the suburb.html file would be:

    {assign = globals.get.shipping-% selectedTerritory %}<- this="" will="" have="">

    {model module_json json="/_System/shipping/shipping.json" = "" = "shipping" collection "}

  • How read text file?

    Hello

    I'm trying to create a simple SWF file in Flash MX that will read the contents of a text file named "file.txt" and displays on the screen. One word is written in this text 'Hello' file, that should be displayed.
    I tried to use the loadVariables function, but somehow, it does not work and nothing prints on the screen.

    It's my first animation flash for more than 6 years (I used for the flash 4 in 1998) so I didn't script before action.

    Please take a look to the queue, I have created by clicking on the URL below and tell me why it is not print anything on the screen after the reading of text file.

    http://ALIWEB-PHP.elixirhost.com/flash_example.zip

    Thank you all

  • Problem reading text file

    CVI programmer for several years, but it has been awhile. Trying to read in a text file that displays fine in say Notepad. The first line of text in the file is:

    All temperatures in ° F.

    If I use the scan function, say:

    public static char cdum [2048];

    ScanFile (DataFile, "%s > %s", cdum); I get these results:

    cdum [0] is - 2

    cdum [1] is 65 (which is the ASCII character 'A')

    The rest of the cdum is all zeros.

    In a hex editor in decimal display grouped by bytes, the line is:

    0 255 254 65 0 108 0 108 0 32 0 116 0 101 0 109 0 112... as the display looks like

    ybA.l.l.. t.e.m.p.e.r.a.t.u.r.e.s.. i.n.. °. F....

    So I get the scan function is to see the start character, then by pulling the 65 and placing in the location cdum [1], then strikes the character 0 and leaves the function of scan as she found an end of line. Trying to read in the entire line and the subsequent data float line, but is not serious, I can understand that our after I get over the initial problem above.

    Can someone help me with this? I have no problem reading in ordinary text files, but this one is as it is grouped in words rather than in bytes. Have you tried a bunch of different Scan function modifiers source and target [xt0, w #, etc.], but nothing seems to work.

    Data file attached.

    Thank you-

    Scott

    Hello

    I downloaded your file, it is opened in Excel because of its extension and the settings on my computer. I then wanted to save it as a text file normal to see in Notepad and read with a simple C program. In doing so, Excel told me: some features in your workbook may be lost if you save it in Unicode text.

    This is consistent with your observation of 16-bit data.

    LabWindows/CVI, unfortunately, does not support the Unicode character set and functions of the library operated at only 8-bit characters.

    So I would say to convert your file to 8-bit characters; You can also support the pursuit of the Unicode support in CVI here

  • Reading text file takes a long time after the first time

    Dear experts LabVIEW,

    I'm having a problem with playback of text file. I'm reading only each Nth line from a file to preview with this sub vi:

    I seems to work the first time I do it well. The loop takes almost no time to perform an iteration.

    Then when I load the same file with exactly the same parameters an iteration takes about 50ms.

    Subsequent attempts always seem to take longer execution time.

    Only when I restart the calling vi fast for a single file.

    When executing the sub vi alone it is still fast, but I don't see how the main vi (too complex to post here) could hinder the execution of the Sub vi.

    I have no one else to open the file in the main vi, I do not use too much memory...

    Just now I have not now where to look. Does anyone have an idea?

    Concerning

    Florian


  • Read text file on a desktop used as target RT to the host PC.

    Hello

    I'm using LabVIEW 2012 and I want to read a text file on your desktop PC used as target RT to my host computer.

    What is the the path to the target RT?

    Thank you very much

    Hi msad,.

    Why don't you use the ftp functions to access a file by ftp address?

  • Reading text file and graphic

    Hello everyone. I'm new to Labview and have started using it only a week ago. My advisor gave me a difficult project and I'm stuck. My goal is to recover data from a Keithley instrument by setting voltage and current measurement. I could find a driver to do, but now he wants me to take my measurements and make a different chart that is already in the driver. The graphic I get is for X vs Y that has tension on the horizontal axis and the vertical current. After I receive this information, it is then saved in a .txt file. Which wants me to my Advisor, is to take the values that are recorded and divide (V / I) which is equal to the resistance and then to draw resistance depending on the tension. Since I am very new to Labview, I have trouble reading the text file, strength design values and the tracing result. To add to my troubles, the computers I use have only up to Labview 7.0 Express. If anyone can help me please, it will be greatly appreciated because I would rather graphic using Labview values instead of using Microsoft Excel. Thank you.

    Sorry, misunderstood how you want to display the data. The first table seems to be the tension and the table that is the output of the divide is the resistance. Instead of build table and a graphic waveform, you'll want to use the bundle where the upper entrance is your x axis and the background is the y axis and sire of the output of the present in a XY Chart.

  • Failed to read text files in Windows vista

    Hello, I had to remove a hardrive and install it as a secondary hardrive in another computer (my work horse). I can't read the text files they look incrypted all belong. photos look fine cannot test the music but I guess that's good because the photos look fine to me even if I tried to copy or move files successfully, so I think that there is some kind of security issue here I need to understand. It started because of a defect of card mother hp slimline and the customer is not able to buy a third computer. My goal is to copy the data on the Flash drive and just copy the files on him another computer. I need help with what I am an old person xp to the rebels to leave the mountain. Thank you for giving your time to read this. Oh yes, I'll leave the porch lights on!

    DKB

    You don't have the program installed on your computer so that these files were written in.

    Check their file extension.

    See you soon.

    Mick Murphy - Microsoft partner

  • Reading text files and databases

    There the good tutorials on read/analyze the text files and databases out there? I've been looking around, but I can't really find anything.

    Yes - Here are some links:

    http://gotoandlearn.com/play.php?id=168

    http://forums.Adobe.com/message/4674478

  • How read text file and store it in the database

    Respected by all,

    I have the text file on my computer.
    I use forms6i and oracle 9i.
    I want that when I press the button then specifice world in text file is read and display on the form to be stored in the database.
    Please provide a solution.

    Kind regards

    Hello

    Studying the functions of the package TEXT_IO()

    http://www.Oracle.com/webapps/online-help/forms/10G/State?navSetId=_&Navid=3&vtTopicFile=f1_help/Oraini/c_text_io.html&vtTopicId=

    François

  • CFFILE - reading text file and maintenance of line breaks

    I am using cffile to read a text document, then add then display the content of the text document in a file .xml for an atom feed. Everything works fine, but it seems that cffile is stripping on the line breaks in the original file so that the contents of the variable which is save has more no line breaks. Is there an attribute that I'm missing that will control this behavior or I have to go about it in different ways. Thanks in advance for any idea on this issue.

    Why do you say that line breaks are removed?

    If you just say that because when you look at the results in your browser.  Recall that the HTML standard ignores all the line breaks and most other white space.  A quick overview of the source will tell you if the line breaks are there or not.  Using the HTML code

    ...
    Tags is the right way to tell a browser not not to ignore white space in the source.

    But it is possible that somewhere along the process of conversion of text file to XML data line breaks are stripped.  But then, we would need to see significant process pieces for a chance to help you.

Maybe you are looking for