Adding 2 arrays to a Spreadsheet file Help!!

I'm trying to write to a spreadsheet file and I want the date and time in one column and the data from my channels in another. I'm running the problem that my time is in a string format and my channels are in a number format. Attached is what my program currently looks like.
Any help would be great..
Thanks,
Pier
Attachments:
Array Problem.jpg ‏121 KB

Paulo,
I dont understand what you mean about putting the write to spreadsheet in. Do you mean putting it in twice would solve this or not? I'm looking for a top header to be as follows:
Time/Date | Channel 1 name | Channel 2 name | etc....
Could you possibly show me what you mean with the previous example I sent you.
Thanks,
Piero
Hello,
You have your file wrong formatted, because, the first time you write to it, you write as a normal text file, and that will be how excel will interpret it. You have to replace the "Write characters to file.vi" by the "Write to Spreadsheet file string" that I sent you.
If you allow me, I would like to make some extra comments on your code:
1 - When you connect an array to a for loop, there is a property of the tunnel (the point where the array goes in the loop) that is auto-indexing. Right click it and select it. This replace all those index array that you have inside your for loops and the array size wired to the N input of the loop. This will automatically index the array and the loop will automatically run n times where n is the number of elements of the array.
2 - I'm not sure about this, because I didn't run your program, because I don't have a DAQ board installed in this PC, but I think that the secont For loops that you have (the little one) is doing nothing there.
3- try to keep your code more clean, you have it spread for a very big area with a lot of empty spaces and apparentl~y there is no flow from left to right in your code that makes it more difficult to understant it.
Hope this helps,
Paulo

Similar Messages

  • Read From Spreadsheet File help

    I am saving all my data to a text file (See attached file). The problem is that when I try and use the Read From Spreadsheet File.vi I am unclear on how to make it show all my data.
    Does anyone know a away for me to read the whole file and display it all at once reather than line by line?
    Solved!
    Go to Solution.
    Attachments:
    test data 1.txt ‏6 KB

     The read from spread sheet Vi has two data outputs : the top right retrieves the whole file as a 2D array, if you leave the "number of rows" input on the left unwired.
    Message Edité par chilly charly le 01-07-2009 11:22 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Adding large arrays to a text file as new columns

    I am trying to merge several large text data files into a single file in Labview 8.0.  The files are too large to read in all at once (9-15 million lines each), so decided I need to read them in as smaller chunks, combine the arrays, and write them to a new file.
    The reason there are three separate data files was for speed and streaming purposes in the project, and the users wanted the raw, unadulterated data written to file before any kind of manipulation took place. 
    My VI:
    1.  Takes a header generated from another VI and writes it to the output file.
    2.  Creates a time column based on sample rate and the total number of data points
    3.  Reads in 3 files that each have text data (each data point is 9 bytes wide, there are up to 15 million data points per file.
    4.  Each iteration of the for loop writes a chunk of 10 to 100 thousand points (Somewhere in there seems to be the fastest it will do), formatted with the time column on the left, then the three data columns, until it's done.  I haven't quite figured out how to write the last iteration if there are fewer data points than the chunk size.
    Anyways, the main thing I was looking for was suggestions on how to do this faster.  It takes about a minute per million points on my laptop to do this operation, and though I recognize it is a lot of data to be moving around, this speed is painfully slow.  Any ideas?
    Attachments:
    Merge Fast Data.vi ‏67 KB

    Thanks for the tip.  I put the constants outside the array and noticed a little improvement in the speed.  I know I could improve the speed by using the binary file VI's but I need the files as tab delimited text files to import them into MATLAB for another group to do analysis.  I have not had any luck converting binary files into text files.  Is there an easy way to do that?  I don't know enough about binary file systems to use them.  I looked at the high speed data logger examples but they seemed complicated and hard to adapt to what I need to do.  Creating the binary header file seemed like a chore. 
    I am up for more advice on the VI I posted, or suggestions on different ways to convert a binary file to a MATLAB readable text file.
    Thanks!

  • Difficulty wiring three different arrays to one spreadsheet file

    I am having trouble outputting three different arrays from a case structure and sending them to an Excel file. I have read through several similar Excel threads and not seen anything really similar to my situation. I can't even get my arrays correctly wired to the "write to file" icon. Any suggestions would be great. I also attached my vi for reference.
    Thanks 
    Attachments:
    Read voltage, give current 5-29.vi ‏38 KB

    I cleaned it up a bit and fixed a few problems. It may not do everything that you want but I take no credit for the way the cose is written.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Read voltage, give current 5-29.vi ‏24 KB

  • Writing 2-D array to spreadsheet file changes value of time column when saved

    I have a program that creates a new row in a table each time the loop performs.  Each time the loop performs and a row is added to the table, the program uses the "write to spreadsheet file.vi" to save this new table over the previous table.  The array is also visible on the front panel of the vi.  The program works in such a way that you can stop adding data to the array, start adding data to a new array, then come back to the original by using the "read from spreadsheet file.vi".  My problem comes after opening the spreadsheet file.  The first column of the array, which corresponds to the time when the data in that row was taken, has different values than those that were seen when the array was originally displayed on the front panel.  In fact, all of the rows that were created the last time the program was run with that array have the same value in the time column, while all of the other columns keep their correct values.  Here is an example of what is happening...
    When I start the program, and run it for 5 iterations, I get a table like this displayed on the front panel:
    3241713920
    85.88012
    93.88012
    1.735015...
    3241713930
    85.97603
    93.97603
    1.747003...
    3241713940
    84.58855
    92.58855
    1.573568...
    3241713950
    84.48096
    92.48096
    1.560119...
    3241713960
    84.93667
    92.93667
    1.617084...
    This array is saved to the spreadsheet file with each added row.  If I initialize and build another array, then come back to this first array using "read from spreadsheet file.vi," I will receive the following table:
    3241713920
    85.88012
    93.88012
    1.735015...
    3241713920
    85.97603
    93.97603
    1.747003...
    3241713920
    84.58855
    92.58855
    1.573568...
    3241713920
    84.48096
    92.48096
    1.560119...
    3241713920
    84.93667
    92.93667
    1.617084...
    If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  One option I have contemplated is just having each individual row appended to the file instead of resaving the entire array with each iteration.  However, I would prefer to do it the way I am currently doing it, so I can pass the array through each time and perform different tasks on it, such as averaging the values in columns over different time periods.  Thank you in advance to anyone who can help. 

    DWDerr wrote:
    If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  ...
    This KnowledgeBase article may help.  I think things changed in LV8.20, but I could be wrong.
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • How can I convert 400 data points from a spreadsheet file to an array?

    The spreadsheet file contains over 5000 data points (in one column) of which I only want the first 400 and want to convert them to an array in Labview. I tried to use the 'readfromspreadsheet' vi but it wasn't much help. Please tell me how i should approach this problem and what vi's to use.

    I attach a model vi that you can experiment with. You will need to know the formatting of the data in your file, from there -plus the delimiter- you'll be able to estimate how many characters makes the first 400 data point. It's possible to develop a more robust vi to do this, in the mean time, the attached vi can quickly give some answer.
    Attachments:
    model.vi ‏28 KB

  • Save waveform data with corresponding time array to spreadsheet file

    Hello to all
    I am looking for a possibility to save voltage data acquired and displayed continousely to a spreadsheet file. Acquiring and displaying is not a big problem, but I have troubble to save the data with the corresponding timestamp with more than seconds accuracy. I am acquiring the data at 1000 Hz and read packages of 500 samples. The recording time should not be limited, it will be started and stopped manually. In fact the acquired voltage data first has to be scaled and than saved. If I use the 'WRITE WAVEFORM TO SPREADSHEET' VI the time column is in seconds' accuracy and that is not what I need. If I create my own time array from the waveform parameters I have timing problems. The accuracy in time should reflect the sample rate. I will attach one of my not very successful trials for better understanding.
    please help a newcomer!
    Thanks in advance
    Thomas
    LV 7.1
    Attachments:
    display & record forces v.1.0.vi ‏181 KB

    I usually follow a simple method to generate time stamp
    I keep sampling rate and number of samples to read as equal and do as shown in the attached VI
    I also remember building a VI with a small modification to this time stamp generation logic to cater to acq, where number of samples to read is half/one fourth/one tenth of sampling rate specified, but cannot find that VI.
    Hope this helps
    Regards
    Dev
    Attachments:
    Acq_DAQmx_filesave_time stamp.vi ‏121 KB

  • How can I convert these 250 data points in a spreadsheet file into an array???!!!

    I want to convert these points(see spreadsheet file attached) into a 1-D array of numbers and plot them using a vi. I am using the readfromspreadsheet.vi and it just gives me a number 4 and plots that. Please tell me what to do...I'm confused and have a project due!!!
    Attachments:
    ec1.xls ‏14 KB
    test.vi ‏14 KB

    Save the excel spreadsheet as tab delimited text file and use "Read From Spreadsheet File" vi to read it.

  • STARTED IT, BUT STILL NEED HELP -- INPUTTTING CHARACTERS FROM LOADED FILE INTO TABLE, SELECTING STRINGS FROM TABLE AND PLACING IN NEW TABLE, SAVING NEW TABLE TO SPREADSHEET FILE

    I AM TRYING TO IMPORT CHARACTERS FROM A TAB DELIMITED FILE INTO A TABLE ON LABVIEW.  ONCE THE DATA IS IN THE TABLE I WANT TO BE ABLE TO SELECT INDIVIDUAL STRINGS FROM THE TABLE AND PLACE IT IN A NEW TABLE.  WHEN I CLICK ON A STRING I WOULD LIKE THE SELECTED STRING TO SHOW IN A TEXT BOX LABELED 'SELECTED STEP'  AFTER ALL THE SELECTED STRINGS IS IN THE TABLE I WOULD LIKE TO SAVE THE NEW TABLE AS ANOTHER SPREADSHEET -- TAB DELIMITED -- FILE, MAKING IT ACCESSIBLE TO OPEN.  HERE IS WHAT I HAVE SO FAR.  I CAN INPUT DATA INTO THE TABLE, BUT I CAN ONLY TRANSFER ONE STRING INTO THE TABLE I WOULD LIKE TO BE TO INPUT MULTIPLE STRINGS.    ALSO WHENEVER I TRY SAVING THE FILE, IT ALWAYS SAVES A UNKNOWN FILE, HOW CAN I GET IT TO SAVE AS A SPREADSHEET FILE.  THANKING ALL OF YOU IN ADVANCE FOR YOUR HELP!!!!!!
    Attachments:
    Selector.zip ‏30 KB

    Pondered,
       The question you are asking is the same one that you asked in: http://forums.ni.com/ni/board/message?board.id=170&message.id=132508#M132508, to which I supplied a revised version of the original vi you used (which was modified from the original one I supplied to an earlier thread). A couple of questions: 1) What does my latest not do that is in your question, 2) Why are you starting yet another thread about the same problem?  We are here trying to help, it makes it a lot easier if you keep the same problem in the same thread, it reduces duplication of effort from those that might not have been following the previous thread(s).  Those of us that don't have our "names in blue" are just doing this "for fun" (the blue names are NI employees, who may still be doing it "for fun"), and it makes it more fun if it doesn't seem (correctly or not) that our attempts are ignored.  If an answer doesn't help, or seems incomplete, post a little more detail to the same thread so that the original respondent, or someone new, can provide more information, or understand your problem better.
    P.M.
    Message Edited by LV_Pro on 07-20-2005 01:20 PM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Help on fonction Write to spreadsheet file

    Hello,
    I come on this forum to find a solution for my issue.
    I have made a VI which acquires an input voltage and where the user can modify some parameters.
    For each iteration of my while loop, I want to save the data in a csv file that's why I'm using the fonction Write to spreadsheet file.
    But when I want to use this saved datas in csv format with Excel, the data were saved in string format so not a numeric. My purpose is to have some numerical datas and not strings because I can't do graphics or calculs.
    As you can see on the csv saved file, only the iterations of the while loop (column C) are in a numerical format.
    Here is my problem, thank you in advance for your help
    Attachments:
    VI.png ‏22 KB
    Excel_saved_file.png ‏11 KB

    Looks like you're using regional decimal signs, try "%.;.3f" as format
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to read numeric array from a text file

    I'm new to file I/O in LabView. Basically, all I need is to read the attached 2000 x 9 array into an identical 2D array within LabView. I have tried simply using the READ FROM SPREADSHEET FILE VI but it only reads the first column. Any help would be greatly appreciated.
    Thanks, Hunter
    Attachments:
    FRFx1.dat ‏286 KB

    I cant open theother examples, so maybe I`m posting something similar, but here`s my approach in LV 6.1
    First convert all double spaces to single spaces, then all single spaces to tab. Then use "Spreadsheet string to array" cutting out the first column (extra tabs produce an extra column).
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Read_in_Matlab_file(6.1).vi ‏26 KB

  • Problem using read from spreadsheet file and polar plotting

    Hi to all labview users,
    i am a beginner in labview and i am trying to do a polar plot.
    i read the polar plotting example in labview and it was straightforward.
    I used "write to spreadsheet file" to gather data.
    and they are in the following format
    13  10
    4  20
    8 30
    ....etc
    now. i tried using "read from spreadfile" to get the data into a array, then using "array to cluster" to convert the array into cluster, so i could connect it to the polar plot block
    however, it kept saying i couldnt connect that way, because polar plot uses 1-d array with cluster of 2 element and my source is a cluster of 9 elements....
    but doesnt the "read from spreadfile" block give me a 1-d array? and where does that 9 come from? i only have 3 rows and 2 columns in my data file....
    any guidance would be greatly appreciated.
    thx alot
    Happy guy
    ~ currently final year undergraduate in Electrical Engr. Graduating soon! Yes!
    ~ currently looking for jobs : any position related to engineering, labview, programming, tech support would be great.
    ~ humber learner of LabVIEW lvl: beginner-intermediate

    Helllo,
    I've made an example to try to help you  with that question.
    Notes:
     - the file must have values separeted by tab
     - reading the values from file as you mentioned using "read from spreadfile" you'll get a 2D array and not 1D;
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    Read Table and plot polar graph.vi ‏26 KB
    teste.txt ‏1 KB

  • Find and Read the Target Spreadsheet File from Target Folder

    I'm trying to find and read the target spreadsheet file from the target folder. Please help. Thanks.
    Solved!
    Go to Solution.

    If you know the folder, you could do a List Folder Contents to get a list of files in that folder.  You can then just use Array Index to get the file you want.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How Would You Handle Carridge Returns & Line Feeds in A Spreadsheet file.

    I have susessfully created a logging program which creates a spreadsheet file. I have additional information added after the loggging data is complete which I have seperated it by a CR/LF. How can I display this particular part of the file only?
    I have attached the file in question, "DATA15.dat".
    Attachments:
    DATA15.dat ‏1 KB

    Read the file like you normally do (2 D array (from Spread sheet file) )
    Then scan the first column for the CR/LF character and find the index of it (may want to use serach 1D array for the collumn).
    Then Divide the array into 2 diffrenet arrays, 1 above the found index (containg data to display), and the other one to ignore, or simply use "array subset" function

  • Read from Spreadsheet File VI

    Hello to everyone!
    I want to read a spreadsheet file VI, wich contain many rows with this format:
    0.475009,0.242797;
    0.023044,0.522105;
    0.735105,0.634358;
    0.955100,0.982586;
    etc..
    The goal is to divide these rows into 2 array: the first one contains the left number:
    0.475009
    0.023044
    0.735105
    0.955100
    while the right one contains the right number:
    0.242797
    0.522105
    0.634358
    0.982586
    Someone can help me?
    Thanks and
    Best regards!

    Hi GerdW.
    The end of line delimiter is ;
    with comma i separate two different measurements: the left numbers rapresent a current measure, while the right numbers a voltage measure.
    I want to read my csv file, split the numbers into two different array, then plot the current and the voltage.
    My start point is:
    where all rows are like this:
    i want to separate the left numbers and the right numbers into two array
    Best regards

Maybe you are looking for

  • Invoking a URL from BPEL PM

    Hi, I need to invoke a URL from a bpel process. what is the best way to do that? i would like to send the URL as is and not build it in the process thanks amit

  • Poor resolution when burning in IDVD

    I'm trying to create a slide show using ken burns effects, transitions, music and then burn to a dvd to share with family. I was told the best way to do this is to create the slide show in I-movie, share it to I-dvd, and then burn it. When playing ba

  • ETL failure relating to SDE_ORA_PersistedStage_WorkforceEvent_Salary_Full

    Hi everyone, I am getting error at ETL failure relating to SDE_ORA_PersistedStage_WorkforceEvent_Salary_Full READER_1_1_1> RR_4035 SQL Error [ ORA-00907: missing right parenthesis Database driver error... Function Name : Execute SQL Stmt : SELECT ass

  • JDBC Active Connection count issue- Current row null issue

    In our weblogic conse 10.3.5, the max connection capacity is set to 25, however when we start using the application , over a small period of time the current active connection count increases more than 25 like 30,55, 85 etc .. How is this possible? .

  • Hello Guru's,  Business process

    Hello Guru's, Logistics execution complete cycle Business process with T-Codes