Hello,
The unit of time stamp for nifTrendData_t is 1/32 ms, and starting from Jan 1, 1972 according to FF specification. So it turns to be a very huge integer number to represent the time stamp value.
In this case, you'd better to use 64 bit integer (like _int64 in C) to represent this value. In fact, the upper part of nifTime_t stands for upper 32 bit section of this value, while the lower part of nifTime_t stands for lower 32 bit section of the value.
For example, when you get the "lastUpdate.upper" and "lastUpdate.lower" values from nifTrenData_t as following:
lastUpdate.upper = 0x00001e01; // 7681 in decimal
lastUpdate.lower = 0x73f800f1; // 1945633009 in decimal
Then the actual time value is:
timeInFFUnit = 0x00001e0173f800f1; // 329915894
33585 in decimal
Since the unit is 1/32 ms, you will get:
timeInMs = timeInFFUnit / 32 = 1030987169799 ms
Considering time stamp of 00:00:00, Jan 1, 1972 is 0, you will get:
Day = 11932; // it is Sep 1, 2004
Hour = 17;
Minute = 19;
Second = 29;
MilliSecond = 799;
So finally you will get the Time Stamp as:
09/01/04 17:19:29:799
Hope it helps.
S. G.
Fieldbus Support Engineer
National Instruments
Please contact us by sending e-mail to fieldbus.support@ni.com , which is the dedicated support e-mail address for NI Foundation Fieldbus products.