Showing results for 
Search instead for 
Did you mean: 

serial read, and data import into spreadsheet

I'm collecting serial data (from an RS232 port), and want to write it to a spreadsheet.  I've been working on this problem for a few days (have been stumbling, and haven't found any related posts), and have some formatting issues.  I'm thinking I need to create an array for the headings, and another for the data?  I've been having issues with data type errors, and I need some help.  The results should look something like this...


Date Time Data
8Aug2011 8:25:16 5.00
8Aug2011 8:25:21 4.80
8Aug2011 8:25:26 4.75
8Aug2011 8:25:31 4.50
8Aug2011 8:25:36 4.40
8Aug2011 8:25:41 4.00
8Aug2011 8:25:46 3.50


What's the best way to do this?




0 Kudos
Message 1 of 86

Look at this recent post.  Jeff and myself provide two methods of how to this.


0 Kudos
Message 2 of 86

Thanks.  I have a specific question, and then a general one.  Where can I find this?  And, is there some sort of document that shows all LabVIEW images, and where to find them (i.e. - where in the Functions menus)?




Alex Lifeson

0 Kudos
Message 3 of 86

Hi Alex Smiley Happy


That's simply an Array Constant of Strings that I made.




p.s.: The word "Header" above the original constant is the Label, which I named "Header".


0 Kudos
Message 4 of 86

Got it - easy peasy one, two, threesy.  I haven't used LabVIEW for about year, and I already forgot that - alzheimer's moment.



0 Kudos
Message 5 of 86

Another question.  How do I format the date/time data going into excel?  I'm using "%Y%b%d" for the date (result is an integer); and "%H:%M:%S" for the time (result is an integer).  LabVIEW indicators display formatting appropriately.  There must be something happening when the data gets moved into the spreadsheet - BTW, I opened the file in excel and notepad - same formatting.


0 Kudos
Message 6 of 86

Figured it out.  Formatting was %.3f - it should have been %s.



Now Neil Peart

0 Kudos
Message 7 of 86

Yet another thing.  Is there a way to set up the serial data capture (and importation into a spreadsheet) to occur indefinitely (without a For-loop restriction)?  And, what would the reason be for the date/time/data to be offset by one column, in relation to the header?

0 Kudos
Message 8 of 86

Figured out the offset - it was how I had the date/time/data array arranged.  Haven't figured out the endless read part yet.

0 Kudos
Message 9 of 86

What is wrong with simply using a while loop?

0 Kudos
Message 10 of 86