This commit is contained in:
2025-01-01 17:59:23 +08:00
parent 7b5df5877d
commit f1cac2fb77
4 changed files with 59 additions and 5 deletions

View File

@@ -895,6 +895,11 @@ namespace CapMachine.Wpf.Services
private OperateResult<short> OperateResultShort { get; set; }
/// <summary>
/// SV数据
/// </summary>
private OperateResult<short> OperateResultSVShort { get; set; }
private Random Random { get; set; } = new Random();
/// <summary>
@@ -975,9 +980,20 @@ namespace CapMachine.Wpf.Services
LinkState = false;
}
}
else
if (!string.IsNullOrEmpty(itemTag.Value.SVAddress))
{
OperateResultSVShort = SiemensDrive.ReadInt16(itemTag.Value.SVAddress);
if (OperateResultSVShort.IsSuccess)
{
TagManger.GetTagInfoValueByName<short>(itemTag.Value.Name)!.Value = OperateResultSVShort.Content;
TagManger.GetTagByName<short>(itemTag.Value.Name).EngSVValue = TagManger.GetTagInfoValueByName<short>(itemTag.Value.Name)!.Value * 1.0 / TagManger.GetTagByName<short>(itemTag.Value.Name)!.Precision;
LinkState = true;
}
else
{
LinkState = false;
}
}
break;
default: