Write to Spreasheet File Question

Hi Guys. I've actually got a couple of questions as to the most effective way of doing a couple of things. The purpose of this VI is to gather a voltage every so many seconds as determined by the user and then plot the voltage vs the time it was taken. Also i want to record all of these into a text file.
As of right now it works quite well but i'm not sure if graphing my functions as i have them (dropping the voltage and time values into an array and using build xy graph with the arrays as the inputs) is the best way to do it. Because i'm only taking data every ~5 seconds max will the array sized ever become an issue? I might run the program for a period of ~24 hours so  that's 17280 values in the array by the end of the day. 
I'm also having a problem with how the values are saved in the spreadsheet file. How i have it set up now the values are appended to the current file which is not a problem. However they are not seperated by anything so when i open the txt file they are in the same column. I know i need to put something inbetween them such as a tab or comma for excel to put them in different columns. What's the best way to do that with numbers? Before i've just converted them to strings then concatenated a tab/comma to the end of the data point then reconverted back to a number but it seems like there must be an easier way to do this.
Any other random comments on streamlining etc my code is appreciated
Thanks!
Mark
Solved!
Go to Solution.
Attachments:
Pressure(voltage) vs time.vi ‏107 KB

Thanks for the comments smercurio!
I guess i won't worry about the array getting too large for this then at the moment... but i might as well figure it out so i know anyway! I'm guessing one solution would just be to pick out a certain part of the array ie the last 1000 data points and plot them instead of plotting the entire thing? If i did want to plot the entire time i'm guessing there is a way to skip data points, ie a for loop and just take every nth point and drop it into a new array. Shouldn't be to hard. 
Thanks for the additional comments. My only programming experience besides my past week with labview is definitely "text" based. Shift registers do seem like a nicer approach than calling the local variable each time. 
As for the producer consumer approach i'm guessing that i would simply put the DAQ assistant in it's own sequence that takes a data point every x seconds while the graphing/writing/etc is it's own loop. Looks like a much more viable approach.
One last thing I wasn't very clear on the delimitter problem. I want to actually insert a delimiter inbetween the two arrays, not just after them. So right now they are being put into one array together. Voltage then below it Time. I want a delimiter between the voltage and time so that when the file opens Voltage appears in one column and Time appears in the next. Then have the file drop down a row and repeat Voltage | Time. So i think i still need a way to append something to the voltage or perhaps insert an ascii value between them that will work as a delimmiter? 
Thanks again!

Similar Messages

  • Write to text file - question

    How can I add on top of .txt file "caption", for example I want in my example add "date" and "time".
    date                  time
    12.3.2012    12:46:44   
    Rookie; LV 2011 on WIN 7
    Solved!
    Go to Solution.
    Attachments:
    Untitled 3.vi ‏11 KB

    Here's the same with a little bit less code.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    WriteTimeColumns.png ‏26 KB

  • Write to file Question

    I am doing some expirimental modeling with a VI that many members of this board greatly helped me get going.  Part of this modeling is the creation of an arbitrary periodic function.  I've accomplished this using 30 "Y-Value" Inputs, and a frequency to create sort of a "unit function", or basically, one period worth of the desired function, with a maximum amplitude of 1, so that it is easily scaled.
    What I'm finding is that it would be nice to save these "Unit Functions" along with their corresponding amplitude and frequency to file, that I can later laod back into the program.  Thus, I need to both write the data to a file, (30 pairs of doubles, along with 2 independent doubles), and then have the ability to browse through all my saved functions, and load the desired one.
    I've used the express vi "Write to Measurement File" before, but that seems like a clumsy method for this.  So I then played with the various "write to..." vi's available.
    For a relatively small set like this, is there any benefit of one file type over another?  Obviously, much the data could go straight into an excel file, while it needs to be reformatted into strings to be stored in text.  I have little or no experience with bianary files.
    Are any of the file types easier than others to then load from?
    And is it possible to have the available (previously saved) functions selectable from a menu ring, or will I need to prompt the user?
    That said, I'm just looking for some general pointers on the area.  I've read all the associated help files, and read quite a few threads on specific issue.  But being new, I'd like to hear how you professionals would approach this function.
    Attached is my current code.
    Solved!
    Go to Solution.
    Attachments:
    Obtain Unit Periodic Input.vi ‏37 KB

    Given your description of what you want to do I would define a typedefed cluster that contains all of your parametric data for your data sets. You might want to allow the user to name these data sets when they save them. You can use these names as the section name. If you pass in the cluster to the write VI with the section name the data will be saved. Using the section name you can later read the data back. You can use the built in config file VI to read the section names from the config file. This will allow you to initialize your ring control. One thing I generally do for my applications is allow the user to select the ini file that want to use. That way they can save multiple versions taliored to their particular task. You could do the same thing and therefore they could have multiple data sets tailored for particular uses. Just offering that as some added flexibility for your application.
    Also, I generally don't include the handling of the config files in a state machine. This functionality is generally included in my UI task which is an event structure. Reading/writing/loading config files is more event driven by the UI than something in a processing state machine.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to read the and Write the PDF file give me the solution

    Hi all,
    How to read the and Write the PDF file give me the solution
    My coding is
    import java.io.File;
    import com.asprise.util.pdf.PDFImageWriter;
    import com.asprise.util.pdf.PDFReader;
    import java.io.*;
    import java.io.FileOutputStream;
    public class example {
    // public example() {
         public static void main(String a[])
              try
              PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
                   reader.open(); // open the file.
                   int pages = reader.getNumberOfPages();
                   for(int i=0; i < pages; i++) {
                   String text = reader.extractTextFromPage(i);
                   System.out.println("Page " + i + ": " + text);
    // perform other operations on pages.
    PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
                   writer.open();
                   writer.addImage("C:\\sam.doc");
                   writer.close();
                   System.out.println("DONE.");
    reader.close();
              catch(Exception e){System.out.println("error:"+e);
              e.printStackTrace();
    I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
    Please give response immtly
    i am waiting for your reply.
    thanks,
    Suresh.G

    I have some question flow
    How library to use this code.
    I try runing but have not libary.
    Please send me it'library
    Thank you very much!

  • How do I read and write to text files on a remote computer's hard drive

    I would like to read and write data to a text file on a remote computer. This is easily accomplished using one of the file functions such as "write characters to file.vi". If I am already connected to the remote computer, all I need to do is specify the path to the particular file and it will work fine.
    My problem is that I want to connect to the remote computer programatically within LabVIEW (I do not want to have to use the computer's OS to establish the connection. Is there a function that I can use to do this?
    Thomas D. Schaefer
    Wells Manufacturing Corp

    Yariv,
    You should really start a new thread with a new question like this, so that more people see it. Some people look primarily at threads that have no responses yet. Also, don't post the exact same question in multiple places. Or, if you must cross-post to some other forum, make sure to mention it in your question text.
    I'm happy to be a brick in your Western Wall, but I'm not sure what the main objective is here. Is the main problem really getting access to the "X bytes received in Y seconds at Z bytes/sec" string? Or is it accomplishing the file transfer? And what OS and LabVIEW version are you running?
    I think your problem is that you the LabVIEW System Exec command does not allow for the degree of interactivity that you need if you want to issue a sequence of commands to a command-line executable. However, under Windows XP (and, presumably, other Windows versions, though I can't check), you can tell the FTP executable to use commands from a textfile script by using the -s switch, and you can override the prompts during multiple file transfers with the -i switch:
    ftp -i -s:FILEPATH SERVERNAME
    If you issue a command in this format to System Exec, and make sure to create a file at FILEPATH with your command sequence (one per line), then you should at least accomplish the FTP actions. This won't give you the transfer details in the standard output, unfortunately. However, if you just want a general sense of how much was transferred and how quickly it happened, you can code that in LabVIEW by getting the resulting file sizes and using Tick Count before and after the System Exec call to see how long the transfer took.
    Hope that helps,
    John

  • How to write a CSV file in OSB

    Hi All,
    can any one tell me How to write a CSV file in OSB?
    Thanks.

    Hey, I couldnot find any xsl usage inside pipeline pair in the links given by you. Do you have any links that gives a sample example.I could not find any links with examples. I will send you a simple config jar demonstrating the use of XSLT resources/transformations.
    secondly should MFL doc replicate the name(s)of the nodes of the source xsd:I'm not sure If I understood your question.Can you please explain?
    Ex: My database schema looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="CountriesCollection" type="CountriesCollection"/>
    <xs:complexType name="CountriesCollection">
    <xs:sequence>
    <xs:element name="Countries" type="Countries" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Countries">
    <xs:sequence>
    <xs:element name="countryId">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="countryName" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="40"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="regionId" type="xs:decimal" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and the corresponding MFL that I have created gives this output
    <?xml version="1.0" encoding="windows-1252"?>
    <countriesCollection1>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    </countriesCollection1>
    Why I am asking this beacuse there is an error that i am getting:
    Jun 19, 2009 5:50:50 PM IST> <Error> <JCATransport> <BEA-381951> <JCA inbound r
    quest only invocation failed, exception: java.security.PrivilegedActionExceptio
    : com.bea.wli.sb.transports.TransportException: Binary to XML mfl transformatio
    failed for the MFL Resource Database-Jms-File/Database-File/MFLSample : null
    ava.security.PrivilegedActionException: com.bea.wli.sb.transports.TransportExce
    tion: Binary to XML mfl transformation failed for the MFL Resource Database-Jms
    File/Database-File/MFLSample : null..................................................
    Any help?
    Regards
    PS

  • Write to text file qeustion

    Hello all,
    My first question about writing to text file is does the file need to be opened? i know you have the option to create, replace, open..., but does it need to be opened in order to properly write data to the file? Also if my application is running with a disk streaming file setup and i open the file that it is writing to will this cause an error or cause labview to lose control of the file and possibly stop writing to the file?
    Thank you,
    Matt

    Feel free to experiment.  Try writing to a file from multiple locations at once, and you'll see race conditions where data could be lost.
    The reason for the Open, Write, Close type of software is because generally you are in a loop continually writing to a file, and the extra overhead of a Open and Close can be limited to when the software starts and closes, instead of having to open a new reference and close it every time you want to write to the file.  Just open the reference once, work with it in a while loop, then close it once, must more efficient and better for applications that write many times to disk.
    Is it necessary?  No you can just use the Write to Text file giving it a path and data to write, but behind that function it will need to open and close the reference each time.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to populate column titles for y values when using Write to Measurement File Express VI with a tab delimited text-based .lvm file?

    The .lvm file generated by the Write to Measurement File Express VI includes column heading titles for the y values, but they are a default value of "untitled".  See attached example of a sample file when opened in Excel, the values in question are highlighted.  Is there a way to specify the column titles when the file is written?
    This is a similar question to this posting, which received a work around response to use the Write to Spreadsheet File.vi, rather than a solution when using this VI.
    Message Edited by Hightop Raven on 05-02-2007 03:37 PM
    Attachments:
    column_titles.gif ‏13 KB

    Sorry for the late reply.  I was out of the office Friday.
    You can do it, but the code can get rather ugly.  Under the hood, the dynamic data type (the dark blue wire) is an array of waveforms.  In your case, the scalar values you convert to a dynamic data type are being converted to an array of waveforms, each waveform having one element.  You have two options.
    Explicitly convert your scalars to one-element waveforms (t0=0, dt=1) and add the title before conversion to a dynamic data type.
    Convert your dynamic data type to an array of waveforms and loop through them to add the column labels.  The conversion blocks are in the Signal Manipulation Express palette.
    I would recommend 2, since it is the easiest to add.  It is also the easiest to run only on the first iteration.  Just put a case selector around the loop, wire the selection to the While loop iterator, and set the case containing the label code to 0.  The default case simply passes through the dynamic data.
    My apologies for not including a screen shot.  I am in the process of upgrading my machine and can't run LabVIEW.  If you need one, let me know and I can post one tomorrow.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Publish to DVD says it completes, does not write the ISO file in version 13.

    When I publish to DVD and select ISO it says it completes but it does not write the ISO file in version 13.

    apsteinmetz
    The DVD disc which is labelled 4.7 GB/120 minutes is in reality 4.38 GB. And the DVD disc which is labelled 8.5 GB/240 minutes is in reality 7.95 GB.
    What version of Premiere Elements and on what computer operating system is it running? Can we assume 13/13.1 on Windows 8.1 64 bit?
    What are you doing, a burn to disc DVD-VIDEO standard or widescreen on DVD disc or burn to disc AVCHD on DVD disc?
    When you get to the burn dialog (and you have your disc in the burner tray), what does the Quality area of the burn dialog show for Space Required and Bitrate with and without a check mark next to "Fit Contents to Available Space"?
    Or, can you do burn to Folder (4.7 GB) and/or burn to ISO Image (4.7 GB)? Are your successful burn to .iso files under 1 GB in file size?
    Please quantitate "...shortening the timeline dramatically".
    Thank you. Any questions or need clarification, please do not hesitate to ask.
    Thank you.
    ATR

  • WRITE CHARACTERS TO FILE???

    Hi everyone,
    I am working on a VI that has to write some characters into an existing
    file.
    I have used: Open File--> Write to File--> Close File but once it
    writes the desired data to that file it also writes some kind of bug
    which cannot be read once that File is read.
    Therefore I used the Wirte Characters to File SubVI which works ok.
    When the new data comes in it has to replace the old one, this means
    that the APPEND TO FILE option of the subVI is set to FALSE. The problem
    is that everytime my VI runs and generates the new data that will
    replace the old one, it asks me if I want to replace the existing file,
    which is what I want to do.
    My question is, if there is any way to override the prompt window that
    asks if the e
    xisting file will be replaced and perform the "replacement"
    automatically?
    Appreciate any help,
    Horacio Castilleja
    [email protected]

    This is a common problem with using some of the simple VIs that do not
    present all of the common/usefull functions.
    If you "Save As..." the Write Characters to File.vi to another name like "My
    Write Characters to File.vi" and add a boolean control
    to the front panel or boolean constant to the diagram and connect it to the
    "Advisory Dialog? (display:T)" boolean input of the Open/Create/Replace
    File.vi, with a False, it will suppress the dialog box.
    Stu
    Horacio Castilleja wrote in message
    news:[email protected]..
    > Hi everyone,
    >
    > I am working on a VI that has to write some characters into an existing
    > file.
    > I have used: Open File--> Write to File--> Close File but once it
    > writes the desired data to that file it also w
    rites some kind of bug
    > which cannot be read once that File is read.
    > Therefore I used the Wirte Characters to File SubVI which works ok.
    > When the new data comes in it has to replace the old one, this means
    > that the APPEND TO FILE option of the subVI is set to FALSE. The problem
    > is that everytime my VI runs and generates the new data that will
    > replace the old one, it asks me if I want to replace the existing file,
    > which is what I want to do.
    > My question is, if there is any way to override the prompt window that
    > asks if the existing file will be replaced and perform the "replacement"
    > automatically?
    >
    > Appreciate any help,
    >
    >
    > Horacio Castilleja
    > [email protected]
    >
    >
    >

  • Write arrays to file

    Hi,
    I want to write some arrays into a file side by side.
    Like that..
    A B C D
    1 0,25 0,4 0,25
    2 0,36 0,3 0,96
    Hox can i do it?
    Thanks a lot..
    irfan

    The question is how you want to read the saved data.
    - If you want to be able to open the file in a text editor or Microsoft Excel, then you should save the 2D-array as ASCII-characters - easiest example is to use the "Write To Spreadsheet File.vi" from the "File I/O" palette.
    - If you only want to read the file from LabVIEW then the most efficient method is to save as binary data. Here is an excellent KnowledgeBase that shows this concept.
    Please notice that saving your data as binary data makes it impossible for you to open it in Excel.
    Best regards,
    Philip C.
    National In
    struments
    - Philip Courtois, Thinkbot Solutions

  • How to view waveforms in DIAdem that were saved in Labview using "write waveforms to file" VI

    I'm new to DIAdem but would appreciate any help to my question.
    I seem to be having a little trouble but how do I view waveforms
    in DIAdem that were saved in Labview using "write waveforms to file" VI??
    tks, Terry

    Hello,
    There are several ways to write waveform data from LabVIEW so it can be accessed from DIAdem. Two of the easiest ways are to use either .lvm files or .tdm files. You can write .lvm files using the Write LabVIEW Measurement File.vi which is located in the File I/O palette. You can write .tdm files by using the storage VIs which are located in the File I/O >> Storage palette. So, I would recommend using either of these file formats if you are developing a new application since these can be loaded into DIAdem directly.
    If you are interested in loading files that where already created from the Write Waveforms to File.vi, I am wondering what file type you are using. For example are you saving your files as .dat or .txt with your Write Waveforms to File.vi? Feel free to reply to this thread with this information and I would be glad to help you out.
    Regards,
    Kevin L.
    Applications Engineer
    National Instruments

  • ATTN Java Gurus: udf.policy - Unable to Grant Read,Write to Specific File

    NOTE: A correct answer to this question will receive the rarely used OTN 25pt <font color="silver" size="3" face="script">Platinum Star</font><font color="silver" size="4" face="script"> &#9733;</font> *
    Essbase 9.3.1
    Using a Java CDF that reads and writes to a file
    I'm trying to grant permission to a specific file in the file system by granting permission in the udf.policy file.
    When I uncomment the line permission java.security.AllPermission; the CDF works fine and interacts with the file correctly. This is just to prove that the CDF works, I need to tighten this up to a single file. I stop and start the app after each edit.(I've also tried bouncing the Essbase server too)
    When I use the following, I get an exception, shown below. Nothing of consequence is being written to the app or essbase logs
    grant {
      permission java.io.FilePermission "C:/test/essbase/CalcProfile.db", "write, read";
    };java.security.AccessControlException: access denied (java.io.FilePermission C:\esstest\Server\PlugIns\Essbase read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         at com.hyperion.essbase.calculator.ESecurityManager.checkRead(ESecurityManager.java:80)
         at java.io.File.exists(File.java:731)
         at org.sqlite.Conn.open(Conn.java:98)
         at org.sqlite.Conn.<init>(Conn.java:57)
         at org.sqlite.JDBC.createConnection(JDBC.java:77)
         at org.sqlite.JDBC.connect(JDBC.java:64)
         at java.sql.DriverManager.getConnection(DriverManager.java:582)
         at java.sql.DriverManager.getConnection(DriverManager.java:207)
         at com.accelatis.essbase.calcprofile.cdf.CalcComment.calcComment(CalcComment.java:16)
    >
    I've tried creating the policy using PolicyTool, same result. However, I have no idea what or if I should put in the "CodeBase" field.
    Has anyone had success creating read & write permissions to a single file using the udf.policy file? What is the magic syntax?
    Regards,
    Robb Salzmann
    * <font face="small" size=".2em" color="silver">right after the platinum star award is created</font>

    Hi Robb,
    Never heard of the OTN 25pt Platinum Star award... It sounds appetizing, but I know I won't get it since I've got no Java experience. :)
    I was just gonna ask if you've thought about posting the same question on one of the Java forums?
    https://forums.oracle.com/forums/category.jspa?categoryID=285
    Cheers,
    Mehmet

  • Process local form and write to local file?

    I've written a form using alot of JavaScript. It is intended to run on a local machine and I need to write the information to a local file. Is this easily done using javascript to process the form?
    If so, please point me in the right direction.
    Thanks much,
    Mike Rieck

    Ok, so here's another possibility I'm thinking of.
    My need is to have our salesmen fill out the form (quote request) offline, then when connected to the Internet, submit the info via e-mail or posting to an application on our company server.
    Since my form has many questions that will never get answered, depending on the path the user takes, I could create a smaller form by opening a new window with javascript and writing the pertinent values of form 1 as the default values for the new form. Then ask the user to save the new form to their hardrive and either e-mail it or post it, at a time when they are connected to the Internet.
    To add additional functionality to this process, I want to take the form and process it into a formal RTF formated quote.
    From what you've explained, I can either write a Java application to process the form on our server, or I could ask the salesman to e-mail the 2nd form as an attachment, and I could write another program in any language to write the RTF file on the local machine of the e-mail recipient.
    If I choose the posting option, what are the possibilities of getting the RTF file to someone inside the same office as the server, without the salesman having to download the RTF file and then e-mailing it? Also, how difficult does this sound for someone new to Java?

  • After stoping the MDM Server there will write a core-file

    Hello,
    I have a question about stopping the MDM Server. My MDM Server is running on a SUN Server. When I stopped the MDM Server with sapcontrol -nr 00 -function Stop and sapcontrol -nr 00 -function StopService the MDM Server alsways write a core-File in /usr/sap/<SID>/MDS00/work. The core file are bigger than 8 GB. Did anybody know if I can configure that there will create no core-file after a normal shutdown?
    Gretting
    Thomas
    Edited by: Thomas Haase on Oct 8, 2010 10:51 AM

    Rahul,
    You can see the log files through console. You have the Logs in console which you can view. The log files are also maintained in the logs, besides the archives, ready and exception folders.
    Indraveer

Maybe you are looking for

  • How do I transfer the music content on my old IPOD (click wheel) to Itunes in my new computer for subsequent transfer to a new IPOD

    How do I transfer music on my old IPOD( click wheel) to Itunes on my new computer(Windows 8) for further transfer to a new IPOD nano

  • Wrt54gp2 -- using 110v in country with 220v

    I purchased a universal ac/dc adapter set to 12 volts, positive polarity, and a "load current" of 1000mA in order to run my wrt54gp2 in Israel.  After i plug it in, the power light will flicker for a few seconds and then go out.  Based upon my rather

  • IMac shuts down without warning

    My iMac has started shutting down without warning. The fan is also going luch faster than normal. Ran etre: Problem description: iMac 9,1 shuts down without warning. EtreCheck version: 2.1.8 (121) Report generated 2 Feb 2015 13:25:46 CET Download Etr

  • Wrong distance in Health app

    For two weeks now the Health app on my iPhone6 shows wrong data for distance travelled. For example it says I took about 8000 steps but that converts to just 500 metres. I restarted th IPhone but that didn't help. Anybody an idea? (ios 8.2)

  • Site System Roles - Best Practices

    Hi all - I was wondering if there wwere any best practice recommendations for how to configure Site System Roles? We had a vendor come onsite and setup our environment and without going into a lot of detail on why, I wasn't able to work with the vend