Applies To:
  • CitectSCADA 6.10
  • CitectHMI 6.10

Summary:
The TimeToOleDate function converts a Citect time value into OLE time which may be used in programs such as Visual Basic, Excel, and Citect Process Analyst. Although Citect times are accurate to the nearest second, the OLE time is being rounded to the nearest 5 minutes 38 seconds. The time may either be ahead of or behind the Citect time.
 

Solution:
Citect has confirmed this to be a problem in CitectHMI/SCADA version 6.10. It has been fixed in v7.00.

The following function may be used in place of TimeToOleDate to work around this problem in v6.10. TimeToOLEDateFix has the same parameters and return value as the built-in TimeToOLEDate function, but the result is accurate to the nearest second..

REAL
FUNCTION
TimeToOLEDateFix(INT iTime, INT bLocal = FALSE)
    INT iBias;

    IF bLocal THEN
        iBias = TimeUTCOffset(iTime);
    ELSE
        iBias = 0;
    END

    RETURN 25569 + ((iTime + iBias) / 86400.0);
END

Note that OLE date/time values should be stored in local Cicode variables. They will lose precision if copied to MODULE, GLOBAL, or variable tags (Q2647).
 

Keywords:
VB 

Attachments