LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing DBL data to .xls

Hello,
 
I'm trying to process data that are time stamped by the (Get Date/Time In Seconds.vi).  I'm sampling two sets of data on 1ms intervals.  This means I have two huge arrays of data.  This only works for a few minutes, then buffer fills and LabVIEW crashes.  I've decided to go around this problem by storing my captured & time stamped data in spreadsheet files.  I would eventually like to sample, store, retrieve, compare the two sets of data, then store the combined/processed data.
 
My first question is whether or not this method of data acquisition/processing the most efficient way, and if not, what method should be taken?  If this is in fact the best method, how should I go about storing data that is (To Double Precision Float)?  I noticed that the (Write to Spreadsheet File.vi) only accepts arrays of SGL.  I've tried to convert all my time stamps to SGL, but this is not working at all.  I attached an image of what I'm working with.
0 Kudos
Message 1 of 8
(3,759 Views)
Hi systems_e

In LV 8.0 the write to spreadsheet.vi has instructions how to make it accesible for doubles.
LV 8.2 is polymorphic and will accept doubles.

Now in LV 7.x (or lower) you have to save a backup copy of the VI (as write  to spreadsheet dbl.vi). Open this and right click on the the array control and select representation->DBL
This should work,

Ton
 
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 8
(3,752 Views)
Great.  I'm able to write to a spreadsheet file now with DBL values.  However, the only way I found how to do this, was to use a combination of vi's (Number to Fractional String.vi), (Array to Spreadsheet String.vi) and the (Write to File.vi).  Everything works, but the 'Write to File.vi' doesn't give the user the option to append.  I was a little stuck on this part, but I managed to find some sample code on the discussion boards that takes care of this...
 
It accepts a 1D or 2D array of strings.  This used in combination with the (Number to Fractional String.vi) works perfectly.  If you have another way to do this, I'd be more than happy to listen, but other than that, thanks for the help.  Here is a link to the page I found on the forums.
 
0 Kudos
Message 3 of 8
(3,744 Views)
Hi Systems,

you can skip the 'number to fractional string.vi' just feed the 2d-array into the array to string function.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 8
(3,724 Views)

Well I tried using the the array to string function... (array to string spreadsheet.vi), but the (write to spreadsheet.vi) only takes numeric arrays.  I tried converting the string back into an array format after that by using (spreadsheet string to array.vi), but that failed to work as well.  Finally I used the (byte array to string.vi), and tried to wire this directly to my custom vi that takes an array of strings, but I couldn't get this to work either.  I am using LabVIEW 8, so maybe I'm still unclear about specific vi's to use.

 

It wouldn't be a big problem if I couldn't eliminate these custom made (write to spreadsheet.vi)s that accept strings, because they do include a few other vi's within themselves, but it would be nice to simplify.  The only other thing that I have been unable to get around is the write/append options.  Is there anyway to overwrite a file, without asking the user to replace it?  Every time I try to overwrite the file, the user is prompted for permission to replace it, so my program tends to be a bit inconvenient.  Finally, do you agree that this is the best way to handle large amounts of recorded data (2 arrays, 3 columns each, sampling data every 1ms)?  I apologize if this is a simple solution, but I’m just not following some of the responses.

0 Kudos
Message 5 of 8
(3,705 Views)

Hello Systems,

If you use the Open/Create/Replace.vi (it may be within one of the VIs that you customized) and don't wire in a file path, a dialog will pop up.  However, if you wire in a path with a specific file name, it should not ask you if you want to replace it.  I would suggest reading the LabVIEW Help File for that VI. 

Let me know how it goes - thanks!

Janell R | Applications Engineer

0 Kudos
Message 6 of 8
(3,690 Views)
Great.  Thanks for the help.  The mod'ed file was actually something I took off the discussion board.  It worked the same way as the open/create/replace, but it was hand coded... lots of embedded case statements.  But after a little poking around, I was able to find it.  So that's one of my problems I can forget about.
 
The whole reasons why I'm exporting/importing, processing data, then exporting is because LabVIEW can't handle the amount of data that I'm trying to process.  I know I posted a question on this earlier, but do you have any recommendations on how to go about an interpolation on a large amount of data?  From my understanding, the program's buffer is filling up, whether or not data is exported to spreadsheets or not.  My only other guess at cracking this problem was to continue exporting my data, then importing/ interpolating/ exporting the data again, point by point.  But this seems very complicated and feels like it's going to take a lot of processing time.
 
I appreciate your help on the last question, but if you could answer this one as well, it would be very helpful.
 
Thanks
0 Kudos
Message 7 of 8
(3,684 Views)
Hi systems,

You should save the data that you have interpolated, and then read new data.

Could you show some code?

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 8 of 8
(3,677 Views)