09-22-2017 03:32 AM
Hello everybody
I try to read the latest calibration time from a instrument in my PXI chassi using C++
functions in nisyscfg.h. Below is a code snippet
NISysCfgTimestampUTC lastTimeCalibrated;
NISysCfgUInt64 secondsSinceEpoch1970;
double fractionalSeconds;
NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertyExternalCalibrationLastTime, &lastTimeCalibrated);
NISysCfgValuesFromTimestamp(&lastTimeCalibrated, &secondsSinceEpoch1970, &fractionalSeconds);
After the call a get (Copied from my debugger)
secondsSinceEpoch1970 2212122498 NISysCfgUInt64
lastTimeCalibrated @0x28fb38 NISysCfgTimestampUTC
u32Data @0x28fb38 unsigned int [4]
[0] 2685816 unsigned int
[1] 829144320 unsigned int
[2] 2 unsigned int
[3] 1 unsigned int
fractionalSeconds 0.19305020570769565 double
I have read in the usergoups that NI starts time calculation from 1904 and not 1970
but anyway i can't get the value of
secondsSinceEpoch1970 2212122498
to be correct. NI MAX says some date in 2016....
Anyone that knows what i am doing wrong ??
2212122498 Seems to be in the 2040-mm-dd
best regards
Håkan
10-19-2017 09:55 AM
I get a ridiculously large number for the eSecondsSinceEpoch1970 and zeros for the last internal calibration UTC. On a simulated and live system. Seems a bit unreliable.