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
obtaining DHCP address leases;
writing error log entries;
executing the CommandListAppendMarkTime command.
Please follow 17.1 Accessing the card with the SP-ICE-3 Configuration Tool to prepare for the remaining steps.
Select the System tab.
Scroll and resize it, if necessary, so that the required items are visible.
Click Set from host's local time to set the card's RTC to the host's current local time.
Use the SystemAPIGetTime command to check the card's idea of the current time.
Use the SystemAPISetSystemTime(DateTime) command to set the current (date-and-)time on the card.
Here is an example which makes use of both of the above:
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."); } }