Click or drag to resize

17.9 How to set the card's Date and Time

The SP-ICE-3 Card's hardware incorporates a battery-backed Real Time Clock ("RTC") which keeps running even when the card is not powered.

The card uses the current date and time when

How to set the card's RTC via the SP-ICE-3 Configuration Tool (SPICE3Config.exe).

  1. Please follow 17.1 Accessing the card with the SP-ICE-3 Configuration Tool to prepare for the remaining steps.

  2. Select the System tab.

    Scroll and resize it, if necessary, so that the required items are visible.

    SP-ICE-3 Configuration-RTC
  3. Click Set from host's local time to set the card's RTC to the host's current local time.

How to set the card's RTC programmatically via the ClientLib.

  1. Use the SystemAPIGetTime command to check the card's idea of the current time.

  2. Use the SystemAPISetSystemTime(DateTime) command to set the current (date-and-)time on the card.

  3. Here is an example which makes use of both of the above:

    C#
    using ( ClientAPI client = new ClientAPI() )
    {
    client.Connect( TestSettings.CardIP );
    
    DateTime hostDateTime = DateTime.Now;
    
    client.System.SetSystemTime( hostDateTime );
    
    DateTime cardDateTime = client.System.GetTime();
    
    client.Disconnect();
    
    if (cardDateTime - hostDateTime).TotalMilliseconds > myClockSkewLimit {
    throw new Exception("Something went wrong while setting the card's RTC.");
    }
    }