diff --git a/S7.Net/Protocol/Serialization.cs b/S7.Net/Protocol/Serialization.cs index 3d114b6..fce3bef 100644 --- a/S7.Net/Protocol/Serialization.cs +++ b/S7.Net/Protocol/Serialization.cs @@ -26,6 +26,11 @@ namespace S7.Net.Protocol _ => Types.String.ToByteArray(s, dataItem.Count) }; + if (dataItem.VarType == VarType.Date) + { + return Date.ToByteArray((System.DateTime)dataItem.Value); + } + return SerializeValue(dataItem.Value); }