From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send date/time to excel

Hello,

 

I am trying to send the date and time to an excel sheet in another row. How do I do that? I have a screen shot of what I have done.

0 Kudos
Message 1 of 10
(4,628 Views)

First off, you're writing to a delimited text file, not an Excel sheet. If you want to write to an Excel sheet, look at ActiveX and some of the other forum postings on Excel.

 

If you're sticking with delimited text, insertion is not an easy option. You probably do better assembling your array in LabVIEW and then performing a single Write to Spreadsheet call when your array is arranged the way you want it.

0 Kudos
Message 2 of 10
(4,624 Views)
All that you need to do is convert the numeric to a string and build a string array. Then you set the Write to Spreadsheet File function to the string type.
0 Kudos
Message 3 of 10
(4,604 Views)

Please learn about Snippets (open LabVIEW, go to Edit Menu, notice "Create VI Snippet from Selection") which lets you create an "Executable Image of LabVIEW code" that you can paste into your post directly.

 

BS

0 Kudos
Message 4 of 10
(4,564 Views)

Im having trouble writing the date and time to array. How do you convert the date string into a numeric?

0 Kudos
Message 5 of 10
(4,542 Views)
That makes no sense after being told to convert the numeric to a string.
0 Kudos
Message 6 of 10
(4,539 Views)

I have my wireless node connected to a build array. I want to connect Get Date/Time String to the build array. The error I am getting says "You have connected two terminals of different types. They type of the source is string.  The type of the sink is single [32-bit real (~ 6 bit precision)" I figure if I convert this string to a numeric, then it will be able to connecto to build array. The build array is outputting to Write to Spreadsheet File.

0 Kudos
Message 7 of 10
(4,531 Views)

Do it like this, do not just write the LabVIEW time string to Excel in a string array. You will be sorry sometime down the road when you find you can not format  the time column in your data file.

 

You may have to adjust the conversion for your time zone.

 

LVtime-to-Excel.PNG

 

Don't be confused by the results (a strange looking number) that is what an unformatted time stamp looks like.

You can use Excel to format the column into any Excel time or date format.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 10
(4,524 Views)

Here's the VI and another one that adds in writing to a file.

========================
=== Engineer Ambiguously ===
========================
Download All
0 Kudos
Message 9 of 10
(4,502 Views)
PGRSYAY,

I won't disagree that writing a date/time during will not write a true Excel timestamp but you really need to understand some fundamentals. You cannot mix data types in an array so either write two numerous or two strings. The Write to Spreadsheet can be configured for either with a simple right click or using the selector beneath the function. Make sure Context Help is always turned on.
0 Kudos
Message 10 of 10
(4,493 Views)