LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading time in an array...

i want to read time from an array in same format as it is given to an array. Actually i have an excel file which has time(hh:mm) in first column and irradiance in second column. When i imported it to labview and started reading it the output shown by array for secong column is by default taking hh.for example 00:20 is read as 00 and 01:20 as 01 and similarly 01:40 as 01.how can i do that?
0 Kudos
Message 1 of 2
(2,010 Views)

This seems to be related to this thread.

 

Do you actually have an Excel workbook, or do you just have the same sort of text file that you were talking about in that thread? I'm guessing you actually have a text document and that you are using Read From Spreadsheet File (which read text files) with the polymorphic instance of "Double" selected. In this case the text "00:20" is being converted (correctly) to 0, and the text "01:40" is being converted (correctly) to 1. 

 

You have to read the data in as a string array and parse the time yourself. This means using a loop to parse out the first column. You can use the Scan From String function to get the individual numbers and then you can make up whatever time you want depending on what you're doing with it. 

0 Kudos
Message 2 of 2
(1,989 Views)