LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DateStr outputting incorrect value?

I got a report of an anomaly on a production application.  It occurred yesterday.  A few UUTs apparently "skipped ahead" by several hours of testing inexplicably.  My software records unit test results every 4 seconds, so I have pretty good visibility of such errors.  Here is a screenshot:

 

2017-05-05 10_31_14-_E__time warp.txt - Notepad++ [Administrator].png

 

Notice columns 2-3.  These are produced by calls to DateStr() and TimeStr().  Several columns over, you'll see a test time string also in HH:MM:SS format.  This value is calculated by calling GetCurrentDateTime().

 

You'll notice that between the Date/TimeStr columns and my elapsed column, they agree that some sort of time warp happened, to the tune of 27 hours!

 

I checked the PC's real time clock.  It was correct to within a few minutes, correct date, correct AM/PM.  

 

This codebase has been released and stable for a few years now, so I wouldn't expect issues around the use of this part of my logging mechanism.  This is the first time I've ever witnessed an error quite like this where I couldn't depend on CVI's date/time functions.

 

Should I be worried?

0 Kudos
Message 1 of 5
(2,727 Views)

Are you absolutely sure nothing happened outside your application, such as a clock correction via NTP, or similar? 

Carlo A.
Megaris




0 Kudos
Message 2 of 5
(2,646 Views)

No, I'm not completely sure.  Although our production floor keeps these computers disconnected from the internet for that reason.

 

I starting to think that this PC "hung up" for several hours and recovered.

0 Kudos
Message 3 of 5
(2,642 Views)

Have you looked for hints of any strange behaviour in Windows' Event logs ?

Carlo A.
Megaris




0 Kudos
Message 4 of 5
(2,634 Views)

I did.  No errors or warnings in that time frame.  I'm going to swap out computers next.

0 Kudos
Message 5 of 5
(2,607 Views)