Browse Source

fix bug in ShareChiller.

zhouhr 1 year ago
parent
commit
273e8dcfae

+ 16 - 0
Venus/Venus_RT/Config/System_VenusSE.sccfg

@@ -456,6 +456,7 @@
 		<configs name="Chiller" nameView="Chiller">
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
 			<!--<config default="false" name="ChillerSameWithPMB" nameView="Chiller Same With PMB" description="enable chiller same with PMB or not" max="1" min="0" tag="" unit="" type="Bool" />-->
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet;3:RS485" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -469,6 +470,7 @@
 		</configs>
 		<configs name="InnerChiller" nameView="InnerChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -482,6 +484,7 @@
 		</configs>
 		<configs name="OuterChiller" nameView="OuterChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -495,6 +498,7 @@
 		</configs>
 		<configs name="TopChiller" nameView="TopChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1098,6 +1102,7 @@
 
 		<configs name="Chiller" nameView="Chiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="false" name="ChillerSameWithPMA" nameView="Chiller Same With PMA" description="enable chiller same with PMA or not" max="1" min="0" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1112,6 +1117,7 @@
 		</configs>
 		<configs name="InnerChiller" nameView="InnerChiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1125,6 +1131,7 @@
 		</configs>
 		<configs name="OuterChiller" nameView="OuterChiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1138,6 +1145,7 @@
 		</configs>
 		<configs name="TopChiller" nameView="TopChiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1745,6 +1753,7 @@
 
 		<configs name="Chiller" nameView="Chiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="false" name="ChillerSameWithPMA" nameView="Chiller Same With PMA" description="enable chiller same with PMA or not" max="1" min="0" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1759,6 +1768,7 @@
 		</configs>
 		<configs name="InnerChiller" nameView="InnerChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1772,6 +1782,7 @@
 		</configs>
 		<configs name="OuterChiller" nameView="OuterChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -1785,6 +1796,7 @@
 		</configs>
 		<configs name="TopChiller" nameView="TopChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -2382,6 +2394,7 @@
 
 		<configs name="Chiller" nameView="Chiller" >
 			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="false" name="ChillerSameWithPMA" nameView="Chiller Same With PMA" description="enable chiller same with PMA or not" max="1" min="0" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -2396,6 +2409,7 @@
 		</configs>
 		<configs name="InnerChiller" nameView="InnerChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -2409,6 +2423,7 @@
 		</configs>
 		<configs name="OuterChiller" nameView="OuterChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -2422,6 +2437,7 @@
 		</configs>
 		<configs name="TopChiller" nameView="TopChiller" >
 			<config default="false" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
+			<config default="00" name="Address" nameView="Address" description="Address" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="false" name="ShareCOM" nameView="Share COM" description="true=>Share COM;false => Not Share" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC; 2, AIRSYS" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />

+ 30 - 1
Venus/Venus_RT/Devices/JetVenusSEPM.cs

@@ -269,6 +269,21 @@ namespace Venus_RT.Devices
                 }
             }
 
+            if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
+                SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS485 &&
+                SC.GetValue<bool>($"{Module}.Chiller.ShareCOM"))
+            {
+                if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
+                {
+                    _Chiller = DEVICE.GetDevice<SMCShareChiller>($"{Module}.{VenusDevice.Chiller}");
+                }
+                else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
+                {
+                    _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
+                }
+            }
+
+
 
             // RS232 AdTec Generator
             if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
@@ -529,7 +544,21 @@ namespace Venus_RT.Devices
 
         public override bool IsHVOn => _ESCHV.IsOn;
 
-        public override float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
+        public override float CoolantInletTempFB
+        {
+            get
+            {
+                switch(SC.GetValue<int>($"{Module}.Chiller.CommunicationType"))
+                {
+                    case (int)CommunicationType.RS232:
+                        return _Chiller.CoolantInletTcFeedback;
+                    case (int)CommunicationType.RS485:
+                        return _Chiller.Temperature;
+                    default:
+                        return 0;
+                }
+            }
+        }
 
         public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
 

+ 28 - 24
Venus/Venus_RT/Devices/SMCChillerDrive.cs

@@ -97,23 +97,9 @@ namespace Venus_RT.Devices
                 }
                 string cmd = obj.Split(new char[] { '\r', '\n' })[0];
 
-                //注意 数据开头有":"
-                //地址位 决定了是哪个chamber的哪个type
-                ChillerData chillerData = null;
-                ModuleName module = ModuleName.System;
-                if (_address2Module.ContainsKey(cmd.Substring(1, 2)) && _addressQuery.ContainsKey(cmd.Substring(1, 2)))
-                {
-                    _addressQuery[cmd.Substring(1, 2)] = chillerData;
-                    module = ModuleHelper.Converter(_address2Module[cmd.Substring(1, 2)].Split('.')[0]);
-                }
-                else
-                {
-                    LOG.Write(eEvent.ERR_DEVICE_CHILLER, ModuleName.System, $"[{_PortNum}]:address => {cmd.Substring(1, 2)} not in Dictionary");
-                    return;
-                }
 
                 //若为system或null 说明dic中无value或value无效
-                Debug.Assert(chillerData != null && module != ModuleName.System);
+                //Debug.Assert(chillerData != null && module != ModuleName.System);
 
                 if (ModbusUtility.CalculateLrc(ModbusUtility.HexToBytes(cmd.Substring(1, cmd.Length - 3))).ToString("X2") !=
                     cmd.Substring(cmd.Length - 2))  //LRC check
@@ -123,11 +109,28 @@ namespace Venus_RT.Devices
                 }
 
 
+                //注意 数据开头有":"
+                //地址位 决定了是哪个chamber的哪个type
+                ModuleName module = ModuleName.System;
+                LOG.Write(eEvent.INFO_DEVICE_CHILLER, ModuleName.System, $"[{_PortNum}] smc chiller receive message {cmd}");
+                string header = cmd.Substring(1, 2);
+                if (_address2Module.ContainsKey(header) && _addressQuery.ContainsKey(header))
+                {
+                    module = ModuleHelper.Converter(_address2Module[header].Split('.')[0]);
+                    //LOG.Write(eEvent.INFO_DEVICE_CHILLER, ModuleName.System, $"[{_PortNum}] smc chiller know module:{_address2Module[cmd.Substring(1, 2)]},{cmd.Substring(1, 2)}");
+                }
+                else
+                {
+                    LOG.Write(eEvent.ERR_DEVICE_CHILLER, ModuleName.System, $"[{_PortNum}]:address => {header} not in Dictionary");
+                    return;
+                }
+
                 switch (cmd.Substring(3, 2))    //function code
                 {
                     case "03":  //返回的寄存器内容
                         if (cmd.Substring(5, 2) == "16")    //返回了全部11个寄存器、22个Byte数据
                         {
+                            ChillerData chillerdata = new ChillerData();
                             for (int iRegisterNo = 0; iRegisterNo < 11; iRegisterNo++)
                             {
                                 string sBuf = cmd.Substring(4 * iRegisterNo + 7, 4);
@@ -140,42 +143,43 @@ namespace Venus_RT.Devices
                                 switch (iRegisterNo)
                                 {
                                     case 0:     //Circulating fluid discharge temperature
-                                        chillerData.ControlTcFeedback = (float)iBuf / 10;
+                                        chillerdata.ControlTcFeedback = (float)iBuf / 10;
                                         break;
                                     case 4:     //Status flag 1
                                         for (int i = 0; i < 16; i++)
                                         {
-                                            chillerData.Statusflag[i] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
+                                            chillerdata.Statusflag[i] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
                                         }
                                         break;
                                     case 5:     //Alarm flag 1
                                         for (int i = 0; i < 16; i++)
                                         {
-                                            chillerData.Alarmflag[i] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
+                                            chillerdata.Alarmflag[i] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
                                         }
                                         break;
                                     case 6:     //Alarm flag 2
                                         for (int i = 0; i < 16; i++)
                                         {
-                                            chillerData.Alarmflag[i + 16] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
+                                            chillerdata.Alarmflag[i + 16] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
                                         }
                                         break;
                                     case 7:     //Alarm flag 3
                                         for (int i = 0; i < 16; i++)
                                         {
-                                            chillerData.Alarmflag[i + 32] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
+                                            chillerdata.Alarmflag[i + 32] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
                                         }
                                         break;
                                     case 9:     //Status flag 2
                                         for (int i = 0; i < 16; i++)
                                         {
-                                            chillerData.Statusflag[i + 16] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
+                                            chillerdata.Statusflag[i + 16] = Convert.ToBoolean((int)Math.Pow(2, i) & iBuf);
                                         }
                                         break;
+
                                 }
                             }
+                            _addressQuery[header] = chillerdata;
                         }
-                        _addressQuery[cmd.Substring(1, 2)] = chillerData;
                         break;
                     case "06":  //寄存器的写成功消息
                         break;
@@ -197,9 +201,9 @@ namespace Venus_RT.Devices
 
         public void SendCmd(string str)
         {
-            //if (Module == "PMB" && SC.GetValue<bool>($"PMB.Chiller.ChillerSameWithPMA") && SC.GetValue<bool>($"PMB.Chiller.EnableChiller")) return;
             //消息通用格式:开头 + 内容 + LRC + 结尾
             //_serial?.Write(":" + str + ModbusUtility.CalculateLrc(ModbusUtility.HexToBytes(str)).ToString("X2") + "\r\n");
+            LOG.Write(eEvent.INFO_DEVICE_CHILLER,ModuleName.System, "Send Cmd => :" + str + ModbusUtility.CalculateLrc(ModbusUtility.HexToBytes(str)).ToString("X2"));
             blockingCollection.Add(":" + str + ModbusUtility.CalculateLrc(ModbusUtility.HexToBytes(str)).ToString("X2") + "\r\n");
         }
 
@@ -219,7 +223,7 @@ namespace Venus_RT.Devices
             else
             {
                 LOG.Write(eEvent.ERR_DEVICE_CHILLER, ModuleName.System, $"[{_PortNum}] => address:{address} not exist");
-                return new ChillerData();
+                return null;
             }
 
         }

+ 24 - 21
Venus/Venus_RT/Devices/SMCShareChiller.cs

@@ -8,6 +8,7 @@ using MECF.Framework.Common.Equipment;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.ServiceModel.Channels;
 using System.Text;
@@ -111,6 +112,14 @@ namespace Venus_RT.Devices
             }
         }
 
+        public override float Temperature
+        {
+            get
+            {
+                return ControlTcFeedback;
+            }
+        }
+
 
         [Subscription(AITChillerProperty.CoolantOutletTempFeedback)]
         public override float CoolantOutletTcFeedback
@@ -146,7 +155,8 @@ namespace Venus_RT.Devices
                     ScaleMax = SetPointLimitMax,
                     ScaleMin = SetPointLimitMin,
                     SetPoint = ControlTcSetPoint,
-                    FeedBack = CoolantOutletTcFeedback,
+                    Temperature = Convert.ToInt16(ControlTcSetPoint),
+                    //FeedBack = CoolantOutletTcFeedback,
                     CoolantInletFeedBack = CoolantInletTcFeedback,
                     CoolantOutletFeedBack = CoolantOutletTcFeedback,
                     Unit = "℃",
@@ -177,16 +187,26 @@ namespace Venus_RT.Devices
             {
                 if (_timerQueryStatus.IsTimeout() && StatusSMC != SMCChillerState.ERROR)
                 {
+                    Stopwatch stopwatch = Stopwatch.StartNew();
+                    stopwatch.Start();
                     _driver.SendCmd(message.GET_ALL);
+                    stopwatch.Stop();
+                    LOG.Write(eEvent.INFO_DEVICE_CHILLER, Module, $"Use Time:{stopwatch.ElapsedMilliseconds}");
                     _timerQueryStatus.Start(CHK_ST_INTERVAL);
                 }
 
-                if (_driver != null)
+                if (_driver != null && _driver.QueryData(_address) != null)
                 {
+                    //LOG.Write(eEvent.INFO_DEVICE_CHILLER,Module,$"Address:{_address},");
                     Statusflag = _driver.QueryData(_address).Statusflag;
                     Alarmflag = _driver.QueryData(_address).Alarmflag;
                     _controlTcFeedback = _driver.QueryData(_address).ControlTcFeedback;
                 }
+                else
+                {
+                    LOG.Write(eEvent.WARN_DEVICE_CHILLER,Module,$"Address:{_address},获取的设备为空或值为空");
+                    return;
+                }
 
 
                 if (Statusflag[0])
@@ -216,23 +236,6 @@ namespace Venus_RT.Devices
                     LastAlarmflag[i] = Alarmflag[i];
                 }
 
-                //if (IsRunning && _scEnableAlarm != null && _scEnableAlarm.BoolValue)
-                //{
-                //    var range = _scAlarmRange.IntValue;
-                //    var time = _scAlarmTime.IntValue;
-                //    _toleranceChecker.Monitor(_controlTcFeedback, _controlTcSetPoint - Math.Abs(range), _controlTcSetPoint + Math.Abs(range), time);
-                //
-                //    if (_toleranceChecker.Trig)
-                //    {
-                //        LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, Display + $" temperature out of tolerance in {time:0} seconds");
-                //    }
-                //}
-                //
-                //else
-                //{
-                //    _toleranceChecker.RST = true;
-                //}
-
             }
             catch (Exception ex)
             {
@@ -256,7 +259,7 @@ namespace Venus_RT.Devices
 
         public override void SetChillerOnOff(bool on)
         {
-            _driver.SendCmd(on ? message.SET_ON : SMCChillerMessage.SET_OFF);
+            _driver.SendCmd(on ? message.SET_ON : message.SET_OFF);
         }
 
         private void SetAlarmMsg()
@@ -360,7 +363,7 @@ namespace Venus_RT.Devices
         }
     }
 
-    public class ChillerFactory
+    public static class ChillerFactory
     {
         private static Dictionary<string, SMCChillerDrive> port2share = new Dictionary<string, SMCChillerDrive>();