Exemplo n.º 1
0
 /// <summary>
 /// Reads the date time.
 /// </summary>
 /// <param name="portlist">The portlist.</param>
 /// <param name="proxy">The proxy.</param>
 /// <param name="clientGuid">The client GUID.</param>
 private static async Task ReadDateTime(string portName, SmlComServiceClient proxy, Guid clientGuid)
 {
     Console.WriteLine();
     Console.WriteLine("{0} - Reading current meter time", portName);
     var dt = proxy.ReadDateAndTimeParam(clientGuid, portList.FirstOrDefault(m => m.ComPortName == portName));
     Console.WriteLine("{0} - Meter time (localtime): {1}, read at: {2}.", portName, dt.Data.Value.ToLocalTime(), dt.ReadAt.Value.ToLocalTime());
     Console.WriteLine();
 }