更改了报警地址

复位地址
数据记录进行了校验
This commit is contained in:
2025-06-17 18:14:38 +08:00
parent 4cbb3955a4
commit 3fde19855d
15 changed files with 1377 additions and 418 deletions

View File

@@ -214,7 +214,7 @@ namespace CapMachine.Wpf.Services
//转速
TagManger.AddTag(new ShortControlTag()
{
Id = 1,
Id = 10,
Name = "转速[rpm]",
NameNoUnit = "转速",
EnName = "Speed",
@@ -247,7 +247,7 @@ namespace CapMachine.Wpf.Services
//排气压力
TagManger.AddTag(new ShortControlTag()
{
Id = 2,
Id = 20,
Name = "排气压力[BarA]",
NameNoUnit = "排气压力",
EnName = "ExPress",
@@ -277,7 +277,7 @@ namespace CapMachine.Wpf.Services
//吸气压力
TagManger.AddTag(new ShortControlTag()
{
Id = 3,
Id = 30,
Name = "吸气压力[BarA]",
NameNoUnit = "吸气压力",
EnName = "InhPress",
@@ -307,7 +307,7 @@ namespace CapMachine.Wpf.Services
//吸气温度
TagManger.AddTag(new ShortControlTag()
{
Id = 4,
Id = 40,
Name = "吸气温度[℃]",
NameNoUnit = "吸气温度",
EnName = "InhTemp",
@@ -337,7 +337,7 @@ namespace CapMachine.Wpf.Services
//COND1温度
TagManger.AddTag(new ShortControlTag()
{
Id = 5,
Id = 50,
Name = "COND1温度[℃]",
NameNoUnit = "COND1温度",
EnName = "Cond1Temp",
@@ -367,7 +367,7 @@ namespace CapMachine.Wpf.Services
//润滑油压力
TagManger.AddTag(new ShortControlTag()
{
Id = 6,
Id = 60,
Name = "润滑油压力[BarA]",
NameNoUnit = "润滑油压力",
EnName = "LubePress",
@@ -398,7 +398,7 @@ namespace CapMachine.Wpf.Services
//COND2压力
TagManger.AddTag(new ShortControlTag()
{
Id = 7,
Id = 70,
Name = "COND2压力[BarA]",
NameNoUnit = "COND2压力",
EnName = "Cond2Press",
@@ -428,7 +428,7 @@ namespace CapMachine.Wpf.Services
//OCR
TagManger.AddTag(new ShortControlTag()
{
Id = 8,
Id = 80,
Name = "OCR[%]",
NameNoUnit = "OCR",
EnName = "OCR",
@@ -458,7 +458,7 @@ namespace CapMachine.Wpf.Services
//HV
TagManger.AddTag(new ShortControlTag()
{
Id = 9,
Id = 90,
Name = "HV[V]",
NameNoUnit = "HV[V]",
EnName = "HV",
@@ -488,7 +488,7 @@ namespace CapMachine.Wpf.Services
//HV[A] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 10,
Id = 100,
Name = "HV[A]",
NameNoUnit = "HV[A]",
EnName = "HVCur",
@@ -496,8 +496,8 @@ namespace CapMachine.Wpf.Services
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
DecimalPoint = 2,
Precision = 100,
Unit = "A",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW118", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 18 },
@@ -518,7 +518,7 @@ namespace CapMachine.Wpf.Services
//HV[W] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 11,
Id = 110,
Name = "HV[W]",
NameNoUnit = "HV[W]",
EnName = "HVPw",
@@ -548,7 +548,7 @@ namespace CapMachine.Wpf.Services
//LV[V]
TagManger.AddTag(new ShortControlTag()
{
Id = 12,
Id = 120,
Name = "LV[V]",
NameNoUnit = "LV[V]",
EnName = "LV",
@@ -578,7 +578,7 @@ namespace CapMachine.Wpf.Services
//LV[A] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 13,
Id = 130,
Name = "LV[A]",
NameNoUnit = "LV[A]",
EnName = "LVCur",
@@ -586,8 +586,8 @@ namespace CapMachine.Wpf.Services
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
DecimalPoint = 2,
Precision = 100,
Unit = "A",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW124", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 24 },
@@ -608,7 +608,7 @@ namespace CapMachine.Wpf.Services
//环境温度
TagManger.AddTag(new ShortControlTag()
{
Id = 14,
Id = 140,
Name = "环境温度[℃]",
NameNoUnit = "环境温度",
EnName = "EnvTemp",
@@ -638,7 +638,7 @@ namespace CapMachine.Wpf.Services
//环境湿度
TagManger.AddTag(new ShortControlTag()
{
Id = 15,
Id = 150,
Name = "环境湿度[%]",
NameNoUnit = "环境湿度",
EnName = "EnvRH",
@@ -668,7 +668,7 @@ namespace CapMachine.Wpf.Services
//OS1温度
TagManger.AddTag(new ShortControlTag()
{
Id = 16,
Id = 160,
Name = "OS1温度[℃]",
NameNoUnit = "OS1温度",
EnName = "OS1Temp",
@@ -698,7 +698,7 @@ namespace CapMachine.Wpf.Services
//OS2温度
TagManger.AddTag(new ShortControlTag()
{
Id = 17,
Id = 170,
Name = "OS2温度[℃]",
NameNoUnit = "OS2温度",
EnName = "OS2Temp",
@@ -728,7 +728,7 @@ namespace CapMachine.Wpf.Services
//COND2温度
TagManger.AddTag(new ShortControlTag()
{
Id = 18,
Id = 180,
Name = "COND2温度[℃]",
NameNoUnit = "COND2温度",
EnName = "Cond2Temp",
@@ -758,7 +758,7 @@ namespace CapMachine.Wpf.Services
//EVAP出口温度
TagManger.AddTag(new ShortControlTag()
{
Id = 19,
Id = 190,
Name = "EVAP出口温度[℃]",
NameNoUnit = "EVAP出口温度",
EnName = "EVAPExpTemp",
@@ -789,7 +789,7 @@ namespace CapMachine.Wpf.Services
//PTC功率 控制但非仪表控制
TagManger.AddTag(new ShortControlTag()
{
Id = 20,
Id = 200,
Name = "PTC功率[W]",
NameNoUnit = "PTC功率",
EnName = "PTCPw",
@@ -801,7 +801,7 @@ namespace CapMachine.Wpf.Services
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 0, Enable = false },
PVModel = new MeterValueAttrCell() { Address = "VW432", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 332 },
SVModel = new MeterValueAttrCell() { Address = "VW432", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 32 },
MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
@@ -817,10 +817,42 @@ namespace CapMachine.Wpf.Services
RWInfo = RWInfo.Control,
});
//PTC功率2 控制但非仪表控制 -北厂未启用此功能,南厂有此功能
//TagManger.AddTag(new ShortControlTag()
//{
// Id = 201,
// Name = "PTC功率2[W]",
// NameNoUnit = "PTC功率2",
// EnName = "PTCPw2",
// Group = "程序",
// MinValue = 0,
// MaxValue = 10000,
// IsMeter = true,
// DecimalPoint = 1,
// Precision = 1,
// Unit = "W",
// DataType = TagDataType.Short,
// PVModel = new MeterValueAttrCell() { Address = "VW434", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 334},
// SVModel = new MeterValueAttrCell() { Address = "VW434", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 34 },
// MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 1, Enable = false },
// MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
// Pid_PModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// Pid_IModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// Pid_DModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// Limit_UpModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// Limit_DownModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// AlarmModel = new MeterExdAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Enable = false },
// AutoHandState = false,
// RWInfo = RWInfo.Control,
//});
//PTC流量 控制但非仪表控制
TagManger.AddTag(new ShortControlTag()
{
Id = 21,
Id = 210,
Name = "PTC流量[L/min]",
NameNoUnit = "PTC流量",
EnName = "PTCFlow",
@@ -851,7 +883,7 @@ namespace CapMachine.Wpf.Services
//PTC入口水温 控制但非仪表控制
TagManger.AddTag(new ShortControlTag()
{
Id = 22,
Id = 220,
Name = "PTC入口水温[℃]",
NameNoUnit = "PTC入口水温",
EnName = "PTCEntTemp",
@@ -888,7 +920,7 @@ namespace CapMachine.Wpf.Services
//冷媒流量 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 23,
Id = 230,
Name = "冷媒流量[kg/h]",
NameNoUnit = "冷媒流量",
EnName = "VRV",
@@ -907,7 +939,7 @@ namespace CapMachine.Wpf.Services
//润滑油流量 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 24,
Id = 240,
Name = "润滑油流量[kg/h]",
NameNoUnit = "润滑油流量",
EnName = "LubeFlow",
@@ -926,7 +958,7 @@ namespace CapMachine.Wpf.Services
//排气温度 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 25,
Id = 250,
Name = "排气温度[℃]",
NameNoUnit = "排气温度",
EnName = "ExTemp",
@@ -947,7 +979,7 @@ namespace CapMachine.Wpf.Services
//阀前压力P3 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 26,
Id = 260,
Name = "阀前压力P3[BarA]",
NameNoUnit = "阀前压力P3",
EnName = "TxvFrPressP3",
@@ -966,7 +998,7 @@ namespace CapMachine.Wpf.Services
//EVAP出口压力P6 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 27,
Id = 270,
Name = "EVAP出口压力P6[BarA]",
NameNoUnit = "EVAP出口压力P6",
EnName = "EVAPExpPressP6",
@@ -985,7 +1017,7 @@ namespace CapMachine.Wpf.Services
//背压压力P8 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 28,
Id = 280,
Name = "背压压力P8[BarA]",
NameNoUnit = "背压压力P8",
EnName = "BackPressP8",
@@ -1004,7 +1036,7 @@ namespace CapMachine.Wpf.Services
//阀前温度T3 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 29,
Id = 290,
Name = "阀前温度T3[℃]",
NameNoUnit = "阀前温度T3",
EnName = "TxvFrTempT3",
@@ -1023,7 +1055,7 @@ namespace CapMachine.Wpf.Services
//COND1入口温度T4 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 30,
Id = 300,
Name = "COND1入口温度T4[℃]",
NameNoUnit = "COND1入口温度T4",
EnName = "Cond1TempT4",
@@ -1042,7 +1074,7 @@ namespace CapMachine.Wpf.Services
//EVAP出口温度T6 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 31,
Id = 310,
Name = "EVAP出口温度T6[℃]",
NameNoUnit = "EVAP出口温度T6",
EnName = "EVAPExpTempT6",
@@ -1061,7 +1093,7 @@ namespace CapMachine.Wpf.Services
//压缩机表面温度T11 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 32,
Id = 320,
Name = "压缩机表面温度T11[℃]",
NameNoUnit = "压缩机表面温度T11",
EnName = "CapSufTempT11",
@@ -1081,7 +1113,7 @@ namespace CapMachine.Wpf.Services
//Qcool 计算 制冷量
TagManger.AddTag(new ShortValueTag()
{
Id = 33,
Id = 330,
Name = "制冷量[W]",
NameNoUnit = "制冷量",
EnName = "Qcool",
@@ -1101,7 +1133,7 @@ namespace CapMachine.Wpf.Services
//Qcool_Customer 计算
TagManger.AddTag(new ShortValueTag()
{
Id = 34,
Id = 340,
Name = "制热量[W]",
NameNoUnit = "制热量",
EnName = "Qheat",
@@ -1141,7 +1173,7 @@ namespace CapMachine.Wpf.Services
//COP_Cooling_5K 计算
TagManger.AddTag(new ShortValueTag()
{
Id = 36,
Id = 360,
Name = "制冷性能系数[W]",
NameNoUnit = "制冷性能系数",
EnName = "COPCooling",
@@ -1181,7 +1213,7 @@ namespace CapMachine.Wpf.Services
//COP_Heating 计算 制热性能系数
TagManger.AddTag(new ShortValueTag()
{
Id = 38,
Id = 380,
Name = "制热性能系数[W]",
NameNoUnit = "制热性能系数",
EnName = "COPHeating",
@@ -1201,7 +1233,7 @@ namespace CapMachine.Wpf.Services
//VolumeEfficiency 计算 容积效率
TagManger.AddTag(new ShortValueTag()
{
Id = 39,
Id = 390,
Name = "容积效率[%]",
NameNoUnit = "容积效率",
EnName = "VolumeEfficiency",
@@ -1221,7 +1253,7 @@ namespace CapMachine.Wpf.Services
//IsentropyEfficiency 计算 等熵效率
TagManger.AddTag(new ShortValueTag()
{
Id = 40,
Id = 400,
Name = "等熵效率[%]",
NameNoUnit = "等熵效率",
EnName = "IsentropyEfficiency",
@@ -1263,7 +1295,7 @@ namespace CapMachine.Wpf.Services
// 过冷度 计算
TagManger.AddTag(new CalcTag()
{
Id = 42,
Id = 420,
Name = "过冷度[K]",
NameNoUnit = "过冷度",
EnName = "Subcooling",
@@ -1282,7 +1314,7 @@ namespace CapMachine.Wpf.Services
// 过热度 计算
TagManger.AddTag(new CalcTag()
{
Id = 43,
Id = 430,
Name = "过热度[K]",
NameNoUnit = "过热度",
EnName = "Superheat",
@@ -1301,7 +1333,7 @@ namespace CapMachine.Wpf.Services
// 干度 计算
TagManger.AddTag(new CalcTag()
{
Id = 44,
Id = 440,
Name = "干度[%]",
NameNoUnit = "干度",
EnName = "Dryness",
@@ -1325,7 +1357,7 @@ namespace CapMachine.Wpf.Services
// 通讯母线电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 45,
Id = 450,
Name = "通讯母线电流[A]",
NameNoUnit = "通讯母线电流",
EnName = "ComCapBusCur",
@@ -1344,7 +1376,7 @@ namespace CapMachine.Wpf.Services
// 通讯母线电压 压缩机
TagManger.AddTag(new CapTag()
{
Id = 46,
Id = 460,
Name = "通讯母线电压[V]",
NameNoUnit = "通讯母线电压",
EnName = "ComCapBusCur",
@@ -1363,7 +1395,7 @@ namespace CapMachine.Wpf.Services
// 通讯相电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 47,
Id = 470,
Name = "通讯相电流[A]",
NameNoUnit = "通讯相电流",
EnName = "ComCapPhCur",
@@ -1382,7 +1414,7 @@ namespace CapMachine.Wpf.Services
// 通讯功率 压缩机
TagManger.AddTag(new CapTag()
{
Id = 48,
Id = 480,
Name = "通讯功率[W]",
NameNoUnit = "通讯功率",
EnName = "ComCapPw",
@@ -1401,7 +1433,7 @@ namespace CapMachine.Wpf.Services
// 通讯逆变器温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 49,
Id = 490,
Name = "通讯逆变器温度[℃]",
NameNoUnit = "通讯逆变器温度",
EnName = "ComCapInverterTemp",
@@ -1420,7 +1452,7 @@ namespace CapMachine.Wpf.Services
// 通讯芯片温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 50,
Id = 500,
Name = "通讯芯片温度[℃]",
NameNoUnit = "通讯芯片温度",
EnName = "ComCapChipTemp",
@@ -1444,7 +1476,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC入水温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 51,
Id = 510,
Name = "通讯PTC入水温度[℃]",
NameNoUnit = "通讯PTC入水温度",
EnName = "CapPTCInWaterTemp",
@@ -1464,7 +1496,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC出水温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 52,
Id = 520,
Name = "通讯PTC出水温度[℃]",
NameNoUnit = "通讯PTC出水温度",
EnName = "CapPTCOutWaterTemp",
@@ -1484,7 +1516,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC峰值电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 53,
Id = 530,
Name = "通讯PTC峰值电流[A]",
NameNoUnit = "通讯PTC峰值电流",
EnName = "CapPTCPeakCur",
@@ -1504,7 +1536,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC母线电流
TagManger.AddTag(new CapTag()
{
Id = 54,
Id = 540,
Name = "通讯PTC母线电流[A]",
NameNoUnit = "通讯PTC母线电流",
EnName = "CapPTCBusCur",
@@ -1524,7 +1556,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC膜温 压缩机
TagManger.AddTag(new CapTag()
{
Id = 55,
Id = 550,
Name = "通讯PTC膜温[℃]",
NameNoUnit = "通讯PTC膜温",
EnName = "CapPTCFilmTemp",
@@ -1544,7 +1576,7 @@ namespace CapMachine.Wpf.Services
// 通讯PTC功率模块温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 56,
Id = 560,
Name = "通讯PTC功率模块温度[℃]",
NameNoUnit = "通讯PTC功率模块温度",
EnName = "CapPTCPwMdTemp",
@@ -2210,35 +2242,35 @@ namespace CapMachine.Wpf.Services
ListHandSwitchData = new List<HandSwitchData>()
{
new HandSwitchData(){Name="自动",ActionAddress="M0.0",StateAddress="M0.0" },
new HandSwitchData(){Name="抽真空",ActionAddress="M0.3",StateAddress="V9.0" },
//new HandSwitchData(){Name="复位",ActionAddress="M0.7",StateAddress="M0.7" },放到上侧的按钮区域了
//new HandSwitchData(){Name="消音",ActionAddress="M0.3",StateAddress="M0.3" },放到上侧的按钮区域了
new HandSwitchData(){Name="HV电源",ActionAddress="M1.1",StateAddress="Q0.1" },
new HandSwitchData(){Name="HV启动",ActionAddress="M1.2",StateAddress="Q2.0" },
new HandSwitchData(){Name="LV电源",ActionAddress="M1.3",StateAddress="Q0.2" },
new HandSwitchData(){Name="LV启动",ActionAddress="M1.4",StateAddress="M1.4" },//VW30=1
new HandSwitchData(){Name="自动",ActionAddress="M0.0",StateAddress="M0.0",StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="抽真空",ActionAddress="M0.3",StateAddress="V9.0" ,StateAddressType=HandSwitchStateType.Bool },
//new HandSwitchData(){Name="复位",ActionAddress="M0.7",StateAddress="M0.7" ,StateAddressType=HandSwitchStateType.Bool },放到上侧的按钮区域了
//new HandSwitchData(){Name="消音",ActionAddress="M0.3",StateAddress="M0.3" ,StateAddressType=HandSwitchStateType.Bool },放到上侧的按钮区域了
new HandSwitchData(){Name="HV电源",ActionAddress="M1.1",StateAddress="Q0.1" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="HV启动",ActionAddress="M1.2",StateAddress="Q2.0" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="LV电源",ActionAddress="M1.3",StateAddress="Q0.2" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="LV启动",ActionAddress="M1.4",StateAddress="VW30" ,StateAddressType=HandSwitchStateType.Word },//VW30=1
new HandSwitchData(){Name="P1水泵",ActionAddress="M1.5",StateAddress="Q0.3" },
new HandSwitchData(){Name="P2水泵",ActionAddress="M1.6",StateAddress="Q0.4" },
new HandSwitchData(){Name="P1水泵",ActionAddress="M1.5",StateAddress="Q0.3" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="P2水泵",ActionAddress="M1.6",StateAddress="Q0.4" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="OS1加热器",ActionAddress="M1.7",StateAddress="Q0.5" },
new HandSwitchData(){Name="OS2加热器",ActionAddress="M2.0",StateAddress="Q0.6" },
new HandSwitchData(){Name="OS1加热器",ActionAddress="M1.7",StateAddress="Q0.5" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="OS2加热器",ActionAddress="M2.0",StateAddress="Q0.6" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="COND2加热器",ActionAddress="M2.1",StateAddress="Q0.7" },
new HandSwitchData(){Name="EVAP加热器",ActionAddress="M2.2",StateAddress="Q1.0" },
new HandSwitchData(){Name="HCV1",ActionAddress="M2.3",StateAddress="Q1.1" },
new HandSwitchData(){Name="HCV2",ActionAddress="M2.4",StateAddress="Q1.7" },
new HandSwitchData(){Name="HCV3",ActionAddress="M2.5",StateAddress="Q1.2" },
new HandSwitchData(){Name="HCV4",ActionAddress="M2.6",StateAddress="Q1.3" },
new HandSwitchData(){Name="COND2加热器",ActionAddress="M2.1",StateAddress="Q0.7" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="EVAP加热器",ActionAddress="M2.2",StateAddress="Q1.0" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="HCV1",ActionAddress="M2.3",StateAddress="Q1.1" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="HCV2",ActionAddress="M2.4",StateAddress="Q1.7" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="HCV3",ActionAddress="M2.5",StateAddress="Q1.2" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="HCV4",ActionAddress="M2.6",StateAddress="Q1.3" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="EV1",ActionAddress="M2.7",StateAddress="Q1.4" },
new HandSwitchData(){Name="EV2",ActionAddress="M3.0",StateAddress="Q1.5" },
new HandSwitchData(){Name="EV3",ActionAddress="M3.1",StateAddress="Q1.6" },
new HandSwitchData(){Name="EV4",ActionAddress="M3.2",StateAddress="Q2.1" },
new HandSwitchData(){Name="试验箱",ActionAddress="M3.3",StateAddress="M3.3" },//VW32=1
new HandSwitchData(){Name="吸排气球阀",ActionAddress="M3.4",StateAddress="Q2.3" },
new HandSwitchData(){Name="使能",ActionAddress="M3.5",StateAddress="V9.1" },
new HandSwitchData(){Name="EV1",ActionAddress="M2.7",StateAddress="Q1.4" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="EV2",ActionAddress="M3.0",StateAddress="Q1.5" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="EV3",ActionAddress="M3.1",StateAddress="Q1.6" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="EV4",ActionAddress="M3.2",StateAddress="Q2.1" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="试验箱",ActionAddress="M3.3",StateAddress="VW32" ,StateAddressType=HandSwitchStateType.Word },//VW32=1
new HandSwitchData(){Name="吸排气球阀",ActionAddress="M3.4",StateAddress="Q2.3" ,StateAddressType=HandSwitchStateType.Bool },
new HandSwitchData(){Name="使能",ActionAddress="M3.5",StateAddress="V9.1" ,StateAddressType=HandSwitchStateType.Bool },
};
ListPlcExdConfigCell = new List<PlcExdConfigCell>()
@@ -2251,28 +2283,6 @@ namespace CapMachine.Wpf.Services
};
//TagManger.ListTag[0].Name = "new TestType() { byteValue=12}";
//TagManger.ListTag[0].Name = "new TestType() { byteValue=12}";
//Type genericType = typeof(Tag<>).MakeGenericType(typeof(short));
//Activator.CreateInstance(genericType, 42);
//var DATA = TagManger.GetTagValueByName<short>("转速");
//var data1 = TagManger.GetTagByName<short>("转速");
//var data2 = TagManger.GetTagByName<short>("转速5888");
//data1.TagValue.Value = 12;
//TagInfo = data1;
//var TagInfo1= data1.RtValue.Value;
//var Data = DATA.Value;
//dynamic dad=10;
InitialPLCCom();
//拓展的参数信息
@@ -2295,7 +2305,7 @@ namespace CapMachine.Wpf.Services
/// <returns></returns>
public bool SysReset()
{
SiemensDrive.Write("M0.7", true);
return true;
@@ -2571,44 +2581,44 @@ namespace CapMachine.Wpf.Services
try
{
////第一次计时
//// 第一次计时
//stopwatch.Start(); //启动Stopwatch
//CANLIN数据读取到TagManger.DicTags数据中心中上面的操作是itemWrite反写到PLC中
foreach (var itemCanLinGroup in TagManger.DicTags)
{
//转速特殊处理因为在数据集合中叫做【转速】在CANLIN中叫做【通讯转速】
if (itemCanLinGroup.Value.NameNoUnit == "转速")
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
//通信转速 Dbc中间配置名称的转速数据读取出来 给PLC 取消XXX
if (TagManger.TryGetPVModel(itemCanLinGroup.Key, out MeterValueAttrCell? CanpVModel))
{
CanpVModel!.EngValue = CanDriveService.GetDbcSpeedValueBySpeedName("通讯转速");
SiemensDrive.Write(CanpVModel!.Address, (short)CanDriveService.GetDbcSpeedValueBySpeedName("通讯转速"));
//pVModel.EngSrcValue = 0;
}
break;
case CanLinEnum.Lin:
//通信转速 Dbc中间配置名称的转速数据读取出来 给PLC 取消XXX
if (TagManger.TryGetPVModel(itemCanLinGroup.Key, out MeterValueAttrCell? LinpVModel))
{
LinpVModel!.EngValue = LinDriveService.GetLdfSpeedValueBySpeedName("通讯转速");
SiemensDrive.Write(LinpVModel!.Address, (short)LinDriveService.GetLdfSpeedValueBySpeedName("通讯转速"));
}
break;
default:
break;
}
//找到后继续下一个
continue;
}
//只处理CANLIN的数据
if (itemCanLinGroup.Value.Group == "CANLIN")
{
//转速特殊处理因为在数据集合中叫做【转速】在CANLIN中叫做【通讯转速】
if (itemCanLinGroup.Value.NameNoUnit == "转速")
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
//通信转速 Dbc中间配置名称的转速数据读取出来 给PLC 取消XXX
if (TagManger.TryGetPVModel(itemCanLinGroup.Key, out MeterValueAttrCell? CanpVModel))
{
CanpVModel!.EngValue = CanDriveService.GetDbcSpeedValueBySpeedName("通讯转速");
SiemensDrive.Write(CanpVModel!.Address, (short)CanDriveService.GetDbcSpeedValueBySpeedName("通讯转速"));
//pVModel.EngSrcValue = 0;
}
break;
case CanLinEnum.Lin:
//通信转速 Dbc中间配置名称的转速数据读取出来 给PLC 取消XXX
if (TagManger.TryGetPVModel(itemCanLinGroup.Key, out MeterValueAttrCell? LinpVModel))
{
LinpVModel!.EngValue = LinDriveService.GetLdfSpeedValueBySpeedName("通讯转速");
SiemensDrive.Write(LinpVModel!.Address, (short)LinDriveService.GetLdfSpeedValueBySpeedName("通讯转速"));
}
break;
default:
break;
}
//找到后继续下一个
continue;
}
//尝试获取模型信息
if (TagManger.TryGetPVModel(itemCanLinGroup.Key, out MeterValueAttrCell? pVModel))
{
@@ -2637,7 +2647,7 @@ namespace CapMachine.Wpf.Services
}
//PV批量读取
OperateResultBlockPVRead = SiemensDrive.Read("VW100", 200);
OperateResultBlockPVRead = SiemensDrive.Read("VW100", 700);
if (OperateResultBlockPVRead.IsSuccess)
{
foreach (var itemBlockReadTag in TagManger.DicTags)
@@ -2726,7 +2736,7 @@ namespace CapMachine.Wpf.Services
//stopwatch.Reset();
//读取报警信息 取消报警XXX
OperateResultAlarm = SiemensDrive.ReadBool("V0.0", 15);
OperateResultAlarm = SiemensDrive.ReadBool("V0.1", 20);
if (OperateResultAlarm.IsSuccess)
{
foreach (var item in AlarmService.ListAlarmRunCell)
@@ -2735,33 +2745,48 @@ namespace CapMachine.Wpf.Services
}
}
//循环读取手自动切换 取消XXX
//循环读取手自动切换
foreach (var item in ListHandSwitchData)
{
item.StateOperateResult = SiemensDrive.ReadBool(item.StateAddress);
if (item.StateOperateResult.IsSuccess)
switch (item.StateAddressType)
{
item.State = item.StateOperateResult.Content;
//根据PLC得到执行的步骤数据更新到CAN和LIN的数据压缩的使能时来自于程序的步骤配置不再接受PLC的指令数据
//if (item.Name!.Equals("使能"))
//{
// switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
// {
// case CanLinEnum.Can:
// //获取PLC的使能状态更新到CAN的使能状态
// CanDriveService.UpdateCapEnableCmdData(item.State);
// //itemTag.Value.EngPvValue = 0;
// break;
// case CanLinEnum.Lin:
// //获取PLC的使能状态更新到LIN的使能状态
// LinDriveService.UpdateCapEnableCmdData(item.State);
// //itemTag.Value.EngPvValue = 0;
// break;
// default:
// break;
// }
//}
case HandSwitchStateType.Bool:
item.StateBoolOperateResult = SiemensDrive.ReadBool(item.StateAddress);
if (item.StateBoolOperateResult.IsSuccess)
{
item.State = item.StateBoolOperateResult.Content;
//根据PLC得到执行的步骤数据更新到CAN和LIN的数据压缩的使能时来自于程序的步骤配置不再接受PLC的指令数据
//if (item.Name!.Equals("使能"))
//{
// switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
// {
// case CanLinEnum.Can:
// //获取PLC的使能状态更新到CAN的使能状态
// CanDriveService.UpdateCapEnableCmdData(item.State);
// //itemTag.Value.EngPvValue = 0;
// break;
// case CanLinEnum.Lin:
// //获取PLC的使能状态更新到LIN的使能状态
// LinDriveService.UpdateCapEnableCmdData(item.State);
// //itemTag.Value.EngPvValue = 0;
// break;
// default:
// break;
// }
//}
}
break;
case HandSwitchStateType.Word:
item.StateShortOperateResult = SiemensDrive.ReadInt16(item.StateAddress);
if (item.StateShortOperateResult.IsSuccess)
{
item.State = item.StateShortOperateResult.Content == 0 ? false : true;
}
break;
default:
break;
}
}
@@ -3064,9 +3089,19 @@ namespace CapMachine.Wpf.Services
foreach (var itemStepExd in ProRunChannelData.ListStepExd)
{
//压缩机使能的参数直接给压缩机触发
if (itemStepExd.Name.Contains("压缩机使能"))
if (itemStepExd.Name!.Contains("压缩机使能"))
{
CanDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value);
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
CanDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
break;
case CanLinEnum.Lin:
LinDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value!);
break;
default:
break;
}
continue;
}
@@ -3076,11 +3111,11 @@ namespace CapMachine.Wpf.Services
switch (itemStepExd.ValueType)
{
case ExdValueType.Bool:
var ResultBool = SiemensDrive.Write(DataAdrees.Address, (bool)itemStepExd.Value == true ? 1 : 0);
var ResultBool = SiemensDrive.Write(DataAdrees.Address, (bool)itemStepExd.Value! == true ? 1 : 0);
if (!ResultBool.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:{itemStepExd.Name}写入失败");
break;
case ExdValueType.Short:
var ResultShort = SiemensDrive.Write(DataAdrees.Address, (short)itemStepExd.Value);
var ResultShort = SiemensDrive.Write(DataAdrees.Address, (short)itemStepExd.Value!);
if (!ResultShort.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:{itemStepExd.Name}写入失败");
break;
case ExdValueType.Double:
@@ -3094,27 +3129,27 @@ namespace CapMachine.Wpf.Services
}
if (ProRunChannelData.RunStepType == RunStepType.SlopCell)
{
//SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
//Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// $"【参数名称】:{ProRunChannelData.MeterName} " +
// $"【程序Seg】{ProRunChannelData.ProSegName} " +
// $"【程序步骤】{ProRunChannelData.MeterStep} " +
// $"【斜坡打点步骤】{ProRunChannelData.SlopStepNo} " +
// $"【斜坡打点值SV】{ProRunChannelData.SV} " +
// $"【Msg】接受到仿真写入PLC OK ");
}
else
{
//SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
//Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// $"【参数名称】:{ProRunChannelData.MeterName} " +
// $"【程序Seg】{ProRunChannelData.ProSegName} " +
// $"【程序步骤】{ProRunChannelData.MeterStep} " +
// $"【步骤SV】{ProRunChannelData.SV} " +
// $"【Msg】接受到步骤仿真写入PLC OK ");
}
//if (ProRunChannelData.RunStepType == RunStepType.SlopCell)
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【斜坡打点步骤】{ProRunChannelData.SlopStepNo} " +
// // $"【斜坡打点值SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到仿真写入PLC OK ");
//}
//else
//{
// //SiemensDrive.Write("D1", (short)ProRunChannelData.SV);
// //Console.WriteLine($"【时间】{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} " +
// // $"【参数名称】:{ProRunChannelData.MeterName} " +
// // $"【程序Seg】{ProRunChannelData.ProSegName} " +
// // $"【程序步骤】{ProRunChannelData.MeterStep} " +
// // $"【步骤SV】{ProRunChannelData.SV} " +
// // $"【Msg】接受到步骤仿真写入PLC OK ");
//}
//Thread.Sleep(50);
@@ -3139,7 +3174,7 @@ namespace CapMachine.Wpf.Services
{
CanDriveService.UpdateSpeedCmdData(SpeedSv);
}
//itemTag.Value.EngPvValue = 0;
break;
case CanLinEnum.Lin: