using AutoMapper.Internal;
using CapMachine.Core;
using CapMachine.Wpf.ChannelModel;
using CapMachine.Wpf.Dtos;
using CapMachine.Wpf.Models;
using CapMachine.Wpf.Models.ProModelPars;
using CapMachine.Wpf.Models.Tag;
using CapMachine.Wpf.Models.Tag.Cell;
using CapMachine.Wpf.PPCalculation;
using CapMachine.Wpf.PrismEvent;
using HslCommunication;
using HslCommunication.Profinet.Melsec;
using HslCommunication.Profinet.Siemens;
using MathNet.Numerics;
using Prism.Events;
using Prism.Mvvm;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using static CapMachine.Wpf.Models.ComEnum;
namespace CapMachine.Wpf.Services
{
///
/// 机器实时数据服务
///
public class MachineRtDataService : BindableBase
{
///
/// 事件聚合器
///
private IEventAggregator _EventAggregator { get; set; }
public AlarmService AlarmService { get; }
public ConfigService ConfigService { get; }
public LogicRuleService LogicRuleService { get; }
public CanDriveService CanDriveService { get; }
public LinDriveService LinDriveService { get; }
public SysRunService SysRunService { get; }
///
/// PLCScanTask扫描Task
///
private static Task PLCScanTask { get; set; }
///
/// ScanTask扫描Task
///
private static Task ScanTask { get; set; }
///
/// 西门子连接驱动程序
///
public SiemensS7Net SiemensDrive { get; set; }
///
/// 三菱连接驱动程序
///
public MelsecMcNet MelsecMcNetDrive { get; set; }
private bool _LinkState;
///
/// PLC连接状态
///
public bool LinkState
{
get { return _LinkState; }
set { _LinkState = value; RaisePropertyChanged(); }
}
///
/// 周期定时器
///
private System.Timers.Timer CycleTimer { get; set; }
///
/// 界面更新数据
///
private bool IsValueShow { get; set; } = true;
///
/// 系统拓展数据
///
public SysExdInfo CurSysExdInfo { get; set; }
///
/// 布尔拓展信息
///
public SysExdBoolInfo SysExdBoolInfos { get; set; }
/////
///// Tag数据集合
/////
//public List ListRtDataModel { get; set; }
///
/// PLC加载配置数据集合
///
public List ListPlcLoadConfigCell { get; set; }
///
/// PLC加载配置拓展数据集合
///
public List ListPlcExdConfigCell { get; set; }
///
/// 标签管理中心
///
public TagManager TagManger { get; set; } = new TagManager();
///
/// 扫描线程使能
///
public bool ThreadEnable { get; set; } = true;
///
/// 历史数据
///
public List HistoryData { get; set; } = new List();
///
/// 手自动切换的条件
///
public AutoHandSwtichCondition AutoHandSwtichConditionState { get; set; } = new AutoHandSwtichCondition();
///
/// 实例化函数
///
///
public MachineRtDataService(IEventAggregator eventAggregator, AlarmService alarmService, ConfigService configService, LogicRuleService logicRuleService,
CanDriveService canDriveService, LinDriveService linDriveService, SysRunService sysRunService)//, AlarmService alarmService
{
//ConcurrentDictionary keyValuePairs = new ConcurrentDictionary();
//Stopwatch stopwatch = new Stopwatch();
////第一次计时
//stopwatch.Start(); //启动Stopwatch
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.ToString());
//事件服务
_EventAggregator = eventAggregator;
AlarmService = alarmService;
ConfigService = configService;
LogicRuleService = logicRuleService;
CanDriveService = canDriveService;
LinDriveService = linDriveService;
SysRunService = sysRunService;
//秒触发一次
CycleTimer = new System.Timers.Timer(500);
CycleTimer.Elapsed += RecoredCycleAction;
CycleTimer.AutoReset = true;
CycleTimer.Enabled = true;
#region 标签管理
////三电 Sample
//TagManger.AddTag(new Tag("转速", "转速[rpm]", "Speed", "程序", "VW15000", 100, 0, 1, "rpm", new ShortTagValue(), true) { DecimalPoint = 0, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("排气压力", "排气压力[BarA]", "ExPress", "程序", "VW15002", 100, 0, 100, "BarA", new ShortTagValue(), true) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("吸气压力", "吸气压力[BarA]", "InhPress", "程序", "VW15004", 100, 0, 100, "BarA", new ShortTagValue(), true) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("吸气温度", "吸气温度[℃]", "InhTemp", "程序", "VW15006", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("COND1温度", "COND1温度[℃]", "Cond1Temp", "程序", "VW15008", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("润滑油压力", "润滑油压力[BarA]", "LubePress", "程序", "VW15010", 100, 0, 100, "BarA", new ShortTagValue(), true) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("COND2压力", "COND2压力[BarA]", "Cond2Press", "程序", "VW15012", 100, 0, 100, "BarA", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("OCR", "OCR[%]", "OCR", "程序", "VW15014", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("HV[V]", "HV[V]", "HV", "程序", "VW15016", 100, 0, 10, "V", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("HV[A]", "HV[A]", "HVCur", "程序", "VW15018", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = false });
//TagManger.AddTag(new Tag("HV[W]", "HV[W]", "HVPw", "程序", "VW15020", 100, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("LV[V]", "LV[V]", "LV", "程序", "VW15022", 100, 0, 10, "V", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
////TagManger.AddTag(new Tag("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("环境温度", "环境温度[℃]", "EnvTemp", "程序", "VW15026", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
////TagManger.AddTag(new Tag("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("OS1温度", "OS1温度[℃]", "OS1Temp", "程序", "VW15030", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("OS2温度", "OS2温度[℃]", "OS2Temp", "程序", "VW15032", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("COND2温度", "COND2温度[℃]", "Cond2Temp", "程序", "VW15034", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("EVAP出口温度", "EVAP出口温度[℃]", "EVAPExpTemp", "程序", "VW15036", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
////TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("润滑油流量", "润滑油流量[L/min]", "LubeFlow", "程序", "VW15040", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("排气温度", "排气温度[℃]", "ExTemp", "程序", "VW15042", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("膨胀阀前压力", "膨胀阀前压力[BarA]", "TxvFrPress", "程序", "VW15044", 100, 0, 100, "BarA", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("膨胀阀前温度", "膨胀阀前温度[℃]", "TxvFrTemp", "程序", "VW15046", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("EVAP出口压力", "EVAP出口压力[BarA]", "EVAPExpPress", "程序", "VW15048", 100, 0, 100, "BarA", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("腔内压力", "腔内压力[BarA]", "IntrplPress", "程序", "VW15050", 100, 0, 100, "BarA", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("压缩机表面温度", "压缩机表面温度[℃]", "CapSurfTemp", "程序", "VW15052", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("PTC流量", "PTC流量[L/min]", "PTCFlow", "程序", "VW15054", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("PTC入水温度", "PTC入水温度[℃]", "PTCEntTemp", "程序", "VW15056", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("PTC出水温度", "PTC出水温度[℃]", "PTCExpTemp", "程序", "VW15058", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = true, SVAddress = "VW5", Pid_PAddress = "VW0", Pid_IAddress = "VW1", Pid_DAddress = "VW2", Limit_UpAddress = "VW3", Limit_DownAddress = "VW4" });
//TagManger.AddTag(new Tag("通讯Cmp母线电流", "通讯Cmp母线电流[A]", "ComCapBusCur", "程序", "VW15060", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2, IsMeter = false });
//TagManger.AddTag(new Tag("通讯Cmp母线电压", "通讯Cmp母线电压[V]", "ComCapBusVol", "程序", "VW15062", 100, 0, 10, "V", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯Cmp逆变器温度", "通讯Cmp逆变器温度[℃]", "ComCapInvTemp", "程序", "VW15064", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0, IsMeter = false });
//TagManger.AddTag(new Tag("通讯Cmp相电流", "通讯Cmp相电流[A]", "ComCapPhCur", "程序", "VW15066", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯Cmp功率", "通讯Cmp功率[W]", "ComCapPw", "程序", "VW15068", 100, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯Cmp芯片温度", "通讯Cmp芯片温度[℃]", "ComCapChipTemp", "程序", "VW15070", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC入水温度", "通讯PTC入水温度[℃]", "ComPTCEntTemp", "程序", "VW15072", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC出水温度", "通讯PTC出水温度[℃]", "ComPTCExpTemp", "程序", "VW15074", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC峰值电流", "通讯PTC峰值电流[A]", "ComPTCPeakCur", "程序", "VW15076", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC母线电流", "通讯PTC母线电流[A]", "ComPTCBusCur", "程序", "VW15078", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC膜温", "通讯PTC膜温[℃]", "ComPTCFlmTemp", "程序", "VW15080", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0, IsMeter = false });
//TagManger.AddTag(new Tag("通讯PTC模块温度", "通讯PTC模块温度[℃]", "ComPTCMdTemp", "程序", "VW15082", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0, IsMeter = false });
//转速
TagManger.AddTag(new ShortControlTag()
{
Id = 1,
Name = "转速[rpm]",
NameNoUnit = "转速",
EnName = "Speed",
Group = "程序",
MinValue = 0,
MaxValue = 12000,
IsMeter = true,
DecimalPoint = 0,
Precision = 1,
Unit = "rpm",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW100", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 0 },
SVModel = new MeterValueAttrCell() { Address = "VW400", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 0 },
MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 0, Enable = false },
MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "MVAM", BlockIndex = 1, Enable = false },
//AutoHandSwitchAddress = "",//仪表不控制转速,PC直接控制转速
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,
});
//排气压力
TagManger.AddTag(new ShortControlTag()
{
Id = 2,
Name = "排气压力[BarA]",
NameNoUnit = "排气压力",
EnName = "ExPress",
Group = "程序",
MinValue = 0,
MaxValue = 40,
IsMeter = true,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW102", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 2 },
SVModel = new MeterValueAttrCell() { Address = "VW402", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 2 },
MVModel = new MeterValueAttrCell() { Address = "VW702", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 2 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW700", EngValueStr = "", Block = "MVAM", BlockIndex = 0 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW704", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW706", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW708", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW710", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW712", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW714", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//吸气压力
TagManger.AddTag(new ShortControlTag()
{
Id = 3,
Name = "吸气压力[BarA]",
NameNoUnit = "吸气压力",
EnName = "InhPress",
Group = "程序",
MinValue = 0,
MaxValue = 16,
IsMeter = true,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW104", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 4 },
SVModel = new MeterValueAttrCell() { Address = "VW404", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 4 },
MVModel = new MeterValueAttrCell() { Address = "VW724", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 24 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW722", EngValueStr = "", Block = "MVAM", BlockIndex = 22 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW726", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW728", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW730", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW732", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW734", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW736", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//吸气温度
TagManger.AddTag(new ShortControlTag()
{
Id = 4,
Name = "吸气温度[℃]",
NameNoUnit = "吸气温度",
EnName = "InhTemp",
Group = "程序",
MinValue = -50,
MaxValue = 200,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW106", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 6 },
SVModel = new MeterValueAttrCell() { Address = "VW406", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 6 },
MVModel = new MeterValueAttrCell() { Address = "VW746X", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 46 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW744", EngValueStr = "", Block = "MVAM", BlockIndex = 44 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW748", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW750", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW752", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW754", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW756", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW758", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//COND1温度
TagManger.AddTag(new ShortControlTag()
{
Id = 5,
Name = "COND1温度[℃]",
NameNoUnit = "COND1温度",
EnName = "Cond1Temp",
Group = "程序",
MinValue = -50,
MaxValue = 200,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW108", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 8 },
SVModel = new MeterValueAttrCell() { Address = "VW408", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 8 },
MVModel = new MeterValueAttrCell() { Address = "VW768", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 68 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW766", EngValueStr = "", Block = "MVAM", BlockIndex = 66 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW770", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW772", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW774", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW776", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW778", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW780", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//润滑油压力
TagManger.AddTag(new ShortControlTag()
{
Id = 6,
Name = "润滑油压力[BarA]",
NameNoUnit = "润滑油压力",
EnName = "LubePress",
Group = "程序",
MinValue = 0,
MaxValue = 40,
IsMeter = true,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW110", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 10 },
SVModel = new MeterValueAttrCell() { Address = "VW410", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 10 },
MVModel = new MeterValueAttrCell() { Address = "VW790", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 90 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW788", EngValueStr = "", Block = "MVAM", BlockIndex = 88 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW792", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW794", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW796", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW798", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW800", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW802", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//COND2压力
TagManger.AddTag(new ShortControlTag()
{
Id = 7,
Name = "COND2压力[BarA]",
NameNoUnit = "COND2压力",
EnName = "Cond2Press",
Group = "程序",
MinValue = 0,
MaxValue = 40,
IsMeter = true,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW112", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 12 },
SVModel = new MeterValueAttrCell() { Address = "VW412", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 12 },
MVModel = new MeterValueAttrCell() { Address = "VW812", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 112 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW810", EngValueStr = "", Block = "MVAM", BlockIndex = 110 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW814", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW816", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW818", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW820", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW822", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW824", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//OCR
TagManger.AddTag(new ShortControlTag()
{
Id = 8,
Name = "OCR[%]",
NameNoUnit = "OCR",
EnName = "OCR",
Group = "程序",
MinValue = 0,
MaxValue = 100,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "%",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW114", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 14 },
SVModel = new MeterValueAttrCell() { Address = "VW414", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 14 },
MVModel = new MeterValueAttrCell() { Address = "VW834", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 134 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW832", EngValueStr = "", Block = "MVAM", BlockIndex = 132 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW836", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW838", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW840", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW842", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW844", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW846", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//HV
TagManger.AddTag(new ShortControlTag()
{
Id = 9,
Name = "HV[V]",
NameNoUnit = "HV[V]",
EnName = "HV",
Group = "程序",
MinValue = 0,
MaxValue = 1500,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "V",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW116", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 16 },
SVModel = new MeterValueAttrCell() { Address = "VW416", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 16 },
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,
});
//HV[A] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 10,
Name = "HV[A]",
NameNoUnit = "HV[A]",
EnName = "HVCur",
Group = "采集",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "A",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW118", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 18 },
//SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "Pro", 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.PLCRead,
});
//HV[W] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 11,
Name = "HV[W]",
NameNoUnit = "HV[W]",
EnName = "HVPw",
Group = "采集",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 0,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW120", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 20 },
//SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "Pro", 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.PLCRead,
});
//LV[V]
TagManger.AddTag(new ShortControlTag()
{
Id = 12,
Name = "LV[V]",
NameNoUnit = "LV[V]",
EnName = "LV",
Group = "程序",
MinValue = 0,
MaxValue = 30,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "V",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW122", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 22 },
SVModel = new MeterValueAttrCell() { Address = "VW418", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 18 },
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,
});
//LV[A] 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 13,
Name = "LV[A]",
NameNoUnit = "LV[A]",
EnName = "LVCur",
Group = "采集",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "A",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW124", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 24 },
//SVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "Pro", BlockIndex = 1, Enable = false },
//MVAutoHandModel = new MvAmAttrCell() { Address = "", EngValueStr = "", Block = "Pro", 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.PLCRead,
});
//环境温度
TagManger.AddTag(new ShortControlTag()
{
Id = 14,
Name = "环境温度[℃]",
NameNoUnit = "环境温度",
EnName = "EnvTemp",
Group = "程序",
MinValue = -50,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW126", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 26 },
SVModel = new MeterValueAttrCell() { Address = "VW420", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 20 },
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,
});
//环境湿度
TagManger.AddTag(new ShortControlTag()
{
Id = 15,
Name = "环境湿度[%]",
NameNoUnit = "环境湿度",
EnName = "EnvRH",
Group = "程序",
MinValue = 0,
MaxValue = 100,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "%",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW128", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 28 },
SVModel = new MeterValueAttrCell() { Address = "VW422", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 22 },
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,
});
//OS1温度
TagManger.AddTag(new ShortControlTag()
{
Id = 16,
Name = "OS1温度[℃]",
NameNoUnit = "OS1温度",
EnName = "OS1Temp",
Group = "程序",
MinValue = -50,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW130", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 30 },
SVModel = new MeterValueAttrCell() { Address = "VW424", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 24 },
MVModel = new MeterValueAttrCell() { Address = "VW856", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 156 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW854", EngValueStr = "", Block = "MVAM", BlockIndex = 154 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW858", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW860", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW862", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW864", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW866", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW868", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//OS2温度
TagManger.AddTag(new ShortControlTag()
{
Id = 17,
Name = "OS2温度[℃]",
NameNoUnit = "OS2温度",
EnName = "OS2Temp",
Group = "程序",
MinValue = -50,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW132", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 32 },
SVModel = new MeterValueAttrCell() { Address = "VW426", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 26 },
MVModel = new MeterValueAttrCell() { Address = "VW878", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 178 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW876", EngValueStr = "", Block = "MVAM", BlockIndex = 176 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW880", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW882", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW884", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW886", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW888", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW890", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//COND2温度
TagManger.AddTag(new ShortControlTag()
{
Id = 18,
Name = "COND2温度[℃]",
NameNoUnit = "COND2温度",
EnName = "Cond2Temp",
Group = "程序",
MinValue = -50,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW134", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 34 },
SVModel = new MeterValueAttrCell() { Address = "VW428", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 28 },
MVModel = new MeterValueAttrCell() { Address = "VW900", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 200 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW898", EngValueStr = "", Block = "MVAM", BlockIndex = 198 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW902", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW904", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW906", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW908", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW910", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW912", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//EVAP出口温度
TagManger.AddTag(new ShortControlTag()
{
Id = 19,
Name = "EVAP出口温度[℃]",
NameNoUnit = "EVAP出口温度",
EnName = "EVAPExpTemp",
Group = "程序",
MinValue = -50,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW136", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 36 },
SVModel = new MeterValueAttrCell() { Address = "VW430", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 30 },
MVModel = new MeterValueAttrCell() { Address = "VW922", EngValue = 0, EngValueStr = "", Block = "MV", BlockIndex = 222 },
MVAutoHandModel = new MvAmAttrCell() { Address = "VW920", EngValueStr = "", Block = "MVAM", BlockIndex = 220 },
Pid_PModel = new MeterExdAttrCell() { Address = "VW924", EngValue = 0, EngValueStr = "", },
Pid_IModel = new MeterExdAttrCell() { Address = "VW926", EngValue = 0, EngValueStr = "", },
Pid_DModel = new MeterExdAttrCell() { Address = "VW928", EngValue = 0, EngValueStr = "", },
Limit_UpModel = new MeterExdAttrCell() { Address = "VW930", EngValue = 0, EngValueStr = "", },
Limit_DownModel = new MeterExdAttrCell() { Address = "VW932", EngValue = 0, EngValueStr = "", },
AlarmModel = new MeterExdAttrCell() { Address = "VW934", EngValue = 0, EngValueStr = "", },
AutoHandState = false,
RWInfo = RWInfo.Control,
});
//PTC功率 控制但非仪表控制
TagManger.AddTag(new ShortControlTag()
{
Id = 20,
Name = "PTC功率[W]",
NameNoUnit = "PTC功率",
EnName = "PTCPw",
Group = "程序",
MinValue = 0,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 0, Enable = false },
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 },
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,
Name = "PTC流量[L/min]",
NameNoUnit = "PTC流量",
EnName = "PTCFlow",
Group = "程序",
MinValue = 0,
MaxValue = 150,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "L/min",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW138", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 38 },
SVModel = new MeterValueAttrCell() { Address = "VW436", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 36 },
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 = 22,
Name = "PTC入口水温[℃]",
NameNoUnit = "PTC入口水温",
EnName = "PTCEntTemp",
Group = "程序",
MinValue = 0,
MaxValue = 100,
IsMeter = true,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW140", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 40 },
SVModel = new MeterValueAttrCell() { Address = "VW438", EngValue = 0, EngValueStr = "", Block = "SV", BlockIndex = 38 },
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,
});
//冷媒流量 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 23,
Name = "冷媒流量[kg/h]",
NameNoUnit = "冷媒流量",
EnName = "VRV",
Group = "采集",
MinValue = 0,
MaxValue = 800,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "kg/h",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW144", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 44 },
RWInfo = RWInfo.PLCRead,
});
//润滑油流量 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 24,
Name = "润滑油流量[kg/h]",
NameNoUnit = "润滑油流量",
EnName = "LubeFlow",
Group = "采集",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "kg/h",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW142", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 42 },
RWInfo = RWInfo.PLCRead,
});
//排气温度 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 25,
Name = "排气温度[℃]",
NameNoUnit = "排气温度",
EnName = "ExTemp",
Group = "采集",
MinValue = -50,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW146", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 46 },
RWInfo = RWInfo.PLCRead,
});
//阀前压力P3 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 26,
Name = "阀前压力P3[BarA]",
NameNoUnit = "阀前压力P3",
EnName = "TxvFrPressP3",
Group = "采集",
MinValue = 0,
MaxValue = 40,
IsMeter = false,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW184", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 84 },
RWInfo = RWInfo.PLCRead,
});
//EVAP出口压力P6 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 27,
Name = "EVAP出口压力P6[BarA]",
NameNoUnit = "EVAP出口压力P6",
EnName = "EVAPExpTempP6",
Group = "采集",
MinValue = 0,
MaxValue = 40,
IsMeter = false,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW186", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 86 },
RWInfo = RWInfo.PLCRead,
});
//背压压力P8 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 28,
Name = "背压压力P8[BarA]",
NameNoUnit = "背压压力P8",
EnName = "BackPressP8",
Group = "采集",
MinValue = 0,
MaxValue = 40,
IsMeter = false,
DecimalPoint = 2,
Precision = 100,
Unit = "BarA",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW188", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 88 },
RWInfo = RWInfo.PLCRead,
});
//阀前温度T3 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 29,
Name = "阀前温度T3[℃]",
NameNoUnit = "阀前温度T3",
EnName = "TxvFrPressT3",
Group = "采集",
MinValue = -50,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW190", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 90 },
RWInfo = RWInfo.PLCRead,
});
//COND1入口温度T4 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 30,
Name = "COND1入口温度T4[℃]",
NameNoUnit = "COND1入口温度T4",
EnName = "Cond1TempT4",
Group = "采集",
MinValue = -50,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW192", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 92 },
RWInfo = RWInfo.PLCRead,
});
//EVAP出口温度T6 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 31,
Name = "EVAP出口温度T6[℃]",
NameNoUnit = "EVAP出口温度T6",
EnName = "EVAPExpTempT6",
Group = "采集",
MinValue = -50,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW194", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 94 },
RWInfo = RWInfo.PLCRead,
});
//压缩机表面温度T11 采集
TagManger.AddTag(new ShortValueTag()
{
Id = 32,
Name = "压缩机表面温度T11[℃]",
NameNoUnit = "压缩机表面温度T11",
EnName = "CapSufTempT11",
Group = "采集",
MinValue = -50,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 10,
Unit = "℃",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW196", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 96 },
RWInfo = RWInfo.PLCRead,
});
//Qcool 计算 制冷量
TagManger.AddTag(new ShortValueTag()
{
Id = 33,
Name = "制冷量[W]",
NameNoUnit = "制冷量",
EnName = "Qcool",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW208", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 0 },
RWInfo = RWInfo.PCCalcu,
});
//Qcool_Customer 计算
TagManger.AddTag(new ShortValueTag()
{
Id = 34,
Name = "制热量[W]",
NameNoUnit = "制热量",
EnName = "Qheat",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW210", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
RWInfo = RWInfo.PCCalcu,
});
////Qheat 计算
//TagManger.AddTag(new ShortValueTag()
//{
// Id = 35,
// Name = "Qheat[W]",
// NameNoUnit = "Qheat",
// EnName = "Qheat",
// Group = "计算",
// MinValue = 0,
// MaxValue = 100,
// IsMeter = false,
// DecimalPoint = 1,
// Precision = 1,
// Unit = "W",
// DataType = TagDataType.Short,
// PVModel = new MeterValueAttrCell() { Address = "VW212", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
// RWInfo = RWInfo.PCCalcu,
//});
//COP_Cooling_5K 计算
TagManger.AddTag(new ShortValueTag()
{
Id = 36,
Name = "制冷性能系数[W]",
NameNoUnit = "制冷性能系数",
EnName = "COPCooling",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW214", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
RWInfo = RWInfo.PCCalcu,
});
////COP_Cooling_Customer 计算 制冷性能系数
//TagManger.AddTag(new ShortValueTag()
//{
// Id = 37,
// Name = "COP_Cooling_Customer[W]",
// NameNoUnit = "COP_Cooling_Customer",
// EnName = "COP_Cooling_Customer",
// Group = "计算",
// MinValue = 0,
// MaxValue = 100,
// IsMeter = false,
// DecimalPoint = 1,
// Precision = 1,
// Unit = "W",
// DataType = TagDataType.Short,
// PVModel = new MeterValueAttrCell() { Address = "VW216", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
// RWInfo = RWInfo.PCCalcu,
//});
//COP_Heating 计算 制热性能系数
TagManger.AddTag(new ShortValueTag()
{
Id = 38,
Name = "制热性能系数[W]",
NameNoUnit = "制热性能系数",
EnName = "COPHeating",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW218", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
RWInfo = RWInfo.PCCalcu,
});
//VolumeEfficiency 计算 容积效率
TagManger.AddTag(new ShortValueTag()
{
Id = 39,
Name = "容积效率[%]",
NameNoUnit = "容积效率",
EnName = "VolumeEfficiency",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "%",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW220", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
RWInfo = RWInfo.PCCalcu,
});
//IsentropyEfficiency 计算 等熵效率
TagManger.AddTag(new ShortValueTag()
{
Id = 40,
Name = "等熵效率[%]",
NameNoUnit = "等熵效率",
EnName = "IsentropyEfficiency",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "%",
DataType = TagDataType.Short,
PVModel = new MeterValueAttrCell() { Address = "VW222", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
RWInfo = RWInfo.PCCalcu,
});
////IsentropyEfficiency 计算 等熵效率
//TagManger.AddTag(new ShortValueTag()
//{
// Id = 41,
// Name = "IsentropyEfficiency[%]",
// NameNoUnit = "IsentropyEfficiency",
// EnName = "IsentropyEfficiency",
// Group = "计算",
// MinValue = 0,
// MaxValue = 100,
// IsMeter = false,
// DecimalPoint = 1,
// Precision = 1,
// Unit = "%",
// DataType = TagDataType.Short,
// PVModel = new MeterValueAttrCell() { Address = "VW222", EngValue = 0, EngValueStr = "", Block = "PV", BlockIndex = 1 },
// RWInfo = RWInfo.PCCalcu,
//});
// 过冷度 计算
TagManger.AddTag(new CalcTag()
{
Id = 42,
Name = "过冷度[K]",
NameNoUnit = "过冷度",
EnName = "Subcooling",
Group = "计算",
MinValue = -50,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "K",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW224", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.PCCalcu,
});
// 过热度 计算
TagManger.AddTag(new CalcTag()
{
Id = 43,
Name = "过热度[K]",
NameNoUnit = "过热度",
EnName = "Superheat",
Group = "计算",
MinValue = -50,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "K",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW226", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.PCCalcu,
});
// 干度 计算
TagManger.AddTag(new CalcTag()
{
Id = 44,
Name = "干度[%]",
NameNoUnit = "干度",
EnName = "Dryness",
Group = "计算",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "%",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW228", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.PCCalcu,
});
//压缩机采集的数据
// 通讯母线电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 45,
Name = "通讯母线电流[A]",
NameNoUnit = "通讯母线电流",
EnName = "ComCapBusCur",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 2,
Precision = 1,
Unit = "A",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW270", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯母线电压 压缩机
TagManger.AddTag(new CapTag()
{
Id = 46,
Name = "通讯母线电压[V]",
NameNoUnit = "通讯母线电压",
EnName = "ComCapBusCur",
Group = "压缩机",
MinValue = 0,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "V",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW272", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯相电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 47,
Name = "通讯相电流[A]",
NameNoUnit = "通讯相电流",
EnName = "ComCapPhCur",
Group = "压缩机",
MinValue = 0,
MaxValue = 200,
IsMeter = false,
DecimalPoint = 2,
Precision = 1,
Unit = "A",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW274", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯功率 压缩机
TagManger.AddTag(new CapTag()
{
Id = 48,
Name = "通讯功率[W]",
NameNoUnit = "通讯功率",
EnName = "ComCapPw",
Group = "压缩机",
MinValue = 0,
MaxValue = 1000,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "W",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW276", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯逆变器温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 49,
Name = "通讯逆变器温度[℃]",
NameNoUnit = "通讯逆变器温度",
EnName = "ComCapInverterTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 150,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW278", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯芯片温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 50,
Name = "通讯芯片温度[℃]",
NameNoUnit = "通讯芯片温度",
EnName = "ComCapChipTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 150,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW280", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC入水温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 51,
Name = "通讯PTC入水温度[℃]",
NameNoUnit = "通讯PTC入水温度",
EnName = "CapPTCInWaterTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW302", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC出水温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 52,
Name = "通讯PTC出水温度[℃]",
NameNoUnit = "通讯PTC出水温度",
EnName = "CapPTCOutWaterTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW304", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC峰值电流 压缩机
TagManger.AddTag(new CapTag()
{
Id = 53,
Name = "通讯PTC峰值电流[A]",
NameNoUnit = "通讯PTC峰值电流",
EnName = "CapPTCPeakCur",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 2,
Precision = 1,
Unit = "A",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW306", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC母线电流
TagManger.AddTag(new CapTag()
{
Id = 54,
Name = "通讯PTC母线电流[A]",
NameNoUnit = "通讯PTC母线电流",
EnName = "CapPTCBusCur",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 2,
Precision = 1,
Unit = "A",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW308", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC膜温 压缩机
TagManger.AddTag(new CapTag()
{
Id = 55,
Name = "通讯PTC膜温[℃]",
NameNoUnit = "通讯PTC膜温",
EnName = "CapPTCFilmTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW310", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
// 通讯PTC功率模块温度 压缩机
TagManger.AddTag(new CapTag()
{
Id = 56,
Name = "通讯PTC功率模块温度[℃]",
NameNoUnit = "通讯PTC功率模块温度",
EnName = "CapPTCPwMdTemp",
Group = "压缩机",
MinValue = 0,
MaxValue = 100,
IsMeter = false,
DecimalPoint = 1,
Precision = 1,
Unit = "℃",
DataType = TagDataType.Double,
PVModel = new QuickAttrCell() { Address = "VW310", EngValue = 0, EngValueStr = "", },
RWInfo = RWInfo.CapRead,
});
//精度和小数点数据的属性数据初始化
foreach (var itemTag in TagManger.DicTags)
{
if (TagManger.TryGetShortControlTagByName(itemTag.Key, out ShortControlTag? shortControlTag))
{
shortControlTag!.UpdateInit();
continue;
}
if (TagManger.TryGetShortTagByName(itemTag.Key, out ShortValueTag? shortValueTag))
{
shortValueTag!.UpdateInit();
continue;
}
}
#endregion
#region SongZhi
////【SongZhi】
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "转速[rpm]",//名称带单位
// NameNoUnit = "转速",//无单位名称
// EnName = "Speed",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "rpm",
// PVAddress = "VW100",//地址信息
// SVAddress = "VW200",
// MVAddress = "VW242",
// IsMeter = true,
// AutoHandSwitchAddress = "VW240",
// Precision = 1,
// DecimalPoint = 0,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "排气压力[MpaA]",//名称带单位
// NameNoUnit = "排气压力",//无单位名称
// EnName = "ExPress",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "MpaA",
// PVAddress = "VW102",//地址信息
// SVAddress = "VW202",
// MVAddress = "VW242",
// IsMeter = true,
// AutoHandSwitchAddress = "VW240",
// Precision = 1000,
// DecimalPoint = 3,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "吸气压力[MpaA]",//名称带单位
// NameNoUnit = "吸气压力",//无单位名称
// EnName = "InhPress",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "MpaA",
// PVAddress = "VW104",//地址信息
// SVAddress = "VW204",
// MVAddress = "VW246",
// IsMeter = true,
// AutoHandSwitchAddress = "VW244",
// Precision = 1000,
// DecimalPoint = 3,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "吸气温度[℃]",//名称带单位
// NameNoUnit = "吸气温度",//无单位名称
// EnName = "InhTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW106",//地址信息
// SVAddress = "VW206",
// MVAddress = "VW250",
// IsMeter = true,
// AutoHandSwitchAddress = "VW248",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "冷凝器出口水温[℃]",//名称带单位 COND1水温
// NameNoUnit = "冷凝器出口水温",//无单位名称
// EnName = "Cond1Temp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW108",//地址信息
// SVAddress = "VW208",
// MVAddress = "VW254",
// IsMeter = true,
// AutoHandSwitchAddress = "VW252",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "吸气混合器温度[℃]",//名称带单位 OS2温度
// NameNoUnit = "吸气混合器温度",//无单位名称 OS2温度
// EnName = "OS2Temp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW110",//地址信息
// SVAddress = "VW210",
// MVAddress = "VW258",
// IsMeter = true,
// AutoHandSwitchAddress = "VW256",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "HV_V[V]",//名称带单位
// NameNoUnit = "HV_V",//无单位名称
// EnName = "HV_V",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "V",
// PVAddress = "VW112",//地址信息
// SVAddress = "VW212",
// MVAddress = "VW262",
// IsMeter = true,
// AutoHandSwitchAddress = "VW260",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "HV_A[A]",//名称带单位
// NameNoUnit = "HV_A",//无单位名称
// EnName = "HV_A",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "A",
// PVAddress = "VW114",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 100,
// DecimalPoint = 2,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "HV_W[W]",//名称带单位
// NameNoUnit = "HV_W",//无单位名称
// EnName = "HV_W",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "W",
// PVAddress = "VW116",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 1,
// DecimalPoint = 0,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "LV_V[V]",//名称带单位
// NameNoUnit = "LV_V",//无单位名称
// EnName = "LV_V",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "V",
// PVAddress = "VW118",//地址信息
// SVAddress = "VW214",
// MVAddress = "",
// IsMeter = true,
// AutoHandSwitchAddress = "",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "LV_A[A]",//名称带单位
// NameNoUnit = "LV_A",//无单位名称
// EnName = "LV_A",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "A",
// PVAddress = "VW120",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 100,
// DecimalPoint = 2,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "试验箱温度[℃]",//名称带单位
// NameNoUnit = "试验箱温度",//无单位名称
// EnName = "EnvTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW122",//地址信息
// SVAddress = "VW216",
// MVAddress = "",
// IsMeter = true,
// AutoHandSwitchAddress = "",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "试验箱湿度[%]",//名称带单位
// NameNoUnit = "试验箱湿度",//无单位名称
// EnName = "EnvRH",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "%",
// PVAddress = "VW124",//地址信息
// SVAddress = "VW218",
// MVAddress = "",
// IsMeter = true,
// AutoHandSwitchAddress = "",
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "排气温度[℃]",//名称带单位
// NameNoUnit = "排气温度",//无单位名称
// EnName = "ExTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW126",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "膨胀阀前温度[℃]",//名称带单位
// NameNoUnit = "膨胀阀前温度",//无单位名称
// EnName = "TxvFrTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW128",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "膨胀阀前压力[MpaA]",//名称带单位
// NameNoUnit = "膨胀阀前压力",//无单位名称
// EnName = "TxvFrPress",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "MpaA",
// PVAddress = "VW130",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 1000,
// DecimalPoint = 3,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "冷凝器进口温度[℃]",//名称带单位
// NameNoUnit = "冷凝器进口温度",//无单位名称
// EnName = "CondInTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW132",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "冷凝器进口压力[MpaA]",//名称带单位
// NameNoUnit = "冷凝器进口压力",//无单位名称
// EnName = "CondInPress",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "MpaA",
// PVAddress = "VW134",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 1000,
// DecimalPoint = 3,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "水箱进水温度[℃]",//名称带单位
// NameNoUnit = "水箱进水温度",//无单位名称
// EnName = "WaterTankInTemp",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// Unit = "℃",
// MaxValue = 100,
// PVAddress = "VW136",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "水加热温度H1[℃]",//名称带单位
// NameNoUnit = "水加热温度H1",//无单位名称
// EnName = "WaterHeatTempH1",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW138",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "压缩机表面温度1[℃]",//名称带单位
// NameNoUnit = "压缩机表面温度1",//无单位名称
// EnName = "CapSurfTemp1",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW140",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "压缩机表面温度2[℃]",//名称带单位
// NameNoUnit = "压缩机表面温度2",//无单位名称
// EnName = "CapSurfTemp2",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW142",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "压缩机表面温度3[℃]",//名称带单位
// NameNoUnit = "压缩机表面温度3",//无单位名称
// EnName = "CapSurfTemp3",//英文名称
// Group = "程序",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW144",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "通讯母线电压[V]",//名称带单位
// NameNoUnit = "通讯母线电压",//无单位名称
// EnName = "ComCapBusVol",//英文名称
// Group = "CANLIN",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "V",
// PVAddress = "VW146",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "通讯母线电流[A]",//名称带单位
// NameNoUnit = "通讯母线电流",//无单位名称
// EnName = "ComCapBusCur",//英文名称
// Group = "CANLIN",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "A",
// PVAddress = "VW148",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 100,
// DecimalPoint = 2,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "通讯相电流[A]",//名称带单位
// NameNoUnit = "通讯相电流",//无单位名称
// EnName = "ComCapPhCur",//英文名称
// Group = "CANLIN",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "A",
// PVAddress = "VW150",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 100,
// DecimalPoint = 2,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "通讯功率[W]",//名称带单位
// NameNoUnit = "通讯功率",//无单位名称
// EnName = "ComCapPw",//英文名称
// Group = "CANLIN",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "W",
// PVAddress = "VW152",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 1000,
// DecimalPoint = 2,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "通讯芯片温度[℃]",//名称带单位
// NameNoUnit = "通讯芯片温度",//无单位名称
// EnName = "ComCapChipTemp",//英文名称
// Group = "CANLIN",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "℃",
// PVAddress = "VW154",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "过冷度[K]",//名称带单位
// NameNoUnit = "过冷度",//无单位名称
// EnName = "Subcooling",//英文名称
// Group = "计算",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "K",
// PVAddress = "",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//TagManger.AddTag(new Tag(new ShortTagValue())
//{
// Name = "过热度[K]",//名称带单位
// NameNoUnit = "过热度",//无单位名称
// EnName = "Superheat",//英文名称
// Group = "计算",//分组
// MinValue = 0,
// MaxValue = 100,
// Unit = "K",
// PVAddress = "",//地址信息
// SVAddress = "",
// MVAddress = "",
// IsMeter = false,
// Precision = 10,
// DecimalPoint = 1,
// Samp = 1,
// ValueType = typeof(short),
// Index = "",
//});
//#endregion
//TagManger.AddTag(new Tag("OCR", "OCR[%]", "OCR", "程序", "VW15014", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("HV[V]", "HV[V]", "HV", "程序", "VW15016", 100, 0, 10, "V", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("HV[A]", "HV[A]", "HVCur", "程序", "VW15018", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("HV[W]", "HV[W]", "HVPw", "程序", "VW15020", 100, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("LV[V]", "LV[V]", "LV", "程序", "VW15022", 100, 0, 10, "V", new ShortTagValue(), true) { DecimalPoint = 1 });
////TagManger.AddTag(new Tag("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("LV[A]", "LV[A]", "LVCur", "程序", "VW15024", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2 });
//TagManger.AddTag(new Tag("环境温度", "环境温度[℃]", "EnvTemp", "程序", "VW15026", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1 });
////TagManger.AddTag(new Tag("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("环境湿度", "环境湿度[%]", "EnvRH", "程序", "VW15028", 100, 0, 1, "%", new ShortTagValue(), true) { DecimalPoint = 0 });
//TagManger.AddTag(new Tag("OS1温度", "OS1温度[℃]", "OS1Temp", "程序", "VW15030", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("OS2温度", "OS2温度[℃]", "OS2Temp", "程序", "VW15032", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("COND2温度", "COND2温度[℃]", "Cond2Temp", "程序", "VW15034", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("EVAP出口温度", "EVAP出口温度[℃]", "EVAPExpTemp", "程序", "VW15036", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
////TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("润滑油流量", "润滑油流量[L/min]", "LubeFlow", "程序", "VW15040", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("排气温度", "排气温度[℃]", "ExTemp", "程序", "VW15042", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("膨胀阀前压力", "膨胀阀前压力[MpaA]", "TxvFrPress", "程序", "VW15044", 100, 0, 100, "MpaA", new ShortTagValue(), false) { DecimalPoint = 2 });
//TagManger.AddTag(new Tag("膨胀阀前温度", "膨胀阀前温度[℃]", "TxvFrTemp", "程序", "VW15046", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("EVAP出口压力", "EVAP出口压力[MpaA]", "EVAPExpPress", "程序", "VW15048", 100, 0, 100, "MpaA", new ShortTagValue(), false) { DecimalPoint = 2 });
//TagManger.AddTag(new Tag("腔内压力", "腔内压力[MpaA]", "IntrplPress", "程序", "VW15050", 100, 0, 100, "MpaA", new ShortTagValue(), false) { DecimalPoint = 2 });
//TagManger.AddTag(new Tag("压缩机表面温度", "压缩机表面温度[℃]", "CapSurfTemp", "程序", "VW15052", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("PTC流量", "PTC流量[L/min]", "PTCFlow", "程序", "VW15054", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("PTC入水温度", "PTC入水温度[℃]", "PTCEntTemp", "程序", "VW15056", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("PTC出水温度", "PTC出水温度[℃]", "PTCExpTemp", "程序", "VW15058", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp母线电流", "通讯Cmp母线电流[A]", "ComCapBusCur", "程序", "VW15060", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp母线电压", "通讯Cmp母线电压[V]", "ComCapBusVol", "程序", "VW15062", 100, 0, 10, "V", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp逆变器温度", "通讯Cmp逆变器温度[℃]", "ComCapInvTemp", "程序", "VW15064", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp相电流", "通讯Cmp相电流[A]", "ComCapPhCur", "程序", "VW15066", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp功率", "通讯Cmp功率[W]", "ComCapPw", "程序", "VW15068", 100, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯Cmp芯片温度", "通讯Cmp芯片温度[℃]", "ComCapChipTemp", "程序", "VW15070", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC入水温度", "通讯PTC入水温度[℃]", "ComPTCEntTemp", "程序", "VW15072", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC出水温度", "通讯PTC出水温度[℃]", "ComPTCExpTemp", "程序", "VW15074", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC峰值电流", "通讯PTC峰值电流[A]", "ComPTCPeakCur", "程序", "VW15076", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC母线电流", "通讯PTC母线电流[A]", "ComPTCBusCur", "程序", "VW15078", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC膜温", "通讯PTC膜温[℃]", "ComPTCFlmTemp", "程序", "VW15080", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag("通讯PTC模块温度", "通讯PTC模块温度[℃]", "ComPTCMdTemp", "程序", "VW15082", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
#endregion
ListHandSwitchData = new List()
{
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="P1水泵",ActionAddress="M1.5",StateAddress="Q0.3" },
new HandSwitchData(){Name="P2水泵",ActionAddress="M1.6",StateAddress="Q0.4" },
new HandSwitchData(){Name="OS1加热器",ActionAddress="M1.7",StateAddress="Q0.5" },
new HandSwitchData(){Name="OS2加热器",ActionAddress="M2.0",StateAddress="Q0.6" },
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="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" },
};
ListPlcExdConfigCell = new List()
{
new PlcExdConfigCell(){ Name="输出锁定",Address="VW482",Precision=1},
new PlcExdConfigCell(){ Name="吸排气阀",Address="VW490",Precision=1},
new PlcExdConfigCell(){ Name="EV",Address="VW492",Precision=1},
new PlcExdConfigCell(){ Name="压缩机使能",Address="VW484",Precision=1},
new PlcExdConfigCell(){ Name="PTC使能",Address="VW486",Precision=1},
};
//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("转速");
//var data1 = TagManger.GetTagByName("转速");
//var data2 = TagManger.GetTagByName("转速5888");
//data1.TagValue.Value = 12;
//TagInfo = data1;
//var TagInfo1= data1.RtValue.Value;
//var Data = DATA.Value;
//dynamic dad=10;
InitialPLCCom();
//拓展的参数信息
CurSysExdInfo = new SysExdInfo(SiemensDrive);
SysExdBoolInfos = new SysExdBoolInfo(SiemensDrive);
//PubRtDataStart();
}
#region 手自动的操作
////
///// 手自动切换集合数据
/////
public List ListHandSwitchData { get; set; }
///
/// 程序复位
///
///
public bool SysReset()
{
SiemensDrive.Write("M0.7", true);
return true;
////取消XXX
//var FindData = ListHandSwitchData.Where(a => a.Name == "复位");
//if (FindData.Count() > 0)
//{
// var Result = SiemensDrive.Write(FindData.First().ActionAddress, true);
// if (Result.IsSuccess)
// {
// return true;
// }
// else
// {
// return false;
// }
//}
//return false;
}
///
/// 程序消音
///
///
public bool SysMute()
{
//return true;
//取消XXX
var FindData = ListHandSwitchData.Where(a => a.Name == "消音");
if (FindData.Count() > 0)
{
var Result = SiemensDrive.Write(FindData.First().ActionAddress, true);
if (Result.IsSuccess)
{
return true;
}
else
{
return false;
}
}
return false;
}
///
/// 程序Start
///
///
public bool SysStart()
{
//return true;
//取消XXX
var Result = SiemensDrive.Write("M0.4", true);
if (Result.IsSuccess)
{
return true;
}
else
{
return false;
}
}
///
/// 程序结束
///
///
public bool SysEnd()
{
//return true;
//取消XXX
var Result = SiemensDrive.Write("M0.7", true);
if (Result.IsSuccess)
{
return true;
}
else
{
return false;
}
}
///
/// 程序暂停
/// 取反
///
///
public bool SysPause()
{
//return true;
//取消XXX
var StateResult = SiemensDrive.ReadBool("M0.6");
if (StateResult.IsSuccess)
{
if (StateResult.Content == true)
{
var Result = SiemensDrive.Write("M0.6", false);
if (Result.IsSuccess)
{
return true;
}
else
{
return false;
}
}
else
{
var Result = SiemensDrive.Write("M0.6", true);
if (Result.IsSuccess)
{
return true;
}
else
{
return false;
}
}
}
return false;
}
///
/// 程序继续
/// 取反
///
///
public bool SysContinue()
{
return true;
}
#endregion
///
/// UI更新
///
///
///
///
private void RecoredCycleAction(object? sender, ElapsedEventArgs e)
{
//IsValueShow = !IsValueShow;
}
///
/// 初始化PLC通信
///
private void InitialPLCCom()
{
var IPInfo = ConfigHelper.GetValue("PLCIP");
SiemensDrive = new SiemensS7Net(SiemensPLCS.S200Smart, IPInfo);
// 连接对象
OperateResult connect = SiemensDrive.ConnectServer();
if (!connect.IsSuccess)//连接失败
{
LinkState = false;
Console.WriteLine("connect failed:" + connect.Message);
MessageBox.Show($"PLC连接失败:{IPInfo}");
//return;
}
else//连接成功
{
LinkState = true;
}
//扫描线程成功
RtScanDeviceStart();
}
public const string ConstShortType = "Int16";
public const string ConstUShortType = "UInt16";
public const string ConstIntType = "Int32";
public const string ConstUIntType = "UInt32";
public const string ConstLongType = "Int64";
public const string ConstULongType = "UInt64";
public const string ConstByteType = "Byte";
public const string ConstCharType = "Char";
public const string ConstFloatType = "Single";
public const string ConstDoubleType = "Double";
public const string ConstDecimalType = "Decimal";
public const string ConstBoolType = "Boolean";
//private Random random = new Random();
private int IsShowCount = 0;
private OperateResult OperateResultShort { get; set; }
///
/// SV数据
///
private OperateResult OperateResultSVShort { get; set; }
///
/// MV数据
///
private OperateResult OperateResultMVShort { get; set; }
private Random Random { get; set; } = new Random();
///
/// 报警结果集合
///
private OperateResult OperateResultAlarm { get; set; }
///
/// CAP的使能状态
///
private OperateResult OperateResultCapEnable { get; set; }
///
/// 时间诊断
///
private Stopwatch DiagnosticsTime { get; set; } = new Stopwatch();
///
/// PV整块读取数据
///
private OperateResult OperateResultBlockPVRead { get; set; }
///
/// SV整块读取数据
///
private OperateResult OperateResultBlockSVRead { get; set; }
///
/// MV整块读取数据
///
private OperateResult OperateResultBlockMVRead { get; set; }
private double TestValue = 0.2;
///
/// PLC扫描线程
///
private void RtScanDeviceStart()
{
PLCScanTask = Task.Run(async () =>
{
Stopwatch stopwatch = new Stopwatch();
while (ThreadEnable)
{
//await Task.CompletedTask;
DiagnosticsTime.Reset();
DiagnosticsTime.Start();
await Task.Delay(5);
try
{
////第一次计时
//stopwatch.Start(); //启动Stopwatch
//CANLIN数据读取到TagManger.DicTags数据中心中,上面的操作是itemWrite反写到PLC中
foreach (var itemCanLinGroup in TagManger.DicTags)
{
//只处理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))
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
//取得压缩机的CANLIN数据到数据集合中
pVModel!.EngValue = CanDriveService.GetDbcValueByName(itemCanLinGroup.Value.NameNoUnit);
//写入到PLC中
SiemensDrive.Write(pVModel!.Address, (short)(CanDriveService.GetDbcValueByName(itemCanLinGroup.Value.NameNoUnit) * pVModel.Precision));
break;
case CanLinEnum.Lin:
//取得压缩机的CANLIN数据
pVModel!.EngValue = LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit);
//写入到PLC中
SiemensDrive.Write(pVModel!.Address, (short)(LinDriveService.GetLdfValueByName(itemCanLinGroup.Value.NameNoUnit) * pVModel.Precision));
break;
case CanLinEnum.No:
break;
default:
break;
}
}
}
}
//PV批量读取
OperateResultBlockPVRead = SiemensDrive.Read("VW100", 200);
if (OperateResultBlockPVRead.IsSuccess)
{
foreach (var itemBlockReadTag in TagManger.DicTags)
{
if (itemBlockReadTag.Key.Contains("转速"))
{
//转速不需要PLC读取
continue;
}
//需要从PLC读取的标签才算
if ((itemBlockReadTag.Value.RWInfo == RWInfo.PLCRead || itemBlockReadTag.Value.RWInfo == RWInfo.Control) && TagManger.TryGetPVModel(itemBlockReadTag.Key, out MeterValueAttrCell pVModel))
{
//地址为空的话则下一个
if (string.IsNullOrEmpty(pVModel!.Address)) continue;
//给PvModel的原始属性赋值
pVModel!.EngSrcValue = SiemensDrive.ByteTransform.TransInt16(OperateResultBlockPVRead.Content, pVModel.BlockIndex);
}
}
//通信状态
LinkState = true;
}
else
{
//通信状态
LinkState = false;
}
//SV批量读取
OperateResultBlockSVRead = SiemensDrive.Read("VW400", 200);
if (OperateResultBlockSVRead.IsSuccess)
{
foreach (var itemBlockReadTag in TagManger.DicTags)
{
//需要控制的标签才算 才有SV
if (itemBlockReadTag.Value.RWInfo == RWInfo.Control && TagManger.TryGetSVModel(itemBlockReadTag.Key, out MeterValueAttrCell sVModel))
{
//地址为空的话则下一个
if (string.IsNullOrEmpty(sVModel!.Address)) continue;
//给SvModel的原始属性赋值
sVModel!.EngSrcValue = SiemensDrive.ByteTransform.TransInt16(OperateResultBlockSVRead.Content, sVModel.BlockIndex);
}
}
}
//MV批量读取
OperateResultBlockMVRead = SiemensDrive.Read("VW700", 230);
if (OperateResultBlockMVRead.IsSuccess)
{
foreach (var itemBlockReadTag in TagManger.DicTags)
{
//MV 设置值
//需要从PLC读取的标签才算 只有控制才有MV控制
if (itemBlockReadTag.Value.RWInfo == RWInfo.Control && TagManger.TryGetMVModel(itemBlockReadTag.Key, out MeterValueAttrCell mVModel))
{
//地址为空的话则下一个
if (string.IsNullOrEmpty(mVModel!.Address)) continue;
//给MvModel的原始属性赋值 MV是0-100 % 有标准的转换格式
mVModel!.EngValue = SiemensDrive.ByteTransform.TransInt16(OperateResultBlockMVRead.Content, mVModel.BlockIndex) * 1.0 / 10;
}
//MV 手自动切换 只有控制才有MVAM控制
if (itemBlockReadTag.Value.RWInfo == RWInfo.Control && TagManger.TryGetMVAmModel(itemBlockReadTag.Key, out MvAmAttrCell mVAmModel))
{
//地址为空的话则下一个
if (string.IsNullOrEmpty(mVAmModel!.Address)) continue;
//给mVAmModel的原始属性赋值
mVAmModel!.EngSrcValue = SiemensDrive.ByteTransform.TransInt16(OperateResultBlockMVRead.Content, mVAmModel.BlockIndex);
}
}
}
//手自动切换按钮条件
AutoHandSwtichConditionState.AlarmStateResult = SiemensDrive.ReadBool(AutoHandSwtichConditionState.AlarmAddress);
AutoHandSwtichConditionState.HandStateResult = SiemensDrive.ReadBool(AutoHandSwtichConditionState.HandStateAddress);
AutoHandSwtichConditionState.SumResult();
//程序步骤的写入
ProRunStepWrite();
//TestValue = TestValue + 0.001;
//Console.WriteLine($"结果:{LogicRuleService.ApplyExpressionFast(TestValue, LogicRuleService.LogicRuleDtos[1])}");
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.TotalSeconds.ToString());
//stopwatch.Reset();
//读取报警信息 取消报警XXX
OperateResultAlarm = SiemensDrive.ReadBool("V0.0", 15);
if (OperateResultAlarm.IsSuccess)
{
foreach (var item in AlarmService.ListAlarmRunCell)
{
item.UpdateBoolValue(OperateResultAlarm.Content[item.Index]);
}
}
//循环读取手自动切换 取消XXX
foreach (var item in ListHandSwitchData)
{
item.StateOperateResult = SiemensDrive.ReadBool(item.StateAddress);
if (item.StateOperateResult.IsSuccess)
{
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;
// }
//}
}
}
////拓展信息的展示 取消XXX
//foreach (var itemQuickTag in CurSysExdInfo.QuickTags)
//{
// itemQuickTag.OperateResultSource = SiemensDrive.Read(itemQuickTag.ValueAddress, itemQuickTag.ByteLength);
//}
//CurSysExdInfo.SumRunTime();
////布尔拓展信息的展示 取消XXX
//foreach (var itemQuickTag in SysExdBoolInfos.QuickTags)
//{
// itemQuickTag.OperateResultSource = SiemensDrive.Read(itemQuickTag.ValueAddress, itemQuickTag.ByteLength);
//}
}
catch (Exception ex)
{
//LogService.Info($"时间:{DateTime.Now.ToString()}-【Meter】-{ex.Message}");
}
DiagnosticsTime.Stop();
ConfigService.PlcCycleTime = (int)DiagnosticsTime.Elapsed.TotalMilliseconds;
//Console.WriteLine($"扫描时间:{DiagnosticsTime.Elapsed.TotalMilliseconds.ToString()}");
}
});
}
private Random random = new Random();
///
///发布实时数据
///
private void PubRtDataStart()
{
ScanTask = Task.Run(async () =>
{
while (ThreadEnable)
{
try
{
await Task.Delay(1000);
//_EventAggregator.GetEvent().Publish(new List()
//{
// new Models.ChartRtValue(){Name="EVA风量",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="中间轴转速",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="加热电力",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="加湿电力",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="EMPCV电流",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="INJ压力",Value=random.NextDouble()*100,Unit="℃"},
// new Models.ChartRtValue(){Name="冷媒流量",Value=random.NextDouble()*100,Unit="℃"},
//});
}
catch (Exception ex)
{
}
}
});
}
#region 队列数据
///
/// 队列通道
/// 当前队列消费触发的数据记录
///
public Channel ProRunChannel = Channel.CreateUnbounded(new UnboundedChannelOptions()
{
SingleWriter = false,//允许一次写入多条数据
SingleReader = true //一次只能读取一条消息
});
/////
///// 程序执行管道监听方法
/////
/////
//private async void ListenProRunChannelAction()
//{
// while (await ProRunChannel.Reader.WaitToReadAsync())
// {
// if (ProRunChannel.Reader.TryRead(out var ProRunChannelData))
// {
// ////第一次计时
// //stopwatch.Start(); //启动Stopwatch
// if (ProRunChannelData.RunStepType == RunStepType.SlopCell)
// {
// 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
// {
// 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);
// //DownLoadPID();
// //stopwatch.Stop(); //停止Stopwatch
// //Console.WriteLine("保存数据耗时::{0}", stopwatch.Elapsed.TotalSeconds.ToString());
// //stopwatch.Reset();
// }
// }
//}
///
/// 运行步骤写入
///
private void ProRunStepWrite()
{
while (ProRunChannel.Reader.TryRead(out var ProRunChannelData))
{
////第一次计时
//stopwatch.Start(); //启动Stopwatch
switch (ProRunChannelData.RunStepType)
{
case RunStepType.Step:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Sv
var SvResult = SiemensDrive.Write(CurMeterInfo!.SvAddress, (short)ProRunChannelData.SV!);
if (!SvResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:SV写入失败");
//速度SV到压缩机
if (ProRunChannelData.IsSpeed) SendSpeedSvToCap(ProRunChannelData.SV);
//Pid
if (!string.IsNullOrEmpty(CurMeterInfo.Pid_PAddress))
{
var Pid_PResult = SiemensDrive.Write(CurMeterInfo.Pid_PAddress, (short)ProRunChannelData.CurLoadPID!.P);
if (!Pid_PResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-P写入失败");
var Pid_IResult = SiemensDrive.Write(CurMeterInfo.Pid_IAddress, (short)ProRunChannelData.CurLoadPID!.I);
if (!Pid_IResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-I写入失败");
var Pid_DResult = SiemensDrive.Write(CurMeterInfo.Pid_DAddress, (short)ProRunChannelData.CurLoadPID!.D);
if (!Pid_DResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-D写入失败");
}
//Limit
if (!string.IsNullOrEmpty(CurMeterInfo.Limit_UpAddress))
{
var Limit_UpResult = SiemensDrive.Write(CurMeterInfo.Limit_UpAddress, (short)ProRunChannelData.CurLoadLimit!.Up);
if (!Limit_UpResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Up写入失败");
var Limit_DownResult = SiemensDrive.Write(CurMeterInfo.Limit_DownAddress, (short)ProRunChannelData.CurLoadLimit!.Down);
if (!Limit_DownResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Down写入失败");
}
}
break;
case RunStepType.StepPID:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Sv
var SvResult = SiemensDrive.Write(CurMeterInfo!.SvAddress, (short)ProRunChannelData.SV!);
if (!SvResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:SV写入失败");
//速度SV到压缩机
if (ProRunChannelData.IsSpeed) SendSpeedSvToCap(ProRunChannelData.SV);
//Pid
if (!string.IsNullOrEmpty(CurMeterInfo.Pid_PAddress))
{
var Pid_PResult = SiemensDrive.Write(CurMeterInfo.Pid_PAddress, (short)ProRunChannelData.CurLoadPID!.P);
if (!Pid_PResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-P写入失败");
var Pid_IResult = SiemensDrive.Write(CurMeterInfo.Pid_IAddress, (short)ProRunChannelData.CurLoadPID!.I);
if (!Pid_IResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-I写入失败");
var Pid_DResult = SiemensDrive.Write(CurMeterInfo.Pid_DAddress, (short)ProRunChannelData.CurLoadPID!.D);
if (!Pid_DResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-D写入失败");
}
}
break;
case RunStepType.StepLimit:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Sv
var SvResult = SiemensDrive.Write(CurMeterInfo!.SvAddress, (short)ProRunChannelData.SV!);
if (!SvResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:SV写入失败");
//速度SV到压缩机
if (ProRunChannelData.IsSpeed) SendSpeedSvToCap(ProRunChannelData.SV);
//Limit
if (!string.IsNullOrEmpty(CurMeterInfo.Limit_UpAddress))
{
var Limit_UpResult = SiemensDrive.Write(CurMeterInfo.Limit_UpAddress, (short)ProRunChannelData.CurLoadLimit!.Up);
if (!Limit_UpResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Up写入失败");
var Limit_DownResult = SiemensDrive.Write(CurMeterInfo.Limit_DownAddress, (short)ProRunChannelData.CurLoadLimit!.Down);
if (!Limit_DownResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Down写入失败");
}
}
break;
case RunStepType.StepSV:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Sv
var SvResult = SiemensDrive.Write(CurMeterInfo!.SvAddress, (short)ProRunChannelData.SV!);
if (!SvResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:SV写入失败");
//速度SV到压缩机
if (ProRunChannelData.IsSpeed) SendSpeedSvToCap(ProRunChannelData.SV);
}
break;
case RunStepType.LimitPid:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Pid
if (!string.IsNullOrEmpty(CurMeterInfo.Pid_PAddress))
{
var Pid_PResult = SiemensDrive.Write(CurMeterInfo.Pid_PAddress, (short)ProRunChannelData.CurLoadPID!.P);
if (!Pid_PResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-P写入失败");
var Pid_IResult = SiemensDrive.Write(CurMeterInfo.Pid_IAddress, (short)ProRunChannelData.CurLoadPID!.I);
if (!Pid_IResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-I写入失败");
var Pid_DResult = SiemensDrive.Write(CurMeterInfo.Pid_DAddress, (short)ProRunChannelData.CurLoadPID!.D);
if (!Pid_DResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-D写入失败");
}
//Limit
if (!string.IsNullOrEmpty(CurMeterInfo.Limit_UpAddress))
{
var Limit_UpResult = SiemensDrive.Write(CurMeterInfo.Limit_UpAddress, (short)ProRunChannelData.CurLoadLimit!.Up);
if (!Limit_UpResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Up写入失败");
var Limit_DownResult = SiemensDrive.Write(CurMeterInfo.Limit_DownAddress, (short)ProRunChannelData.CurLoadLimit!.Down);
if (!Limit_DownResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Down写入失败");
}
}
break;
case RunStepType.Pid:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Pid
if (!string.IsNullOrEmpty(CurMeterInfo.Pid_PAddress))
{
var Pid_PResult = SiemensDrive.Write(CurMeterInfo.Pid_PAddress, (short)ProRunChannelData.CurLoadPID!.P);
if (!Pid_PResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-P写入失败");
var Pid_IResult = SiemensDrive.Write(CurMeterInfo.Pid_IAddress, (short)ProRunChannelData.CurLoadPID!.I);
if (!Pid_IResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-I写入失败");
var Pid_DResult = SiemensDrive.Write(CurMeterInfo.Pid_DAddress, (short)ProRunChannelData.CurLoadPID!.D);
if (!Pid_DResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:PID-D写入失败");
}
}
break;
case RunStepType.Limit:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Limit
if (!string.IsNullOrEmpty(CurMeterInfo.Limit_UpAddress))
{
var Limit_UpResult = SiemensDrive.Write(CurMeterInfo.Limit_UpAddress, (short)ProRunChannelData.CurLoadLimit!.Up);
if (!Limit_UpResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Up写入失败");
var Limit_DownResult = SiemensDrive.Write(CurMeterInfo.Limit_DownAddress, (short)ProRunChannelData.CurLoadLimit!.Down);
if (!Limit_DownResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:Limit_Down写入失败");
}
}
break;
case RunStepType.SlopCell:
{
var CurMeterInfo = ListPlcLoadConfigCell.FirstOrDefault(a => a.Name!.Contains(ProRunChannelData.MeterName!));
//Sv
var SvResult = SiemensDrive.Write(CurMeterInfo!.SvAddress, (short)ProRunChannelData.SV!);
if (!SvResult.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:SV写入失败");
//速度SV到压缩机
if (ProRunChannelData.IsSpeed) SendSpeedSvToCap(ProRunChannelData.SV);
}
break;
case RunStepType.No:
{
//没有任何动作
}
break;
default:
break;
}
//拓展参数
if (ProRunChannelData.ListStepExd != null && ProRunChannelData.ListStepExd.Count() > 0)
{
foreach (var itemStepExd in ProRunChannelData.ListStepExd)
{
//压缩机使能的参数直接给压缩机触发
if (itemStepExd.Name.Contains("压缩机使能"))
{
CanDriveService.UpdateCapEnableCmdData((bool)itemStepExd.Value);
continue;
}
var DataAdrees = ListPlcExdConfigCell.FirstOrDefault(a => a.Name == itemStepExd.Name);
if (DataAdrees != null)
{
switch (itemStepExd.ValueType)
{
case ExdValueType.Bool:
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);
if (!ResultShort.IsSuccess) Console.WriteLine($"{ProRunChannelData.MeterName}:{itemStepExd.Name}写入失败");
break;
case ExdValueType.Double:
break;
default:
break;
}
}
}
}
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);
//DownLoadPID();
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("保存数据耗时::{0}", stopwatch.Elapsed.TotalSeconds.ToString());
//stopwatch.Reset();
}
}
///
/// 发送速度SV到压缩机
/// 自动步骤数据发送
///
private void SendSpeedSvToCap(int SpeedSv)
{
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
{
case CanLinEnum.Can:
//获取PLC的SV数据 更新SV的速度值到压缩机
if (CanDriveService.CanAutoHand)//自动时步骤的数据可以赋值数据
{
CanDriveService.UpdateSpeedCmdData(SpeedSv);
}
//itemTag.Value.EngPvValue = 0;
break;
case CanLinEnum.Lin:
//获取PLC的SV数据 更新SV的速度值到压缩机
LinDriveService.UpdateSpeedCmdData(SpeedSv);
//itemTag.Value.EngPvValue = 0;
break;
default:
//CanDriveService.UpdateSpeedCmdData(SpeedSv);
break;
}
}
#endregion
}
}