Add IEC Date VarType support to PLCHelpers.cs

This commit is contained in:
Dawid Pągowski
2023-08-23 00:38:24 +02:00
parent eb1fad9333
commit a55ceba679

View File

@@ -244,6 +244,15 @@ namespace S7.Net
{
return TimeSpan.ToArray(bytes);
}
case VarType.Date:
if (varCount == 1)
{
return Date.FromByteArray(bytes);
}
else
{
return Date.ToArray(bytes);
}
default:
return null;
}
@@ -273,6 +282,7 @@ namespace S7.Net
case VarType.Timer:
case VarType.Int:
case VarType.Counter:
case VarType.Date:
return varCount * 2;
case VarType.DWord:
case VarType.DInt: