OPCUAClient添加是否使用SourceTime的选项

This commit is contained in:
Kimdiego2098
2023-08-22 16:15:34 +08:00
parent d7b549abb8
commit 4eb9ed8aba
2 changed files with 10 additions and 2 deletions

View File

@@ -257,8 +257,11 @@ public class OPCUAClient : CollectBase
value = data.jToken;
}
var quality = StatusCode.IsGood(data.dataValue.StatusCode);
var time = data.dataValue.SourceTimestamp.ToLocalTime();
DateTime time = default;
if (driverPropertys.SourceTimestampEnable)
{
time = data.dataValue.SourceTimestamp.ToLocalTime();
}
foreach (var item in itemReads)
{
if (item.DataTypeEnum == DataTypeEnum.Object)

View File

@@ -43,6 +43,11 @@ public class OPCUAClientProperty : CollectDriverPropertyBase
[DeviceProperty("安全策略", "True为使用安全策略False为无")]
public bool IsUseSecurity { get; set; } = true;
/// <summary>
/// 是否使用SourceTime
/// </summary>
[DeviceProperty("使用SourceTime", "")]
public bool SourceTimestampEnable { get; set; } = true;
/// <summary>
/// 激活订阅