fix(opcuamaster): 服务端时间戳选项在轮询模式下不生效

This commit is contained in:
Diego
2024-08-21 16:08:13 +08:00
parent 6018f1e8ca
commit 8854322997

View File

@@ -215,9 +215,13 @@ public class OpcUaMaster : CollectBase
{
value = data.Item3;
}
var isGood = StatusCode.IsGood(data.Item2.StatusCode);
var time = data.Item2.SourceTimestamp;
var isGood = StatusCode.IsGood(data.Item2.StatusCode);
DateTime time = default;
if (_driverProperties.SourceTimestampEnable)
{
time = data.Item2.SourceTimestamp.ToLocalTime();
}
if (isGood)
{
item.SetValue(value, time);