12-04-2013 06:37 PM
Using Labwindows/CVI 2013.
I'm collecting data and time stamps.
The time is acquired by calling time( &timeTag );
timeTag is declared as time_t;
So now I have a big array of time_t.
I want to use PlotXY to display the data. The x-axis of the graph control is configured for absolute time so it will display time and date.
My question is:
What data type should I use for the X_Data_Type argument to the PlotXY(...) function?
Should I convert the absolute time to double and use VAL_DOUBLE?
Or should I use the time_t values as is and use VAL_UNSIGNED_INTEGER? Will this still work if I build as a 64-bit application.
Thanks,
Kirk
Solved! Go to Solution.
12-05-2013 02:47 AM
You can use both: the information is basically the same but using time_t datatype you will loose the fractional part of seconds, which may or may not be a problem for you (apparently is not since you are already getting data using time () and are satisfied with that).
Look at <cvisampledir>\userint\TimeDateUnits example for an application of time graph using doubles: you can modify the example simply using time () instead of GetCurrentDateTime () and setting the appropriate data type in PlotXY ().
12-05-2013 12:36 PM
OK,
I'm using time_t to store the date in the log file to minimize the size of the log file which can grow very large.
However I think I'll go ahead and convert the time to double for plotting. That way in the future if the time storage changes for whatever reason the plotting will still work.
Thanks much for your input.
Kirk