diff --git a/CapMachine.Wpf/Models/Tag/TagManager.cs b/CapMachine.Wpf/Models/Tag/TagManager.cs
index e0d33c7..3401d43 100644
--- a/CapMachine.Wpf/Models/Tag/TagManager.cs
+++ b/CapMachine.Wpf/Models/Tag/TagManager.cs
@@ -116,6 +116,42 @@ namespace CapMachine.Wpf.Models.Tag
}
+ ///
+ /// ******* 从ShortValueTag中获取PVModel模型-定制的 ********
+ /// 需要提前知道这个标签是CapTag标签,否则为空
+ /// 尝试获取CapTag标签的PVModel模型
+ /// 压缩机通信的标签
+ ///
+ /// 标签名称
+ /// 输出的pVModel模型,如果获取失败则为null
+ /// 是否成功获取PV模型
+ public bool TryGetCapPVModelByShortValueTag(string tagName, out MeterValueAttrCell? pVModel)
+ {
+ lock (PvLock)
+ {
+ pVModel = null;
+
+ if (string.IsNullOrEmpty(tagName))
+ return false;
+
+ // 尝试从字典中获取标签
+ if (DicTags.TryGetValue(tagName, out var tag))
+ {
+ // 尝试将标签转换为ShortValueTag
+ if (tag is ShortValueTag capTag)
+ {
+ pVModel = capTag.PVModel;
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+
+ }
+
+
+
///
/// 尝试获取标签的PVModel模型
diff --git a/CapMachine.Wpf/Services/MachineRtDataService.cs b/CapMachine.Wpf/Services/MachineRtDataService.cs
index 98718ba..b03ff0a 100644
--- a/CapMachine.Wpf/Services/MachineRtDataService.cs
+++ b/CapMachine.Wpf/Services/MachineRtDataService.cs
@@ -1413,7 +1413,7 @@ namespace CapMachine.Wpf.Services
while (ThreadEnable)
{
- await Task.Delay(20);
+ await Task.Delay(100);
//await Task.CompletedTask;
DiagnosticsTime.Reset();
@@ -1467,7 +1467,7 @@ namespace CapMachine.Wpf.Services
if (itemCanLinGroup.Value.Group == "压缩机")
{
//尝试获取模型信息
- if (TagManger.TryGetCapPVModel(itemCanLinGroup.Key, out QuickAttrCell? pVModel))
+ if (TagManger.TryGetCapPVModelByShortValueTag(itemCanLinGroup.Key, out MeterValueAttrCell? pVModel))
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
@@ -1490,6 +1490,7 @@ namespace CapMachine.Wpf.Services
SiemensDrive.Write(pVModel!.Address!.Replace("W", ""), (short)(LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit) * itemCanLinGroup.Value.Precision));
break;
case CanLinEnum.No:
+
break;
default:
break;