To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Import a timestamp from Microsoft Excel into LabVIEW and convert it to the timestamp data.
Description
Simple solution for old problem of converting MS Excel time to LabVIEW time. No more day counting and daylight saving... well let's hope
Concept:
NumberFormatLocal property is used to allow mixed setting for Excel spreadsheets.
Write function:
Read function:
Steps to Implement or Execute Code
Note: Text property only works on single cell's; i.e. cannot be acquired as array. Column or row of timestamps must be read one by one.
Requirements
LabVIEW 2012 (or compatible)
Updates
11/15/2010
Bug: AM/PM switch was missed in original code.
Note: Required testing with 24h style and regional settings other than US.
12/10/2010
Bug: If Excel's Cell is not wide enough to accommodate entire Date and Time string, then reported value from "Text" property would be presented as "####", resulting in string scan error.
Fix: Execute "ShrinkToFit" command before "Text".
04/25/2010
Bug: Error converting time
Fix: Format to LabVIEW timestamp directly
**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.