ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
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?

 

Thanks,

tgilbert

0 Kudos
Message 1 of 86
(4,598 Views)

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

Richard






0 Kudos
Message 2 of 86
(4,590 Views)

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)?

 

ni.jpg

 

Alex Lifeson

0 Kudos
Message 3 of 86
(4,579 Views)

Hi Alex Smiley Happy

 

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

 

1.png

 

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

Richard






0 Kudos
Message 4 of 86
(4,575 Views)

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

 

Thanks.

0 Kudos
Message 5 of 86
(4,570 Views)

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.

time.jpg 

0 Kudos
Message 6 of 86
(4,567 Views)

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

 

Noname.jpg

Now Neil Peart

0 Kudos
Message 7 of 86
(4,562 Views)

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
(4,558 Views)

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
(4,555 Views)

What is wrong with simply using a while loop?

0 Kudos
Message 10 of 86
(4,553 Views)