bluelotus128 Posted March 3, 2011 Share Posted March 3, 2011 Hi, I am trying to find a solution to avoid using the Insert Time() function to associate time with a data array. I have a data array of measurement readings and another array of the time points when these measurements are made. Both of these arrays are being downloaded from the memory bank of a water treatment system controller and so points of time are not always contiguous (As the system is designed to record power outages) and so in other words I cannot use the Insert Time () function. I am trying to provide a graphing feature in my application (Measurements against Time Points) so that I can plot the measurements on the Y axis and the time points from the second array on the X axis. I would very much appreciate if you could let me know if there is a way to do this. Link to comment Share on other sites More sharing options...
AzeoTech Posted March 4, 2011 Share Posted March 4, 2011 Two ways: 1) you can always just put the time array variable in the X expression for the graph and make it basically into an XY graph. You'll need to adjust the scaling, since Use Time Width won't work. You also might need to set the Align to -1 to keep it from trying to align data. 2) insertTime() isn't the only way to associate time with data. Lets say you have two variables named "data" and "theTime" and they are presumably both the same size array. You can just do: data.time = thetime to assign the time values in thetime array to be the time of the data points in the data array. Then you can plot "data" like a normal trend graph. Link to comment Share on other sites More sharing options...
bluelotus128 Posted March 4, 2011 Author Share Posted March 4, 2011 Thank you very much, sir for your response. I have another question. If I followed the second method which is using the data.time technique to assign time values to data what would be the format (Would it be the number of seconds since 1970 format or any other format) of the individual elements of the time array? Currently I have year, month, date, hour, minute all of them in separate individual arrays. I would appreciate it if you could let me know a solution to this. Link to comment Share on other sites More sharing options...
AzeoTech Posted March 4, 2011 Share Posted March 4, 2011 It needs to be in standard DAQFactory time: seconds since 1970. You can use the strToTime() function to convert your year/month/day format into seconds since 1970. See section 4.12.11 in the user's guide. Link to comment Share on other sites More sharing options...
bluelotus128 Posted March 4, 2011 Author Share Posted March 4, 2011 Thank you very much, sir. The fix worked. I appreciate your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.