LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Which data type for X_Data_Type argument to PlotXY(...)

Solved!
Go to solution

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


 

0 Kudos
Message 1 of 3
(3,770 Views)
Solution
Accepted by topic author kirkm

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 ().



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,760 Views)

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

 

0 Kudos
Message 3 of 3
(3,746 Views)