09-03-2009 12:58 PM
Solved! Go to Solution.
09-03-2009 01:18 PM - edited 09-03-2009 01:19 PM
For others, code originated from this thread, though this is an addition to that code, and a new question.
To the question: The reason why you're not getting the time correctly is because you are reading the file and telling the Read From Spreadsheet File VI to parse integers. The text "10:39" is not an integer. Thus, it returns you the part of that text which is an integer, which is 10. To correctly parse the file you should read it in as a 2D string and then parse each line to convert 10:39 to a valid timestamp.
P.S. The code in the frame sequence should be in a subVI. And the frame sequence is also not necessary.
09-03-2009 01:28 PM
smercurio_fc wrote:For others, code originated from this thread, though this is an addition to that code, and a new question.
To the question: The reason why you're not getting the time correctly is because you are reading the file and telling the Read From Spreadsheet File VI to parse integers. The text "10:39" is not an integer. Thus, it returns you the part of that text which is an integer, which is 10. To correctly parse the file you should read it in as a 2D string and then parse each line to convert 10:39 to a valid timestamp.
P.S. The code in the frame sequence should be in a subVI. And the frame sequence is also not necessary.
Message Edited by smercurio_fc on 09-03-2009 01:19 PM
Thanks! (and kudos)
09-03-2009 02:12 PM
09-03-2009 02:37 PM
09-04-2009 10:03 AM
09-04-2009 10:39 AM
icemaker wrote:
I wired the iteration to the index-0 on the index array then wired a constant to the N terminal for troubleshooting purposes but then I do not get any values for my output. Thanks again for the help.
That makes absolutely no sense. The iteration terminal should not be connected at all, nor should a constant be wired to the N terminal. The loop automatically runs for as many rows as you have in your file. For the moment forget the rest of the code and concentrate on reading the file and parsing the numbers.
Step 1: Create a VI with just the code I showed you, and run it in highlight mode then you will see the indicators update based on each row. The Read From Spreadsheet File VI will ask you for a file since there is no path wired to it. In your full code you would obviously wire the path.
Step 2: Add string to number conversions on the wires coming out of the Index Array so you can actual numbers.
Step 3: Build an array out of the 2 numbers you have, and then wire the array out of the loop. Autoindexing will automatically give you a 2D array. You can then connect this to a graph.
Step 4: Copy the code into your full VI, making sure to connect the path to the Read From Spreadsheet File.
09-09-2009 09:38 AM
09-09-2009 09:47 AM
09-09-2009 01:12 PM
I converted my 24hr time to seconds. I tried two things, wiring as seen in picture below. And also tried converting to time stamp as you suggested. When I make it a timestamp I get a broken wire when I put it into the array.