Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Values from NISysCfgTimestampUTC timestamp using C API

Hello,

I verify External Calibration is supported by the device,

 

NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertySupportsExternalCalibration, supportsECalBool);

 

 

and get a NISysCfgTimestampUTC  timestamp (struct unsigned int u32Data[4]) with zero values.

NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertyInternalCalibrationLastTime, lastExtCal);

 

My initial thought is I should just grab these values where each signifies year, month, day,

NISysCfgTimestampUTC  typdef to the function below from what I understand converts to seconds from 1970.

NISysCfgValuesFromTimestamp(lastExtCal, secondsSinceEpoch1970, fractionalSeconds);

 

 

I get  a large value secondsSinceEpoch1970 = 18446744071626706816 , fractionalSeconds = 0.0000

 

What am I doing wrong?

0 Kudos
Message 1 of 4
(3,428 Views)

The original value I posted was because of the simulator.

The physical hardware now returns 1419034537 and 0.359672which seem to be correct. but in order to get the correct date, what process should you follow?

0 Kudos
Message 2 of 4
(3,412 Views)

SunDontShine,

 

Let me see if I understand you correctly, you are just trying to acquire the values from the NISysCfgTimestamp function, right?

I believe this results you are getting are an expected behavior. Now, if what you want to do is "translate" this number that are getting, this website might do the trick for you: https://www.epochconverter.com/

 

Regards,

 

 

Tuco100s

0 Kudos
Message 3 of 4
(3,390 Views)

It's basically the unix epoch time. All the normal C runtime library functions that work with such time values such as ctime() should work.

 

The original value is most likely a LabVIEW timestamp which consists of an int64 that indicates the seconds since January 1, 1904 GMT and an uInt64 which contains the fractional seconds.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(3,262 Views)