Read from spreadsheet: a way to automatically continue if the file is missing? (Rather than having to push "continue")

Hi,
I'm using the "read from spreadsheet file.vi" to read in data from a file that may or may not be present.  The data isn't required - it's optional data; nice to have but not everybody will use it.
Of course, if the file isn't present, I get an "Error 7 occurred at Open File+.vipen File", and I have the choice of pushing either the "Continue" or "Stop" button.   What I'm wondering is:  is there a way to just have LabVIEW automatically continue if the file is missing?  Perhaps it could alert the user to the missing file, but continue anyway?   Normally I'd handle this by wiring the Error output of the function to an error indicator.  But the "read from spreadsheet file.vi" function doesn't appear to have an error output.
I think my description of my question is sufficient, but I'm attaching a snippet of my LabVIEW code that shows the read from spreadsheet file function in question, and the error I get when the file is missing.
Thanks,
dan
Solved!
Go to Solution.
Attachments:
labview-read-sprdsht-error.png ‏27 KB

Dan_the_Clam wrote:
Why oh why do people hate them so much!  I'm a friend of local variables! 
1. They use more memory
2. They require something on the front panel (even if hidden).  So that is yet another copy of your data
3. They break data flow
4. RACE CONDITIONS!!!
Dan_the_Clam wrote:
my code evolves and tends to sprawl a bit.
That tells me you do not have a good architecture to begin with.  It also tells me you need to modularize your code more and use subVIs.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Is there a way to go back to the old calendar system rather than the one currently in ios7?  The ios7 calendar is cumbersome and not user friendly.

    Is there a way to go back to the old calendar system rather than the ios7 calendar?  The ios7 calendar in the iphone does not allow one to see the exact time of appointments in the month mode, it is not user friendly.  It's lost its flexibility.  How can I go back to the old operating system?

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums.
    You may leave comments at Apple Feedback.

  • Messages - Is there any way to resend texts automatically when you don't have signal, rather than having to constantly manually 'try again'?

    When i have no signal and send a text, a red circle appears, prompting me to manually resend the text when i find signal. I live in an area with varied signal so this is beginning to get frustrating. Is there any way to set the iphone so it will automatically resend the text when it finds signal again, rather than having to manually resend it everytime? Thanks

    When i have no signal and send a text, a red circle appears, prompting me to manually resend the text when i find signal. I live in an area with varied signal so this is beginning to get frustrating. Is there any way to set the iphone so it will automatically resend the text when it finds signal again, rather than having to manually resend it everytime? Thanks

  • HT5035 When you have a positive gift card credit balance, are purchases automatically charged to the gift card balance rather than your credit card?

    When you have a positive gift card balance, are purchases charged to the gift card first until the balance is exhausted before your credit card is charged?

    Yes, your account's balance should be used first before any charges are applied to your credit card.

  • Formating Data for Read from Spreadsheet

    Hello,
    I am trying to read data with the function Read from Spreadsheet. Can I do this with a file in Excel? I saved it as a .csv file, both tab and comma delimited and neither work. Does this function truely read from a spreadsheet, or does it need to be a text file? What is the correct format for this data?
    Thank you!
    Attachments:
    bridge_data_1.csv ‏16 KB
    read_spsheet.vi ‏73 KB

    You need to set the "delimiter" input of the Read from Spreadsheet vi. Wire a string constant with a comma in it and you should be fine. A .csv file is really just a text file anyway.
    The other problem that I saw was that you set the "transpose" input to true, this caused the data to be stored in the array across two rows, when your code was looking for it to be down the two columns. Change that boolean to false and you should be all set, it works on this end at least.
    I hope this helps. Let us know if it doesn't!
    Brian

  • Error in Reading from spreadsheet tool

    Hi all, 
    In my application I am using a Read from spreadsheet function to display the contents of a txt file saved in my computer continuously every 3 mins. This txt file gets updated once approximately every 3 minutes. Now the problem which I am facing is, If the txt files is getting updated at the exact time when the vi is trying to open the txt file it gives an error saying, "file already open!! Continue or Stop" If I press Continue it misses the values from the file. Is there any alternative to avoid this happening. It happens only once or twice in an hour. But still this error becomes fatal as there is a data loss.
    Can anyone please help find a way to avoid this error.
    Regards,
    Nitz 

    Hi Nitzz,
    If you are accessing the same file frequently in two different places then access it using the low level file IO functions.
    Open the file reference at start and keep that in memry using global variable or functional global then close the same at the end of the application.

  • Read from spreadsheet file

    Hi! I am a beginner labview user and I have a problem reading data from a
    ..xls file. I have written in columns the data that i want to present in a
    waveform graph through labview. I give the path to the Read From Spreadsheet
    File tool and i connect a true constant in the "transpose" terminal. The Run
    button shows me no error but all I get in my waveform graph is a x-axis
    line. Could someone help me? Thanx

    You say that you want to read data from a .xls file. You use Read From Spreadsheet File to get the data into LV.
    You have mixed some things. A .xls file is NOT a spreadsheet file. It is a file which could be read by MS Excel and some other tools which have import filters for this file. Read from Spreadsheet File is not such a filter.
    A spreadsheet file in the context of LV is a text file where the cells of a row are separeted by a tab and the rows are separated by a end of line.
    A save thing is use Active-X automation to communicate with MS Excel. Let it load the file and read out the cells. The are examples in LV help and in the dev zone. You must have installed and licenced MS Ecxel on your target machine. Maybe someone has written such a fil
    ter for LV but I don't know it.
    The other way will only work if you use US local settings and the data is in one worksheet. Save the file with the extention .txt. So Excel will generate a text file of the correct format. Excel will use the regional settings of your machine. You can read in this file with Read From Spreadsheet File. Unfortunatly this will use fixed settings which are the same as for US regional settings.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Generate digital waveform form a read from spreadsheet.vi

    Hi, I'm very new to LabView and am having some problems in completing what I believed would be a very simple task.
    I am using the Read from Spreadsheet.vi to read in an Ascii tab delimited file that I created in Matlab (the file is simple a vector of 1's and 0's that represent a binary stream) All that I want to do is take the output from this and generate a digital waveform corresponding to the 1's and 0's in the array but I cannot find a way of doing this.....
    Help much appreciated,
    Thanks.

    You should be able to just run your data straight  in to the digital write function as long as you select the correct port width of your hardware.
    If you want to do it with a digital waveform it's a bit trickier, the digital waveform data type is a surprisingly complex animal.
    There might be a better way to do it, but this is what I've had to do in the past...
    The "build digital data" function needs a 2D array in, so convert your 1D array into a 2D.
    Then the digital data can be input into a Build Digital Waveform.
    Then the digital waveform can be output with the write digital waveform.
    Message Edited by Troy K on 03-23-2008 11:37 AM
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle
    Attachments:
    array_to_digital1.png ‏4 KB
    array_to_digital.png ‏9 KB

  • Read from spreadsheet function help

    Hi
    I have 2 csv files, each with like say 10 rows of numbers in column 1 only.   So its a 10x1 matrix.  I want to plot them using the read from spreadsheet functions (I created two Read from SS icons, each read in numbers from the two csv files.. have transpose to always true... index set to -1 to read whole file).  But the output of that returns a 2d array.  And I have trouble moving forward from that point.  I tried to change the output array dimension from 2 to 1.  Then link up the two 1d arrays to a bundle, then to xy graph.  That didnt work.  Can someone give me a hint on how to move forward from that? 
    And is there a big difference between the xy graphs and the waveform graphs?
    Thanks a lot in advance.
    Jerry

    If you have transpose set to true, then you should just use the first row output of the Read From Spreadsheet. This is a 1D array. If you still want to use the 2D array output, then use an index array function and get row 0. You'll get a 1D array. If you don't want to set transpose to true, then use an index array and get column 0. The attachment shows the three different ways. They all produce the same graph.
    The difference between a waveform graph and an XY graph is that the waveform graph displays evenly sampled data and the XY graph can display unevenly sampled data. When you create data for a waveform graph, you provide a y array, a t0, and a dt. With an XY graph, you provide a y array and an X array that may or may not contain unevenly spaced points.
    Attachments:
    Files to XY.JPG ‏27 KB

  • EOF detection in "Read From Spreadsheet File"

    Hi folks, I need help in detecting EOF in a "Read From Spreadsheet File". I' d like to stop a while loop by wiring the EOF? indicator to the stop condition, but this doesn't work. For design resons I can't substitute the while loop with a for loop and I DO need the while loop. I read something about creating custom EOF detection but I'm wondering why the builtin function in the vi doesn' t work and if there isn't some simple solution. Many thanks, hazibuli  

    I'm guessing that you want to process one line at a time from the spreadsheet.  Use Read From Spreadsheet File to read in the entire spreadsheet as Dennis says.  Then wire the 2D output to a For Loop with indexing enabled.  Each iteration of the For Loop will allow you to process one line at a time.  When the last line is processed, the For Loop will exit automatically.  Here is an example to get string length of each element in a spreadsheet. Message Edited by tbob on 03-15-2010 09:46 AM

  • Read From Spreadsheet File.vi in windows 7

    Hi,
    I use Read From Spreadsheet File.vi in windows 7 to read a table, but when it executes, i get a dialogue box asking for the filename, (The box is properly wired to the path).
    However, when i execute exactly the same programme in windows Xp it works with no problem.
    ¿Any known issues with this vi and xindows 7?
    I am using labview 8.6.
    Thanks for your help.

    I am using a relative path as shown in the figure, files are user1.xls user2.xls .... they all exist.
    I have build the program and instaled on other xp machine, it works. Then installed in a win 7 machine and is not working.
    Maybe there is a problem with ..\..\?
    Any other way to go to a parent folder not using ..\ ?
    Thanks for you help
    Attachments:
    ejemplo.JPG ‏8 KB

  • Read from spreadsheet file with multiple delimiters

    Is there a way to specify multiple delimitors in the read from spreadsheet file vi? I have a file that i need to read in that contains both space and comma delimitors and would like to read that data into an array using both delimitors (or not and). Below is the data I'm trying to read.
    ;attenuator data table
    att00:   db       000h,015h,017h,035h,03Ch,03Eh,03Eh,05Ch,05Eh,05Eh
    att10:   db       07Ch,07Eh,07Fh,09Dh,09Fh,09Fh,0BDh,015h,017h,035h
    att20:   db       03Eh,03Eh,05Ch,05Ch,05Eh,07Ch,07Ch,07Eh,09Dh,09Dh
    att30:   db       09Fh,0BDh,000h,000h,000h,002h,002h,002h,002h,003h
    att40:   db       021h,021h,021h,021h,021h,023h,023h,023h,023h,023h
    att50:   db       041h,041h,048h,048h,048h,04Ah,04Ah,04Ah,04Ah,068h
    att60:   db       068h,068h,068h,068h,068h,06Ah,06Bh,06Bh,06Bh,089h
    att70:   db       089h,089h,089h,08Bh,08Bh,08Bh,08Bh,0A9h,0A9h,0A9h
    att80:   db       0A4h,0A6h,0A6h,0A6h,0A6h,0C4h,0C4h,0C4h,0C4h,0C6h
    att90:   db       0C6h,0C6h,0C6h,0E4h,0E4h,0E5h,0E5h,0E7h,0E7h,0E7h
        END
    I'm looking to just read in the data adjust the hex values and then save the data in the exact form which I read it in. If read from spreadsheet file can not recognize multiple delimiters that is all I need to know. I do not want to spend time reading it in using a single delimitor and doing a bunch of string manipulation. I'm also working with LabView 8.5 if that makes a difference.

    You should use "scan string for tokens", and wire an array of delimiters.
    One nice behavior is the fact that consecutive delimiters are contracted into one (by default), so e.g. if your delimiters is an array containing a space and a comma, a sequence of three spaces and a comma would still count as one delimiter.
    For some ideas, have a look at my old example here:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=192847#M192847
    LabVIEW Champion . Do more with less code and in less time .

  • Is there a file size limit when using Read From Spreadsheet File?

    I'm trying to read in a large file, about 52mb, 525600 lines with 27 fileds in each line using "Read From SpreadsheetFile.vi". I then search the 2D array for -999, which represents bad/no data in that field and total the number of fields with -999 in it. This all works on 3 months worth of data. The program is giving me an out of memory error and stopping in the case where the read takes place on the large one year file. So my question is does the Read from Spreadsheet file have size limitations? Is there a better way to do this? Thanks in advance for the help.
    ssmith
    Solved!
    Go to Solution.

    Camerond--
           Thanks for the help. I recreated the VI you posted and unfortunately it doesnt work. It looks like the index array vi is only looking at the zero index and not the other 26 fields in each row. This would probably require a FOR LOOP to go through each field index. This is what I have and it works on a smaller version of the file. For some reason LV is using up bucket loads of memory to run this smaller file and crashes running the 60MB file. I've attached one of my vi's to solve this problem and the smaller data set. You'll see in the beginning that I trim some columns and rows to leave just the data I want to scan. Thanks again for the help.
        I just tried send 3 months worth of one minute data and it failed. So here is a really small version, 20 minutes worth of data. Does anyone see anything that would cause memory usage issues here?
    ssmith
    Attachments:
    Find-999NoLoops.vi ‏17 KB
    TEST2MET.txt ‏3 KB

  • 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...        

  • Wiring write to spreadsheet.vi to read from spreadsheet.vi and plot the data

    I need to plot the data file from the two 'write to spreadsheet.vi' into a graph. Does anyone know how should I connect the 'read from spreadsheet.vi' so that I can plot my data?
    Please refer to the snippets.
    Thanks.
    Attachments:
    read from spreadsheet.png ‏31 KB

    Hi Lynn,
    You're asking the very same question that I've been wondering about because I don't have the time info. I've found an example that have both info, temperature and time in two colums in one file..it uses two Index Array for time and temp, use the bundle feature, display the plot in an XY graph. So, that was an easy one, but apparently my case is different.
    I've a program that collected the data from simulated signals and it is plotted in a waveform graph against time (amplitude vs time), and a power spectrum (amplitude vs frequency). But the data that I collected are the RMS values and power spectrum amplitude...so, I'm not sure where the time data go. I need to figure this out.

Maybe you are looking for