05-06-2016 07:05 AM
I am trying to convert 2 strings in this format below to time so i can subtract them from each other to get the difference. I found example online that work in a new version of Labview but doesnt work in labview 7. Can anyone help?
15:23:54.315 - 15:22:54.315 = 1 min. This 1 minute will be used to be an input to a wait (ms) time delay.
This is in the string format. If it was in a time format it would be easy to subtract the 2. Also i will be reading in the numbers from a file so this is just an example of how the strings will be displayed the time are different.
05-06-2016 07:13 AM - edited 05-06-2016 07:13 AM
Use Scan From String.
05-06-2016 08:49 AM
I tried this solution but with labview 7.1 when i enter %<%H:M:%S%u>T the output from the Scan from string is a blank White and can't be inputed in to anything it shows error. void broken wire you may have entered an empty control
05-06-2016 08:57 AM
I'm pretty sure LV 7.1 didn't support scanning timestamps using the Scan From String primitive.
Instead, you can use Scan From String to scan the various elements separately (using a format string of the style %d:%d:%d, etc.) and then either build them into a date time cluster and convert that to a timestamp using the relevant function, or multiply each part by the correct amound and add them all together. Since in both cases you're subtracting, you're going to end up with relative time, so it doesn't really matter which way you take.
05-06-2016 03:10 PM