Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
20 ratings:
 2.5 out of 5     Rate this Document

How Can I Write a Timestamp with my Data to a Spreadsheet using LabVIEW?



Primary Software:
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I want to include a time stamp as a column along with my data in a spreadsheet file in LabVIEW. How do I do this?

Solution:
Since a spreadsheet file is a specialized type of text file, you need to first convert your data and time stamp into a string. You can do this in three steps:
  1. The time stamp must be wired to either a Get Date/Time String.vi or Format Date/Time String.vi.

  2. Your data must be wired to a string/number conversion VI. Two possibilities are Number to Fractional String.vi for floating point numbers and Number to Decimal String.vi for integers.

  3. Finally, the data and time stamp strings must be joined into a string array. You can do this by wiring the time stamp string and number string to a Build Array.vi.


After the time stamp and array are in a string array, you can write it to a spreadsheet file. You can see a community example of the code below in the related links section below.

Related Links:
KnowledgeBase 3DSS8NS: How do I create a Millisecond Timestamp in LabVIEW?
KnowledgeBase 1RBDAG5P: Precision Errors Writing and Reading with Write to Spreadsheet File and Read from Spreadsheet File.vi
KnowledgeBase 3PJC3B8: How to Convert a Date/Time String into a Timestamp Constant
NI Community Example: Writing a Timestamp with my Data to a Spreadsheet using LabVIEW

Attachments:


Inserting Time Stamp into a Spreadsheetver80.viInserting Time Stamp into a Spreadsheetver85.viInserting Time Stamp into a Spreadsheetver82.vi


Report Date: 09/07/2007
Last Updated: 04/23/2013
Document ID: 4D6CM9QQ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit