locked
Date and Time lost in VB program RRS feed

  • Question

  • I have a data logging package running on an industrial printing press under Win10/64 on Intel NUC boxes, fully embedded with no internet connection. I have disabled automatic date and time updates in Win10 and set the proper date, time, and time zone.

    The system records the press startup, shutdown (via hooks on the windows change-of-state), errors detected on the press (double sheets, etc.), logs each 50 sheets processed in real time, and adds log entries each ten minutes if the press is idle. The data log files are built for each labor shift. The firmware was begun a while ago in VB6 and has been carried forward using Studio to the latest 2019 version. The program has been built with the latest version of VB.NET. I use the DateTime.Now object for system information, the log files use the system date in the filename, and each log entry is time stamped.

    The package allows the user to define labor shift schedules independently for each day of the week. For testing I have defined all shifts as 8AM-4PM, 4PM to midnight, and midnight to 8AM. During the Monday-Friday period, all of the shifts appear to behave normally; the log files are created and data added to them. The press may be left on all day and night, or started and re-started during any or all of the shifts with no deleterious impact.

    During the weekend, however, the startup may or may not be logged, and the data files may not be created at all. Several different machines have been outfitted with the package, and the best that can be said is that most of the time the weekend activity will be logged.

    Are there any suggestions as to what may be happening? I'm getting to the conclusion that Win10 is failing to update the DateTime object, but I can't figure out a way to debug the hypothesis.

    Monday, December 9, 2019 10:22 PM

All replies

  • Someone working at the weekend knows how to delete your logs? ;)

    Seriously, you've told us a lot, but as far as I can see there's nothing really relevant as to why it should go awry only at the weekend. I'd suggest that someone's doing something you're not aware of - whether that's anarchy or just some operational difference that you've not encountered in testing.

    Tuesday, December 10, 2019 12:13 AM
  • David, thanks for the reply.

    If it were anybody but the owner of the company, I'd take it seriously. But he's the guy running short times on the weekends to do Youtube training videos for the operation of the machine.

    The bulk of the code (about 16000 lines including comments) is VB6 code with LOTS of global vars. There are three serial ports declared, each module has a separate timer hook. The initial file IO is all random read/write process (but all of the files are closed at the end of the form load.)

    All of the new code is .NET, uses streams, and avoids the serial functions. I was hoping there's a date/time synchronization call that I missed during the program load, or maybe on the first form load.


    • Edited by johninFL Tuesday, December 10, 2019 6:11 PM
    Tuesday, December 10, 2019 6:10 PM