01-28-2015 02:32 PM
I'm saving the timestring portion of a timestamp as HH:MM:SS along with each set of data fields to a cvs spreadsheet file, i.e. each row of the file starts with the timestring followed by data in each remaining column. The first row contains data field headings. I can read this file back into LV with no problem and can remove the header row but cannot find a way to use that timestring as the x axis of a chart graph. I have no problem graphing the data in that format within Excel itself. Can anyone help?
Thanks,
DennisR
01-28-2015 02:35 PM
Correction, the timestring is saved in "HH:MM:SS" format to a csv file, i.e. 10:29:55
Thanks,
Dennis
01-28-2015 03:02 PM
Do you have more then one day of data recorded as time-stamps so that you need days or are you just looking for the relative time?
Once you can turn the time-string back into a time-stamp it should just be feeding the timestamp array into an X-Y Graph.
01-28-2015 03:10 PM
A new file starts each day, so there is only one days worth of data in each file, the date is part of the filename so I don't save the datestring portion as part of the file data, I could if necessary though. I only need to show hours minutes and seconds on the x axis. I can't find any way to convert the timestring as read in from the file to an actual time stamp for use on the axis.
Thanks,
DennisR
01-28-2015 03:14 PM
This should do the conversion of Time-string to time stamp, I'm not sure if theres a built-in VI and I'm sure I'll find out eventually but for now this works.
So just pass your array of time stamps through this into a time-stamp array and write to X-Y graph.
01-28-2015 04:12 PM
This seems to be getting close. There however is a 5 hour difference between the time read in from the file and the timestamp that is produced. I checked the calculations and the number of seconds calculated from the hours, mins and seconds comes out right. The timestamp produced is 5 hours earlier than that in the file. Is it possible that the date string needs to be incorporated into the calculations?
Thanks,
DennisR
01-28-2015 04:33 PM
Check the timestamp indicator, it is trying to write your time-stamp to your time-zone, so you will need to change the time-stamp to universal time. For the time-stamp indicator it is easy enough you just need to edit the indicator to display universal time, however for a purely data sense it is a bit odd, I have never found a straight forward way to do it so I use the conversion between Time in Seconds and Date/Time to do it for me.
01-28-2015 04:35 PM
Actually I just had another thought that may be even easier, if you calculate the time as a straight number of seconds and use that at the X array for the X-Y graph then you should simply be able to edit the display of the X scale to come up as a time notation anyways, it involve s a little less work with the number and a little more front panel playing, but both should work.