diff --git a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs index 8528ab0..cad2fff 100644 --- a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs +++ b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusDecoder.cs @@ -140,4 +140,43 @@ public static class ModbusDecoder object value = BitUtls.Bytes2Value(bytes, valueType, start, length, scale, round, offset); field.Value = (T)value; } + + public static T DecodeByT(byte[] bytes, T t) where T : class, new() + { + List fields = t.GetType().GetProperties() + .Where(it => it.PropertyType.GetGenericTypeDefinition() == typeof(ModbusProperty<>)) + .Select(p => p.GetValue(t)).ToList(); + + int startRegisterNo = Int32.MaxValue; + foreach (object field in fields) + { + if (field != null) + { + IModbusProperty p = (IModbusProperty)field; + if (startRegisterNo > p.GetRegisterNo()) + { + startRegisterNo = p.GetRegisterNo(); + } + } + } + + foreach (object field in fields) + { + switch (field) + { + case ModbusProperty property: + { + SetPropertyValue(startRegisterNo, property, bytes); + break; + } + case ModbusProperty floatProperty: + { + SetPropertyValue(startRegisterNo, floatProperty, bytes); + break; + } + } + } + + return t; + } } \ No newline at end of file diff --git a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs index ef60ba5..d795efa 100644 --- a/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs +++ b/HybirdFrameworkDriver/ModbusTcpMaster/ModbusTcpMaster.cs @@ -12,6 +12,7 @@ public class ModbusTcpMaster { private static readonly ILog Log = LogManager.GetLogger(typeof(ModbusTcpMaster)); + public string connectId { get; set; } // public string Ip { get; set; } = "127.0.0.1"; public string Ip { get; set; } = "192.168.1.5"; public int Port { get; set; } = 502; @@ -27,7 +28,7 @@ public class ModbusTcpMaster private bool StopFlag { get; set; } = false; - private ModbusTcpNet ModbusTcpNet; + public ModbusTcpNet ModbusTcpNet; ILog GetLog() diff --git a/HybirdFrameworkDriver/ModbusTcpMaster/PlcDate.cs b/HybirdFrameworkDriver/ModbusTcpMaster/PlcDate.cs new file mode 100644 index 0000000..9037c75 --- /dev/null +++ b/HybirdFrameworkDriver/ModbusTcpMaster/PlcDate.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkDriver.ModbusTcpMaster +{ + /// + /// PLC地址 + /// + public class PlcDate + { + /// + /// 写编程使能 + /// + public ModbusProperty ProgrammingEnable { get; set; } = new(40960); + /// + /// 本机modbus地址 + /// + public ModbusProperty Modbus1Addres { get; set; } = new(40962); + /// + /// 波特率 + /// + public ModbusProperty BaudRate { get; set; } = new(40964); + /// + /// 校验位 + /// + public ModbusProperty CheckBit { get; set; } = new(2566); + /// + /// 秒 + /// + public ModbusProperty Seconds { get; set; } = new(0); + /// + /// 分 + /// + public ModbusProperty Points { get; set; } = new(2); + /// + /// 时 + /// + public ModbusProperty When { get; set; } = new(4); + /// + /// 周 + /// + public ModbusProperty Weeks { get; set; } = new(6); + /// + /// 日 + /// + public ModbusProperty Day { get; set; } = new(8); + /// + /// 月 + /// + public ModbusProperty Month { get; set; } = new(10); + /// + /// 年 + /// + public ModbusProperty Years { get; set; } = new(12); + /// + /// 本机modbus地址 + /// + public ModbusProperty Modbus1Addres2 { get; set; } = new(14); + /// + /// 保留 + /// + public ModbusProperty Reserve { get; set; } = new(16); + /// + /// 电压变比 + /// + public ModbusProperty VoltageRatio { get; set; } = new(18); + /// + /// 电流变比 + /// + public ModbusProperty CurrentRatio { get; set; } = new(20); + /// + /// 秒脉冲/无功电能选择 + /// + public ModbusProperty PulsePerSecond { get; set; } = new(42); + /// + /// 电流接线反向 + /// + public ModbusProperty CurrentReversal { get; set; } = new(48); + /// + /// 电表清零 + /// + public ModbusProperty MeterReset { get; set; } = new(4576); + } +} diff --git a/HybirdFrameworkDriver/TcpServer/ModbusSession.cs b/HybirdFrameworkDriver/TcpServer/ModbusSession.cs new file mode 100644 index 0000000..ecf6ed2 --- /dev/null +++ b/HybirdFrameworkDriver/TcpServer/ModbusSession.cs @@ -0,0 +1,40 @@ +using HybirdFrameworkDriver.ModbusTcpMaster; +using log4net; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkDriver.TcpServer +{ + public class ModbusSession + { + private readonly ILog Log = LogManager.GetLogger(typeof(ModbusSession)); + + public ModbusTcpMaster.ModbusTcpMaster ModbusTcpMaster; + private String IpAddr { get; } + public String Key { get; set; } + + public ConcurrentDictionary BusinessMap { get; set; } + public ModbusSession(ModbusTcpMaster.ModbusTcpMaster modbusTcpMaster) + { + this.ModbusTcpMaster = modbusTcpMaster; + this.IpAddr = modbusTcpMaster.Ip; + this.Key = modbusTcpMaster.connectId; + } + + + public bool Write(ModbusProperty property) + { + return ModbusTcpMaster.WriteValue(property); + } + public byte[]? Read(int registerNo, int length) + { + return ModbusTcpMaster.BatchRead(registerNo, length); + } + + + } +} diff --git a/HybirdFrameworkDriver/TcpServer/SessionMgr.cs b/HybirdFrameworkDriver/TcpServer/SessionMgr.cs index da1a56f..facc485 100644 --- a/HybirdFrameworkDriver/TcpServer/SessionMgr.cs +++ b/HybirdFrameworkDriver/TcpServer/SessionMgr.cs @@ -12,6 +12,9 @@ public class SessionMgr private static readonly ConcurrentDictionary Dictionary = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary ModbusDictionary = + new ConcurrentDictionary(); + public static void RegisterSession(string key, IoSession ioSession) { ioSession.Key = key; @@ -35,4 +38,57 @@ public class SessionMgr session.Send(buffer); } } + + public static void RegisterModbusSession(string key, ModbusSession ioSession) + { + var oldKey = ioSession.Key; + if (oldKey != null) + { + ModbusSession? session; + ModbusDictionary.Remove(oldKey, out session); + } + + ioSession.Key = key; + ModbusDictionary.AddOrUpdate(key, ioSession, (k, oldSession) => ioSession); + } + + public static void SetAttrModbus(ModbusSession session, String key, Object obj) + { + if (session.BusinessMap == null) + { + session.BusinessMap = new ConcurrentDictionary(); + } + + session.BusinessMap.TryAdd(key, obj); + } + + public static Object GetAttrModbus(String key, String mapKey) + { + ModbusDictionary.TryGetValue(key, out ModbusSession? session); + + if (session != null) + { + session.BusinessMap.TryGetValue(mapKey, out Object? obj); + + if (obj != null) + { + return (int)obj; + } + } + + return 0; + } + + public static ModbusSession GetModbusSession(string key) + { + if (ModbusDictionary.ContainsKey(key)) + { + ModbusSession value; + ModbusDictionary.TryGetValue(key, out value); + + return value; + } + + return null; + } } \ No newline at end of file diff --git a/HybirdFrameworkEntity/DbModel/BsNetEqmParamInfo.cs b/HybirdFrameworkEntity/DbModel/BsNetEqmParamInfo.cs new file mode 100644 index 0000000..9f9c740 --- /dev/null +++ b/HybirdFrameworkEntity/DbModel/BsNetEqmParamInfo.cs @@ -0,0 +1,59 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkEntity.DbModel +{ + /// + /// 设备连接参数信息字段类 + /// + [SugarTable("t_bs_net_eqm_param_info")] + public partial class BsNetEqmParamInfo + { + /// + /// 索引 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "f_id")] + + public int Id { get; set; } + /// + /// 设备类型编号 + /// + [SugarColumn(ColumnName = "f_eqm_type_no")] + public int EqmTypeNo { get; set; } + /// + /// 设备类型名称 + /// + [SugarColumn(ColumnName = "f_eqm_type_name")] + public string EqmTypeName { get; set; } + /// + /// 设备编码 + /// + [SugarColumn(ColumnName = "f_eqm_code")] + public string EqmCode { get; set; } + /// + /// 设备序号 + /// + [SugarColumn(ColumnName = "f_eqm_sn")] + public int EqmSn { get; set; } + /// + /// 连接地址 + /// + [SugarColumn(ColumnName = "f_net_addr")] + public string NetAddr { get; set; } + /// + /// 连接端口 + /// + [SugarColumn(ColumnName = "f_net_port")] + public string NetPort { get; set; } + /// + /// 目的地址 + /// + [SugarColumn(ColumnName = "f_dest_addr")] + public string DestAddr { get; set; } + } +} diff --git a/HybirdFrameworkRepository/System/BsNetEqmParamInfoRepository.cs b/HybirdFrameworkRepository/System/BsNetEqmParamInfoRepository.cs new file mode 100644 index 0000000..068f682 --- /dev/null +++ b/HybirdFrameworkRepository/System/BsNetEqmParamInfoRepository.cs @@ -0,0 +1,39 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkEntity.DbModel; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkRepository.System +{ + [Scope("SingleInstance")] + public class BsNetEqmParamInfoRepository : BaseRepository + { + private ISqlSugarClient DbBaseClient; + + + public BsNetEqmParamInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) + { + DbBaseClient = sqlSugar; + } + + + public List QueryListByFEqmTypeNo(List fEqmTypeNo) + + { + return DbBaseClient + .Queryable() + .In(t => t.EqmTypeNo, fEqmTypeNo) + .ToList(); + } + + public IEnumerable> QueryConnectParams(List types) + { + List infos = this.QueryListByFEqmTypeNo(types); + return infos.GroupBy(i => i.EqmTypeNo).ToList(); + } + } +} diff --git a/HybirdFrameworkRepository/obj/Debug/net6.0/ref/HybirdFrameworkRepository.dll b/HybirdFrameworkRepository/obj/Debug/net6.0/ref/HybirdFrameworkRepository.dll index 6d7c9c8..70f4b69 100644 Binary files a/HybirdFrameworkRepository/obj/Debug/net6.0/ref/HybirdFrameworkRepository.dll and b/HybirdFrameworkRepository/obj/Debug/net6.0/ref/HybirdFrameworkRepository.dll differ diff --git a/HybirdFrameworkRepository/obj/Debug/net6.0/refint/HybirdFrameworkRepository.dll b/HybirdFrameworkRepository/obj/Debug/net6.0/refint/HybirdFrameworkRepository.dll index 6d7c9c8..70f4b69 100644 Binary files a/HybirdFrameworkRepository/obj/Debug/net6.0/refint/HybirdFrameworkRepository.dll and b/HybirdFrameworkRepository/obj/Debug/net6.0/refint/HybirdFrameworkRepository.dll differ diff --git a/HybirdFrameworkServices/EquipmentInit.cs b/HybirdFrameworkServices/EquipmentInit.cs new file mode 100644 index 0000000..34abf8a --- /dev/null +++ b/HybirdFrameworkServices/EquipmentInit.cs @@ -0,0 +1,165 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkDriver.ModbusTcpMaster; +using HybirdFrameworkDriver.TcpServer; +using HybirdFrameworkEntity.DbModel; +using HybirdFrameworkRepository.System; +using HybirdFrameworkServices.Init.Entity; +using HybirdFrameworkServices.Plc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices +{ + [Scope("SingleInstance")] + public class EquipmentInit + { + BsNetEqmParamInfoRepository _bsNetEqmParamInfoRepository; + public EquipmentInit(BsNetEqmParamInfoRepository bsNetEqmParamInfoRepository) + { + _bsNetEqmParamInfoRepository = bsNetEqmParamInfoRepository; + } + + + /// + /// 连接所有数据 + /// + /// + public void Connect() + { + BsNetEqmParamInfo bsNetEqmParamInfo = new BsNetEqmParamInfo() + { + EqmTypeNo = 3, + EqmTypeName = "", + EqmCode = "", + EqmSn = 3, + NetAddr = "127.0.0.1", + NetPort = "502", + DestAddr = "1", + }; + + + // //PLC删除 + // IEnumerable> queryConnectParams =; + // _bsNetEqmParamInfoRepository.QueryConnectParams(new List() { 1, 2, 101 }); + // int count = 0; + // IEnumerable> connectParams = + //queryConnectParams as IGrouping[] ?? queryConnectParams.ToArray(); + // foreach (IGrouping device in connectParams) + // { + // Console.WriteLine(device.Key); + // count = device.Key switch + // { + // //1 => ConnectCharger(device), + // //101 => ConnectCharger(device), + // //2 => ConnectWaterCooler(device), + // 3 => ConnectPlc(device), + // _ => + // // 处理所有其他情况,可能抛出异常、记录日志或返回默认值 + // throw new InvalidOperationException("Unknown device key: " + device.Key), + // }; + // } + + ConnectPlc(bsNetEqmParamInfo); + } + + /// + /// 连接PLC + /// + /// + /// + public int ConnectPlc(/*IGrouping param*/ BsNetEqmParamInfo p) + { + /*int connectNum = 0; + foreach (var p in param) + { + connectNum++;*/ + + Thread thread = new Thread(() => ConnectPlcAsync(p)); + thread.Start(); + /*}*/ + + return 0; + } + private void ConnectPlcAsync(BsNetEqmParamInfo p) + { + bool connected = false; + + ModbusTcpMaster master = null; + //PLC连接 + while (!connected) + { + + master = new ModbusTcpMaster() + { + Ip = "127.0.0.1", + Port = 102, + }; + master.ReadAction = BatchReadPlc;//启动线程一直读 + master.Duration = 3000; + master.Duration = 3000; + connected = master.Connect(); + + if (connected) + { + break; + } + + Thread.Sleep(5000); + } + + ModbusSession modbusSession = new ModbusSession(master); + SessionMgr.RegisterModbusSession(master.connectId, modbusSession); + SessionMgr.SetAttrModbus(modbusSession, "eqm_sn", p.EqmSn); + PlcInfo waterColdInfo = new PlcInfo(master.connectId, p.EqmSn); + ChargerStaticInfo.PlcInfos.TryAdd(p.EqmSn, waterColdInfo); + } + /** + * 一直读 + */ + private static void BatchReadPlc(ModbusTcpMaster master) + { + int sn = (int)SessionMgr.GetAttrModbus(master.connectId, "eqm_sn"); + + ChargerStaticInfo.PlcInfos.TryGetValue(sn, out PlcInfo plcInfo); + if (plcInfo == null) + { + return; + } + + byte[]? bytes01 = master.BatchRead(0, 22); + if (bytes01 != null) + { + ModbusDecoder.DecodeByT(bytes01, plcInfo.PlcReadAndWritten2); + } + byte[]? bytes02 = master.BatchRead(256, 170); + if (bytes02 != null) + { + ModbusDecoder.DecodeByT(bytes02, plcInfo.PlcReadonly); + } + byte[]? bytes03 = master.BatchRead(39424, 108); + if (bytes03 != null) + { + ModbusDecoder.DecodeByT(bytes03, plcInfo.PlcTurnsRatio); + } + + byte[]? bytes04 = master.BatchRead(40960, 3);//写编程使能。本机modbus地址。波特率 + byte[]? bytes05 = master.BatchRead(2566, 1);//校验位 + byte[]? bytes06 = master.BatchRead(42, 1);//秒脉冲/无功电能选择 + byte[]? bytes07 = master.BatchRead(48, 1);//电流接线反向 + byte[]? bytes08 = master.BatchRead(4576, 1);//电表清零 + + if (bytes04 != null) + { + ModbusDecoder.DecodeByT(bytes04, plcInfo.PlcReadAndWritten1); + } + plcInfo.PlcReadAndWritten1.CheckBit = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes05, 0); + plcInfo.PlcReadAndWritten1.PulsePerSecond = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes06, 0); + plcInfo.PlcReadAndWritten1.CurrentReversal = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes07, 0); + plcInfo.PlcReadAndWritten1.MeterReset = master.ModbusTcpNet.ByteTransform.TransUInt16(bytes08, 0); + + } + } +} diff --git a/HybirdFrameworkServices/HybirdFrameworkServices.csproj b/HybirdFrameworkServices/HybirdFrameworkServices.csproj index b6d54f4..06ca119 100644 --- a/HybirdFrameworkServices/HybirdFrameworkServices.csproj +++ b/HybirdFrameworkServices/HybirdFrameworkServices.csproj @@ -4,6 +4,7 @@ net6.0 enable enable + true diff --git a/HybirdFrameworkServices/Init/Entity/ChargerStaticInfo.cs b/HybirdFrameworkServices/Init/Entity/ChargerStaticInfo.cs new file mode 100644 index 0000000..406905d --- /dev/null +++ b/HybirdFrameworkServices/Init/Entity/ChargerStaticInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Init.Entity +{ + public class ChargerStaticInfo + { + /// + /// PLC管理 + /// + public static readonly ConcurrentDictionary PlcInfos = + new ConcurrentDictionary(); + } +} diff --git a/HybirdFrameworkServices/Init/Entity/ConnectState.cs b/HybirdFrameworkServices/Init/Entity/ConnectState.cs new file mode 100644 index 0000000..a50582f --- /dev/null +++ b/HybirdFrameworkServices/Init/Entity/ConnectState.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Init.Entity +{ + /// + ///PLC连接状态枚举 + /// + public enum ConnectState + { + NOCONNECT = 0, + CONNECTING = 1, + CONNECTED = 2 + } +} diff --git a/HybirdFrameworkServices/Init/Entity/PlcInfo.cs b/HybirdFrameworkServices/Init/Entity/PlcInfo.cs new file mode 100644 index 0000000..8ebc716 --- /dev/null +++ b/HybirdFrameworkServices/Init/Entity/PlcInfo.cs @@ -0,0 +1,78 @@ +using HslCommunication; +using HslCommunication.ModBus; +using HybirdFrameworkDriver.ModbusTcpMaster; +using HybirdFrameworkDriver.TcpServer; +using HybirdFrameworkServices.Plc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Init.Entity +{ + public class PlcInfo + { + #region 字段 + /// + /// ModbusTcp客户端 + /// + //public ModbusTcpNet _client = null; + /// + /// 设备编号 + /// + private string _devNo = "001"; + /// + /// 设备名称 + /// + private string _devname = "换电PLC"; + /// + /// 服务端连接IP + /// + private string _ipaddr = "172.0.20.48"; + /// + /// 服务端连接端口 + /// + private int _port = 502; + /// + /// 站号 + /// + private byte _site = 0x01; + /// + /// 连接超时时间。单位秒 + /// + private int _connecttimeout = 10; + /// + /// 保持活跃时间。单位秒 + /// + private int _keepalive = 30; + /// + /// 连接状态 + /// + private ConnectState _connect_state = ConnectState.NOCONNECT; + #endregion 字段 + + public string ChannelId; + + public int EqmSn; + + public PlcReadAndWrite1 PlcReadAndWritten1 { get; set; } + public PlcReadAndWrite2 PlcReadAndWritten2 { get; set; } + public PlcReadonly PlcReadonly { get; set; } + public PlcTurnsRatio PlcTurnsRatio { get; set; } + + public PlcInfo(string channelId, int eqmSn) + { + ChannelId = channelId; + EqmSn = eqmSn; + } + + public bool WriteUint16(string addr, ModbusProperty value) + { + bool bResult = false; + ModbusSession session = SessionMgr.GetModbusSession(ChannelId); + bResult = session.Write(value); + return bResult; + } + } +} diff --git a/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs b/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs new file mode 100644 index 0000000..9b51cf8 --- /dev/null +++ b/HybirdFrameworkServices/Plc/PlcReadAndWrite1.cs @@ -0,0 +1,66 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Plc +{ + /// + /// 可读可写区 + /// + public class PlcReadAndWrite1 + { + /// + /// 写编程使能 写 0x5AA5,打开写使能 + /// + [Property(0, 2, PropertyReadConstant.Byte)] + public ushort ProgrammingEnable { get; set; } + /// + /// 本机modbus地址 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public ushort Modbus1Addres { get; set; } + /// + /// 波特率 + /// 0:1200 + /// 1:2400 + /// 2:4800 + /// 3:9600 + /// 4:19200 + /// + [Property(4, 2, PropertyReadConstant.Byte)] + public ushort BaudRate { get; set; } + /// + /// 校验位 + /// 0:无 + /// 1:奇 + /// 2:偶 + /// + //[Property(2, 2, PropertyReadConstant.Byte)] + public ushort CheckBit { get; set; } + + /// + /// 秒脉冲/无功电能选择 + /// 0x5A02:秒脉冲输出 + /// 其他:无功电能输出) + /// + //[Property(2, 2, PropertyReadConstant.Byte)] + public ushort PulsePerSecond { get; set; } + /// + /// 电流接线反向 + /// 0x00:不反接(默认值) + /// 0x01:反接 + /// + //[Property(2, 2, PropertyReadConstant.Byte)] + public ushort CurrentReversal { get; set; } + /// + /// 电表清零 + /// 写 0x0000 清零,其他不清 + /// + //[Property(2, 2, PropertyReadConstant.Byte)] + public ushort MeterReset { get; set; } + + } +} diff --git a/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs b/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs new file mode 100644 index 0000000..04a9441 --- /dev/null +++ b/HybirdFrameworkServices/Plc/PlcReadAndWrite2.cs @@ -0,0 +1,68 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HybirdFrameworkServices.Plc +{ + public class PlcReadAndWrite2 + { + /// + /// 秒 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Seconds { get; set; } + /// + /// 分 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Points { get; set; } + /// + /// 时 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte When { get; set; } + /// + /// 周 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Weeks { get; set; } + /// + /// 日 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Day { get; set; } + /// + /// 月 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Month { get; set; } + /// + /// 年 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public byte Years { get; set; } + /// + /// 本机modbus地址 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public ushort Modbus1Addres2 { get; set; } + /// + /// 保留 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public ushort Reserve { get; set; } + /// + /// 电压变比 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public ushort VoltageRatio { get; set; } + /// + /// 电流变比 + /// + [Property(2, 2, PropertyReadConstant.Byte)] + public ushort CurrentRatio { get; set; } + } +} diff --git a/HybirdFrameworkServices/Plc/PlcReadAndWritten.cs b/HybirdFrameworkServices/Plc/PlcReadAndWritten.cs deleted file mode 100644 index 6339886..0000000 --- a/HybirdFrameworkServices/Plc/PlcReadAndWritten.cs +++ /dev/null @@ -1,136 +0,0 @@ -using HybirdFrameworkCore.Autofac.Attribute; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HybirdFrameworkServices.Plc -{ - /// - /// 可读可写区 - /// - public class PlcReadAndWritten - { - /// - /// 写编程使能 写 0x5AA5,打开写使能 - /// - [Property(0, 2, PropertyReadConstant.Byte)] - public ushort ProgrammingEnable { get; set; } - /// - /// 本机modbus地址 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Modbus1Addres { get; set; } - /// - /// 波特率 - /// 0:1200 - /// 1:2400 - /// 2:4800 - /// 3:9600 - /// 4:19200 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort BaudRate { get; set; } - /// - /// 校验位 - /// 0:无 - /// 1:奇 - /// 2:偶 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort CheckBit { get; set; } - /// - /// 秒 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Seconds { get; set; } - /// - /// 分 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Points { get; set; } - /// - /// 时 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte When { get; set; } - /// - /// 周 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Weeks { get; set; } - /// - /// 日 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Day { get; set; } - /// - /// 月 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Month { get; set; } - /// - /// 年 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public byte Years { get; set; } - public string time - { - get - { - return Years + "-" + - Month.ToString().PadLeft(2, '0') + "-" + - Day.ToString().PadLeft(2, '0') + " " + - When.ToString().PadLeft(2, '0') + ":" + - Points.ToString().PadLeft(2, '0') + ":" + - Seconds.ToString().PadLeft(2, '0'); - } - set - { - - } - } - /// - /// 本机modbus地址 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Modbus1Addres2 { get; set; } - /// - /// 保留 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort Reserve { get; set; } - /// - /// 电压变比 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort VoltageRatio { get; set; } - /// - /// 电流变比 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort CurrentRatio { get; set; } - /// - /// 秒脉冲/无功电能选择 - /// 0x5A02:秒脉冲输出 - /// 其他:无功电能输出) - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort PulsePerSecond { get; set; } - /// - /// 电流接线反向 - /// 0x00:不反接(默认值) - /// 0x01:反接 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort CurrentReversal { get; set; } - /// - /// 电表清零 - /// 写 0x0000 清零,其他不清 - /// - [Property(2, 2, PropertyReadConstant.Byte)] - public ushort MeterReset { get; set; } - - } -} diff --git a/HybirdFrameworkServices/Plc/PlcReadonly.cs b/HybirdFrameworkServices/Plc/PlcReadonly.cs index 41be33a..60b2bdb 100644 --- a/HybirdFrameworkServices/Plc/PlcReadonly.cs +++ b/HybirdFrameworkServices/Plc/PlcReadonly.cs @@ -1,4 +1,5 @@ -using System; +using HybirdFrameworkCore.Autofac.Attribute; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -14,351 +15,432 @@ namespace HybirdFrameworkServices.Plc /// /// 组合有功总电能 /// - public float GroupHaveAll { get; set; } + [Property(0, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupHaveAll { get; set; } /// /// 组合有功尖电能 /// + [Property(4, 4, PropertyReadConstant.Byte, 0.01)] public float GroupHaveTip { get; set; } /// /// 组合有功峰电能 /// - public float GroupHavePeak { get; set; } + [Property(8, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupHavePeak { get; set; } /// /// 组合有功平电能 /// - public float GroupHaveFlat { get; set; } + [Property(12, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupHaveFlat { get; set; } /// /// 组合有功谷电能 /// - public float GroupHaveValley { get; set; } + [Property(16, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupHaveValley { get; set; } /// - /// 正向有功总电能 /// - public float ForwardHaveAll { get; set; } + [Property(20, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveAll { get; set; } /// /// 正向有功尖电能 /// - public float ForwardHaveTip { get; set; } + [Property(24, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveTip { get; set; } /// /// 正向有功峰电能 /// - public float ForwardHavePeak { get; set; } + [Property(28, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHavePeak { get; set; } /// /// 正向有功平电能 /// - public float ForwardHaveFlat { get; set; } + [Property(32, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveFlat { get; set; } /// /// 正向有功谷电能 /// - public float ForwardHaveValley { get; set; } + [Property(36, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveValley { get; set; } /// /// 反向有功总电能 /// - public float ReverseHaveAll { get; set; } + [Property(40, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveAll { get; set; } /// /// 反向有功尖电能 /// - public float ReverseHaveTip { get; set; } + [Property(44, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveTip { get; set; } /// /// 反向有功峰电能 /// - public float ReverseHavePeak { get; set; } + [Property(48, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHavePeak { get; set; } /// /// 反向有功平电能 /// - public float ReverseHaveFlat { get; set; } + [Property(52, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveFlat { get; set; } /// /// 反向有功谷电能 /// - public float ReverseHaveValley { get; set; } + [Property(56, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveValley { get; set; } /// /// 组合无功1总电能 /// + [Property(60, 4, PropertyReadConstant.Byte, 0.01)] public float GroupNoAll1 { get; set; } /// /// 组合无功1尖电能 /// - public float GroupNoTip1 { get; set; } + [Property(64, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoTip1 { get; set; } /// /// 组合无功1峰电能 /// - public float GroupNoPeak1 { get; set; } + [Property(68, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoPeak1 { get; set; } /// /// 组合无功1平电能 /// - public float GroupNoFlat1 { get; set; } + [Property(72, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoFlat1 { get; set; } /// /// 组合无功1谷电能 /// - public float GroupNoValley1 { get; set; } + [Property(76, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoValley1 { get; set; } /// /// 组合无功2总电能 /// - public float GroupNoAll2 { get; set; } + [Property(80, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoAll2 { get; set; } /// /// 组合无功2尖电能 /// - public float GroupNoTip2 { get; set; } + [Property(84, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoTip2 { get; set; } /// /// 组合无功2峰电能 /// - public float GroupNoPeak2 { get; set; } + [Property(88, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoPeak2 { get; set; } /// /// 组合无功2平电能 /// - public float GroupNoFlat2 { get; set; } + [Property(92, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoFlat2 { get; set; } /// /// 组合无功2谷电能 /// - public float GroupNoValley2 { get; set; } + [Property(96, 4, PropertyReadConstant.Byte, 0.01)] + public Int32 GroupNoValley2 { get; set; } /// /// 一象限无功总电能 /// - public float QuadrantNoAll1 { get; set; } + [Property(100, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoAll1 { get; set; } /// /// 一象限无功尖电能 /// - public float QuadrantNoTip1 { get; set; } + [Property(104, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoTip1 { get; set; } /// - /// 一象限无功峰电能 /// - public float QuadrantNoPeak1 { get; set; } + [Property(108, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoPeak1 { get; set; } /// /// 一象限无功平电能 /// - public float QuadrantNoFlat1 { get; set; } + [Property(112, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoFlat1 { get; set; } /// - /// 一象限无功谷电能 /// - public float QuadrantNoValley1 { get; set; } + [Property(116, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoValley1 { get; set; } /// /// 二象限无功总电能 /// - public float QuadrantNoAll2 { get; set; } + [Property(120, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoAll2 { get; set; } /// /// 二象限无功尖电能 /// - public float QuadrantNoTip2 { get; set; } + [Property(124, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoTip2 { get; set; } /// /// 二象限无功峰电能 /// - public float QuadrantNoPeak2 { get; set; } + [Property(128, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoPeak2 { get; set; } /// /// 二象限无功平电能 /// - public float QuadrantNoFlat2 { get; set; } + [Property(132, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoFlat2 { get; set; } /// /// 二象限无功谷电能 /// - public float QuadrantNoValley2 { get; set; } + [Property(136, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoValley2 { get; set; } /// /// 三象限无功总电能 /// - public float QuadrantNoAll3 { get; set; } + [Property(140, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoAll3 { get; set; } /// /// 三象限无功尖电能 /// - public float QuadrantNoTip3 { get; set; } + [Property(144, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoTip3 { get; set; } /// /// 三象限无功峰电能 /// - public float QuadrantNoPeak3 { get; set; } + [Property(148, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoPeak3 { get; set; } /// /// 三象限无功平电能 /// - public float QuadrantNoFlat3 { get; set; } + [Property(152, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoFlat3 { get; set; } /// /// 三象限无功谷电能 /// - public float QuadrantNoValley3 { get; set; } + [Property(156, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoValley3 { get; set; } /// /// 四象限无功总电能 /// - public float QuadrantNoAll4 { get; set; } + [Property(160, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoAll4 { get; set; } /// /// 四象限无功尖电能 /// - public float QuadrantNoTip4 { get; set; } + [Property(164, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoTip4 { get; set; } /// /// 四象限无功峰电能 /// - public float QuadrantNoPeak4 { get; set; } + [Property(168, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoPeak4 { get; set; } /// /// 四象限无功平电能 /// - public float QuadrantNoFlat4 { get; set; } + [Property(172, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoFlat4 { get; set; } /// /// 四象限无功谷电能 /// - public float QuadrantNoValley4 { get; set; } + [Property(176, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 QuadrantNoValley4 { get; set; } /// /// 正向视在总电能 /// - public float ForwardHaveApparentAll { get; set; } + [Property(180, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveApparentAll { get; set; } /// /// 正向视在尖电能 /// - public float ForwardHaveApparentTip { get; set; } + [Property(184, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveApparentTip { get; set; } /// /// 正向视在峰电能 /// - public float ForwardHaveApparentPeak { get; set; } + [Property(188, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveApparentPeak { get; set; } /// /// 正向视在平电能 /// - public float ForwardHaveApparentFlat { get; set; } + [Property(192, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveApparentFlat { get; set; } /// /// 正向视在谷电能 /// - public float ForwardHaveApparentValley { get; set; } + [Property(196, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ForwardHaveApparentValley { get; set; } /// /// 反向视在总电能 /// - public float ReverseHaveApparentAll { get; set; } + [Property(200, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveApparentAll { get; set; } /// /// 反向视在尖电能 /// - public float ReverseHaveApparentTip { get; set; } + [Property(204, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveApparentTip { get; set; } /// /// 反向视在峰电能 /// - public float ReverseHaveApparentPeak { get; set; } + [Property(208, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveApparentPeak { get; set; } /// /// 反向视在平电能 /// - public float ReverseHaveApparentFlat { get; set; } + [Property(212, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveApparentFlat { get; set; } /// /// 反向视在谷电能 /// - public float ReverseHaveApparentValley { get; set; } + [Property(216, 4, PropertyReadConstant.Byte, 0.01)] + public UInt32 ReverseHaveApparentValley { get; set; } /// /// A 相电压 /// - public float PhaseVoltageA { get; set; } + [Property(220, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseVoltageA { get; set; } /// /// B 相电压 /// - public float PhaseVoltageB { get; set; } + [Property(224, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseVoltageB { get; set; } /// /// C 相电压 /// - public float PhaseVoltageC { get; set; } + [Property(228, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseVoltageC { get; set; } /// /// A 相电流 /// - public float PhaseElectricityA { get; set; } + [Property(232, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseElectricityA { get; set; } /// /// B 相电流 /// - public float PhaseElectricityB { get; set; } + [Property(236, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseElectricityB { get; set; } /// /// C 相电流 /// - public float PhaseElectricityC { get; set; } + [Property(240, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 PhaseElectricityC { get; set; } /// /// 有功总功率 /// - public float TotalActivePower { get; set; } + [Property(244, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalActivePower { get; set; } /// /// A 相有功总功率 /// - public float TotalActivePowerA { get; set; } + [Property(248, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalActivePowerA { get; set; } /// /// B 相有功总功率 /// - public float TotalActivePowerB { get; set; } + [Property(252, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalActivePowerB { get; set; } /// /// C 相有功总功率 /// - public float TotalActivePowerC { get; set; } + [Property(256, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalActivePowerC { get; set; } /// /// 无功总功率 /// - public float TotalReactivePower { get; set; } + [Property(260, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalReactivePower { get; set; } /// /// A 相无功总功率 /// - public float TotalReactivePowerA { get; set; } + [Property(264, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalReactivePowerA { get; set; } /// /// B 相无功总功率 /// - public float TotalReactivePowerB { get; set; } + [Property(268, 4, PropertyReadConstant.Byte, 0.0001)] + public Int32 TotalReactivePowerB { get; set; } /// /// C 相无功总功率 /// - public float TotalReactivePowerC { get; set; } + [Property(272, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 TotalReactivePowerC { get; set; } /// /// 总视在功率 /// - public float TotalApparentPower { get; set; } + [Property(276, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 TotalApparentPower { get; set; } /// /// A 相视在功率 /// - public float TotalApparentPowerA { get; set; } + [Property(280, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 TotalApparentPowerA { get; set; } /// /// B 相视在功率 /// - public float TotalApparentPowerB { get; set; } + [Property(284, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 TotalApparentPowerB { get; set; } /// /// C 相视在功率 /// - public float TotalApparentPowerC { get; set; } + [Property(288, 4, PropertyReadConstant.Byte, 0.0001)] + public UInt32 TotalApparentPowerC { get; set; } /// /// 总功率因数 /// + [Property(292, 2, PropertyReadConstant.Byte, 0.001)] public short OverallPowerFactor { get; set; } /// - /// A 相功率因数 /// + [Property(294, 2, PropertyReadConstant.Byte, 0.001)] public short OverallPowerFactorA { get; set; } /// /// B 相功率因数 /// + [Property(296, 2, PropertyReadConstant.Byte, 0.001)] public short OverallPowerFactorB { get; set; } /// /// C 相功率因数 /// + [Property(298, 2, PropertyReadConstant.Byte, 0.001)] public short OverallPowerFactorC { get; set; } /// /// A 相相角 /// + [Property(300, 2, PropertyReadConstant.Byte, 0.01)] public ushort PhaseAngleA { get; set; } /// - /// B 相相角 /// + [Property(302, 2, PropertyReadConstant.Byte, 0.01)] public ushort PhaseAngleB { get; set; } /// /// C 相相角 /// + [Property(304, 2, PropertyReadConstant.Byte, 0.01)] public ushort PhaseAngleC { get; set; } /// /// 电网频率 /// + [Property(306, 2, PropertyReadConstant.Byte, 0.01)] public ushort LineFrequency { get; set; } /// /// A 相线电压 /// + [Property(308, 4, PropertyReadConstant.Byte, 0.0001)] public float PhaseLineVoltageA { get; set; } /// /// B 相线电压 /// + [Property(312, 4, PropertyReadConstant.Byte, 0.0001)] public float PhaseLineVoltageB { get; set; } /// /// C 相线电压 /// + [Property(316, 4, PropertyReadConstant.Byte, 0.0001)] public float PhaseLineVoltageC { get; set; } /// /// 三相平均线电压 /// + [Property(320, 4, PropertyReadConstant.Byte, 0.0001)] public float ThreePhaseMeanLineVoltage { get; set; } /// /// 三相平均相电压 /// + [Property(324, 4, PropertyReadConstant.Byte, 0.0001)] public float ThreePhaseMeanPhaseVoltage { get; set; } } } diff --git a/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs b/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs index 40b9140..975690a 100644 --- a/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs +++ b/HybirdFrameworkServices/Plc/PlcTurnsRatio.cs @@ -1,4 +1,5 @@ -using System; +using HybirdFrameworkCore.Autofac.Attribute; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -14,225 +15,277 @@ namespace HybirdFrameworkServices.Plc /// /// 组合有功总电能 /// + [Property(0, 4, PropertyReadConstant.Byte)] public float GroupHaveAll { get; set; } /// /// 组合有功尖电能 /// + [Property(4, 4, PropertyReadConstant.Byte)] public float GroupHaveTip { get; set; } /// /// 组合有功峰电能 /// + [Property(8, 4, PropertyReadConstant.Byte)] public float GroupHavePeak { get; set; } /// /// 组合有功平电能 /// + [Property(12, 4, PropertyReadConstant.Byte)] public float GroupHaveFlat { get; set; } /// /// 组合有功谷电能 /// + [Property(16, 4, PropertyReadConstant.Byte)] public float GroupHaveValley { get; set; } /// - /// 正向有功总电能 /// + [Property(20, 4, PropertyReadConstant.Byte)] public float ForwardHaveAll { get; set; } /// /// 正向有功尖电能 /// + [Property(24, 4, PropertyReadConstant.Byte)] public float ForwardHaveTip { get; set; } /// /// 正向有功峰电能 /// + [Property(28, 4, PropertyReadConstant.Byte)] public float ForwardHavePeak { get; set; } /// /// 正向有功平电能 /// + [Property(32, 4, PropertyReadConstant.Byte)] public float ForwardHaveFlat { get; set; } /// /// 正向有功谷电能 /// + [Property(36, 4, PropertyReadConstant.Byte)] public float ForwardHaveValley { get; set; } /// /// 反向有功总电能 /// + [Property(40, 4, PropertyReadConstant.Byte)] public float ReverseHaveAll { get; set; } /// /// 反向有功尖电能 /// + [Property(44, 4, PropertyReadConstant.Byte)] public float ReverseHaveTip { get; set; } /// /// 反向有功峰电能 /// + [Property(48, 4, PropertyReadConstant.Byte)] public float ReverseHavePeak { get; set; } /// /// 反向有功平电能 /// + [Property(52, 4, PropertyReadConstant.Byte)] public float ReverseHaveFlat { get; set; } /// /// 反向有功谷电能 /// + [Property(56, 4, PropertyReadConstant.Byte)] public float ReverseHaveValley { get; set; } /// /// 组合无功1总电能 /// + [Property(60, 4, PropertyReadConstant.Byte)] public float GroupNoAll1 { get; set; } /// /// 组合无功1尖电能 /// + [Property(64, 4, PropertyReadConstant.Byte)] public float GroupNoTip1 { get; set; } /// /// 组合无功1峰电能 /// + [Property(68, 4, PropertyReadConstant.Byte)] public float GroupNoPeak1 { get; set; } /// /// 组合无功1平电能 /// + [Property(72, 4, PropertyReadConstant.Byte)] public float GroupNoFlat1 { get; set; } /// /// 组合无功1谷电能 /// + [Property(76, 4, PropertyReadConstant.Byte)] public float GroupNoValley1 { get; set; } /// /// 组合无功2总电能 /// + [Property(80, 4, PropertyReadConstant.Byte)] public float GroupNoAll2 { get; set; } /// /// 组合无功2尖电能 /// + [Property(84, 4, PropertyReadConstant.Byte)] public float GroupNoTip2 { get; set; } /// /// 组合无功2峰电能 /// + [Property(88, 4, PropertyReadConstant.Byte)] public float GroupNoPeak2 { get; set; } /// /// 组合无功2平电能 /// + [Property(92, 4, PropertyReadConstant.Byte)] public float GroupNoFlat2 { get; set; } /// /// 组合无功2谷电能 /// + [Property(96, 4, PropertyReadConstant.Byte)] public float GroupNoValley2 { get; set; } /// /// 一象限无功总电能 /// + [Property(100, 4, PropertyReadConstant.Byte)] public float QuadrantNoAll1 { get; set; } /// /// 一象限无功尖电能 /// + [Property(104, 4, PropertyReadConstant.Byte)] public float QuadrantNoTip1 { get; set; } /// - /// 一象限无功峰电能 /// + [Property(108, 4, PropertyReadConstant.Byte)] public float QuadrantNoPeak1 { get; set; } /// /// 一象限无功平电能 /// + [Property(112, 4, PropertyReadConstant.Byte)] public float QuadrantNoFlat1 { get; set; } /// - /// 一象限无功谷电能 /// + [Property(116, 4, PropertyReadConstant.Byte)] public float QuadrantNoValley1 { get; set; } /// /// 二象限无功总电能 /// + [Property(120, 4, PropertyReadConstant.Byte)] public float QuadrantNoAll2 { get; set; } /// /// 二象限无功尖电能 /// + [Property(124, 4, PropertyReadConstant.Byte)] public float QuadrantNoTip2 { get; set; } /// /// 二象限无功峰电能 /// + [Property(128, 4, PropertyReadConstant.Byte)] public float QuadrantNoPeak2 { get; set; } /// /// 二象限无功平电能 /// + [Property(132, 4, PropertyReadConstant.Byte)] public float QuadrantNoFlat2 { get; set; } /// /// 二象限无功谷电能 /// + [Property(136, 4, PropertyReadConstant.Byte)] public float QuadrantNoValley2 { get; set; } /// /// 三象限无功总电能 /// + [Property(140, 4, PropertyReadConstant.Byte)] public float QuadrantNoAll3 { get; set; } /// /// 三象限无功尖电能 /// + [Property(144, 4, PropertyReadConstant.Byte)] public float QuadrantNoTip3 { get; set; } /// /// 三象限无功峰电能 /// + [Property(148, 4, PropertyReadConstant.Byte)] public float QuadrantNoPeak3 { get; set; } /// /// 三象限无功平电能 /// + [Property(152, 4, PropertyReadConstant.Byte)] public float QuadrantNoFlat3 { get; set; } /// /// 三象限无功谷电能 /// + [Property(156, 4, PropertyReadConstant.Byte)] public float QuadrantNoValley3 { get; set; } /// /// 四象限无功总电能 /// + [Property(160, 4, PropertyReadConstant.Byte)] public float QuadrantNoAll4 { get; set; } /// /// 四象限无功尖电能 /// + [Property(164, 4, PropertyReadConstant.Byte)] public float QuadrantNoTip4 { get; set; } /// /// 四象限无功峰电能 /// + [Property(168, 4, PropertyReadConstant.Byte)] public float QuadrantNoPeak4 { get; set; } /// /// 四象限无功平电能 /// + [Property(172, 4, PropertyReadConstant.Byte)] public float QuadrantNoFlat4 { get; set; } /// /// 四象限无功谷电能 /// + [Property(176, 4, PropertyReadConstant.Byte)] public float QuadrantNoValley4 { get; set; } /// /// 正向视在总电能 /// + [Property(180, 4, PropertyReadConstant.Byte)] public float ForwardHaveApparentAll { get; set; } /// /// 正向视在尖电能 /// + [Property(184, 4, PropertyReadConstant.Byte)] public float ForwardHaveApparentTip { get; set; } /// /// 正向视在峰电能 /// + [Property(188, 4, PropertyReadConstant.Byte)] public float ForwardHaveApparentPeak { get; set; } /// /// 正向视在平电能 /// + [Property(192, 4, PropertyReadConstant.Byte)] public float ForwardHaveApparentFlat { get; set; } /// /// 正向视在谷电能 /// + [Property(196, 4, PropertyReadConstant.Byte)] public float ForwardHaveApparentValley { get; set; } /// /// 反向视在总电能 /// + [Property(200, 4, PropertyReadConstant.Byte)] public float ReverseHaveApparentAll { get; set; } /// /// 反向视在尖电能 /// + [Property(204, 4, PropertyReadConstant.Byte)] public float ReverseHaveApparentTip { get; set; } /// /// 反向视在峰电能 /// + [Property(208, 4, PropertyReadConstant.Byte)] public float ReverseHaveApparentPeak { get; set; } /// /// 反向视在平电能 /// + [Property(212, 4, PropertyReadConstant.Byte)] public float ReverseHaveApparentFlat { get; set; } /// /// 反向视在谷电能 /// + [Property(216, 4, PropertyReadConstant.Byte)] public float ReverseHaveApparentValley { get; set; } } } diff --git a/WinFormStarter/FrmPLCConnect.Designer.cs b/WinFormStarter/FrmPLCConnect.Designer.cs index c19f7af..969f8cc 100644 --- a/WinFormStarter/FrmPLCConnect.Designer.cs +++ b/WinFormStarter/FrmPLCConnect.Designer.cs @@ -28,17 +28,17 @@ /// private void InitializeComponent() { - button18 = new Button(); - textBox20 = new TextBox(); + BtnWrite18 = new Button(); + textBox18 = new TextBox(); label18 = new Label(); - button17 = new Button(); - textBox19 = new TextBox(); + BtnWrite17 = new Button(); + textBox17 = new TextBox(); label17 = new Label(); - button16 = new Button(); - textBox18 = new TextBox(); + BtnWrite16 = new Button(); + textBox16 = new TextBox(); label16 = new Label(); - button15 = new Button(); - textBox17 = new TextBox(); + BtnWrite15 = new Button(); + textBox15 = new TextBox(); label15 = new Label(); groupBox1 = new GroupBox(); BtnCollectionAssignment = new Button(); @@ -50,50 +50,79 @@ BtnConnect = new Button(); TxtPort = new TextBox(); TxtIp = new TextBox(); - button14 = new Button(); + BtnWrite14 = new Button(); textBox14 = new TextBox(); label14 = new Label(); - button13 = new Button(); + BtnWrite13 = new Button(); textBox13 = new TextBox(); label13 = new Label(); - button12 = new Button(); + BtnWrite12 = new Button(); textBox12 = new TextBox(); label12 = new Label(); - button11 = new Button(); + BtnWrite11 = new Button(); textBox11 = new TextBox(); label11 = new Label(); - button10 = new Button(); + BtnWrite10 = new Button(); textBox10 = new TextBox(); label10 = new Label(); - button9 = new Button(); + BtnWrite09 = new Button(); textBox9 = new TextBox(); label9 = new Label(); - button8 = new Button(); + BtnWrite08 = new Button(); textBox8 = new TextBox(); label8 = new Label(); - button7 = new Button(); + BtnWrite07 = new Button(); textBox7 = new TextBox(); label7 = new Label(); - button6 = new Button(); + BtnWrite06 = new Button(); textBox6 = new TextBox(); label6 = new Label(); - button5 = new Button(); + BtnWrite05 = new Button(); textBox5 = new TextBox(); label5 = new Label(); - button4 = new Button(); + BtnWrite04 = new Button(); textBox4 = new TextBox(); label4 = new Label(); - button3 = new Button(); + BtnWrite03 = new Button(); textBox3 = new TextBox(); label3 = new Label(); - button2 = new Button(); + BtnWrite02 = new Button(); textBox2 = new TextBox(); label2 = new Label(); - button1 = new Button(); + BtnWrite01 = new Button(); textBox1 = new TextBox(); label1 = new Label(); groupBox2 = new GroupBox(); groupBox3 = new GroupBox(); + BtnToggle = new Button(); + label186 = new Label(); + label187 = new Label(); + label188 = new Label(); + label189 = new Label(); + label190 = new Label(); + label191 = new Label(); + label192 = new Label(); + label193 = new Label(); + label176 = new Label(); + label177 = new Label(); + label178 = new Label(); + label179 = new Label(); + label180 = new Label(); + label181 = new Label(); + label182 = new Label(); + label183 = new Label(); + label184 = new Label(); + label185 = new Label(); + label142 = new Label(); + label143 = new Label(); + label152 = new Label(); + label153 = new Label(); + label162 = new Label(); + label163 = new Label(); + label174 = new Label(); + label175 = new Label(); + label172 = new Label(); + label173 = new Label(); label164 = new Label(); label165 = new Label(); label166 = new Label(); @@ -238,55 +267,27 @@ label25 = new Label(); label23 = new Label(); label19 = new Label(); - BtnToggle = new Button(); - label172 = new Label(); - label173 = new Label(); - label142 = new Label(); - label143 = new Label(); - label152 = new Label(); - label153 = new Label(); - label162 = new Label(); - label163 = new Label(); - label174 = new Label(); - label175 = new Label(); - label176 = new Label(); - label177 = new Label(); - label178 = new Label(); - label179 = new Label(); - label180 = new Label(); - label181 = new Label(); - label182 = new Label(); - label183 = new Label(); - label184 = new Label(); - label185 = new Label(); - label186 = new Label(); - label187 = new Label(); - label188 = new Label(); - label189 = new Label(); - label190 = new Label(); - label191 = new Label(); - label192 = new Label(); - label193 = new Label(); groupBox1.SuspendLayout(); groupBox2.SuspendLayout(); groupBox3.SuspendLayout(); SuspendLayout(); // - // button18 + // BtnWrite18 // - button18.Location = new Point(1040, 210); - button18.Name = "button18"; - button18.Size = new Size(94, 29); - button18.TabIndex = 171; - button18.Text = "写"; - button18.UseVisualStyleBackColor = true; + BtnWrite18.Location = new Point(1040, 210); + BtnWrite18.Name = "BtnWrite18"; + BtnWrite18.Size = new Size(94, 29); + BtnWrite18.TabIndex = 171; + BtnWrite18.Text = "写"; + BtnWrite18.UseVisualStyleBackColor = true; + BtnWrite18.Click += BtnWrite18_Click; // - // textBox20 + // textBox18 // - textBox20.Location = new Point(880, 211); - textBox20.Name = "textBox20"; - textBox20.Size = new Size(125, 27); - textBox20.TabIndex = 170; + textBox18.Location = new Point(880, 211); + textBox18.Name = "textBox18"; + textBox18.Size = new Size(125, 27); + textBox18.TabIndex = 170; // // label18 // @@ -297,21 +298,22 @@ label18.TabIndex = 169; label18.Text = "电表清零"; // - // button17 + // BtnWrite17 // - button17.Location = new Point(655, 209); - button17.Name = "button17"; - button17.Size = new Size(94, 29); - button17.TabIndex = 168; - button17.Text = "写"; - button17.UseVisualStyleBackColor = true; + BtnWrite17.Location = new Point(655, 209); + BtnWrite17.Name = "BtnWrite17"; + BtnWrite17.Size = new Size(94, 29); + BtnWrite17.TabIndex = 168; + BtnWrite17.Text = "写"; + BtnWrite17.UseVisualStyleBackColor = true; + BtnWrite17.Click += BtnWrite17_Click; // - // textBox19 + // textBox17 // - textBox19.Location = new Point(495, 210); - textBox19.Name = "textBox19"; - textBox19.Size = new Size(125, 27); - textBox19.TabIndex = 167; + textBox17.Location = new Point(495, 210); + textBox17.Name = "textBox17"; + textBox17.Size = new Size(125, 27); + textBox17.TabIndex = 167; // // label17 // @@ -322,21 +324,22 @@ label17.TabIndex = 166; label17.Text = "电流接线反向"; // - // button16 + // BtnWrite16 // - button16.Location = new Point(255, 212); - button16.Name = "button16"; - button16.Size = new Size(94, 29); - button16.TabIndex = 165; - button16.Text = "写"; - button16.UseVisualStyleBackColor = true; + BtnWrite16.Location = new Point(255, 212); + BtnWrite16.Name = "BtnWrite16"; + BtnWrite16.Size = new Size(94, 29); + BtnWrite16.TabIndex = 165; + BtnWrite16.Text = "写"; + BtnWrite16.UseVisualStyleBackColor = true; + BtnWrite16.Click += BtnWrite16_Click; // - // textBox18 + // textBox16 // - textBox18.Location = new Point(95, 213); - textBox18.Name = "textBox18"; - textBox18.Size = new Size(125, 27); - textBox18.TabIndex = 164; + textBox16.Location = new Point(95, 213); + textBox16.Name = "textBox16"; + textBox16.Size = new Size(125, 27); + textBox16.TabIndex = 164; // // label16 // @@ -347,21 +350,22 @@ label16.TabIndex = 163; label16.Text = "秒脉冲/无功电能选择"; // - // button15 + // BtnWrite15 // - button15.Location = new Point(1040, 177); - button15.Name = "button15"; - button15.Size = new Size(94, 29); - button15.TabIndex = 162; - button15.Text = "写"; - button15.UseVisualStyleBackColor = true; + BtnWrite15.Location = new Point(1040, 177); + BtnWrite15.Name = "BtnWrite15"; + BtnWrite15.Size = new Size(94, 29); + BtnWrite15.TabIndex = 162; + BtnWrite15.Text = "写"; + BtnWrite15.UseVisualStyleBackColor = true; + BtnWrite15.Click += BtnWrite15_Click; // - // textBox17 + // textBox15 // - textBox17.Location = new Point(880, 178); - textBox17.Name = "textBox17"; - textBox17.Size = new Size(125, 27); - textBox17.TabIndex = 161; + textBox15.Location = new Point(880, 178); + textBox15.Name = "textBox15"; + textBox15.Size = new Size(125, 27); + textBox15.TabIndex = 161; // // label15 // @@ -468,14 +472,15 @@ TxtIp.Size = new Size(125, 27); TxtIp.TabIndex = 0; // - // button14 + // BtnWrite14 // - button14.Location = new Point(655, 176); - button14.Name = "button14"; - button14.Size = new Size(94, 29); - button14.TabIndex = 158; - button14.Text = "写"; - button14.UseVisualStyleBackColor = true; + BtnWrite14.Location = new Point(655, 176); + BtnWrite14.Name = "BtnWrite14"; + BtnWrite14.Size = new Size(94, 29); + BtnWrite14.TabIndex = 158; + BtnWrite14.Text = "写"; + BtnWrite14.UseVisualStyleBackColor = true; + BtnWrite14.Click += BtnWrite14_Click; // // textBox14 // @@ -493,14 +498,15 @@ label14.TabIndex = 156; label14.Text = "电压变比"; // - // button13 + // BtnWrite13 // - button13.Location = new Point(255, 175); - button13.Name = "button13"; - button13.Size = new Size(94, 29); - button13.TabIndex = 155; - button13.Text = "写"; - button13.UseVisualStyleBackColor = true; + BtnWrite13.Location = new Point(255, 175); + BtnWrite13.Name = "BtnWrite13"; + BtnWrite13.Size = new Size(94, 29); + BtnWrite13.TabIndex = 155; + BtnWrite13.Text = "写"; + BtnWrite13.UseVisualStyleBackColor = true; + BtnWrite13.Click += BtnWrite13_Click; // // textBox13 // @@ -518,14 +524,15 @@ label13.TabIndex = 153; label13.Text = "保留"; // - // button12 + // BtnWrite12 // - button12.Location = new Point(1040, 144); - button12.Name = "button12"; - button12.Size = new Size(94, 29); - button12.TabIndex = 152; - button12.Text = "写"; - button12.UseVisualStyleBackColor = true; + BtnWrite12.Location = new Point(1040, 144); + BtnWrite12.Name = "BtnWrite12"; + BtnWrite12.Size = new Size(94, 29); + BtnWrite12.TabIndex = 152; + BtnWrite12.Text = "写"; + BtnWrite12.UseVisualStyleBackColor = true; + BtnWrite12.Click += BtnWrite12_Click; // // textBox12 // @@ -543,14 +550,15 @@ label12.TabIndex = 150; label12.Text = "本机modbus地址"; // - // button11 + // BtnWrite11 // - button11.Location = new Point(655, 144); - button11.Name = "button11"; - button11.Size = new Size(94, 29); - button11.TabIndex = 149; - button11.Text = "写"; - button11.UseVisualStyleBackColor = true; + BtnWrite11.Location = new Point(655, 144); + BtnWrite11.Name = "BtnWrite11"; + BtnWrite11.Size = new Size(94, 29); + BtnWrite11.TabIndex = 149; + BtnWrite11.Text = "写"; + BtnWrite11.UseVisualStyleBackColor = true; + BtnWrite11.Click += BtnWrite11_Click; // // textBox11 // @@ -568,14 +576,15 @@ label11.TabIndex = 147; label11.Text = "年"; // - // button10 + // BtnWrite10 // - button10.Location = new Point(255, 143); - button10.Name = "button10"; - button10.Size = new Size(94, 29); - button10.TabIndex = 146; - button10.Text = "写"; - button10.UseVisualStyleBackColor = true; + BtnWrite10.Location = new Point(255, 143); + BtnWrite10.Name = "BtnWrite10"; + BtnWrite10.Size = new Size(94, 29); + BtnWrite10.TabIndex = 146; + BtnWrite10.Text = "写"; + BtnWrite10.UseVisualStyleBackColor = true; + BtnWrite10.Click += BtnWrite10_Click; // // textBox10 // @@ -593,14 +602,15 @@ label10.TabIndex = 144; label10.Text = "月"; // - // button9 + // BtnWrite09 // - button9.Location = new Point(1040, 110); - button9.Name = "button9"; - button9.Size = new Size(94, 29); - button9.TabIndex = 143; - button9.Text = "写"; - button9.UseVisualStyleBackColor = true; + BtnWrite09.Location = new Point(1040, 110); + BtnWrite09.Name = "BtnWrite09"; + BtnWrite09.Size = new Size(94, 29); + BtnWrite09.TabIndex = 143; + BtnWrite09.Text = "写"; + BtnWrite09.UseVisualStyleBackColor = true; + BtnWrite09.Click += BtnWrite09_Click; // // textBox9 // @@ -618,14 +628,15 @@ label9.TabIndex = 141; label9.Text = "日"; // - // button8 + // BtnWrite08 // - button8.Location = new Point(655, 109); - button8.Name = "button8"; - button8.Size = new Size(94, 29); - button8.TabIndex = 140; - button8.Text = "写"; - button8.UseVisualStyleBackColor = true; + BtnWrite08.Location = new Point(655, 109); + BtnWrite08.Name = "BtnWrite08"; + BtnWrite08.Size = new Size(94, 29); + BtnWrite08.TabIndex = 140; + BtnWrite08.Text = "写"; + BtnWrite08.UseVisualStyleBackColor = true; + BtnWrite08.Click += BtnWrite08_Click; // // textBox8 // @@ -643,14 +654,15 @@ label8.TabIndex = 138; label8.Text = "周"; // - // button7 + // BtnWrite07 // - button7.Location = new Point(255, 108); - button7.Name = "button7"; - button7.Size = new Size(94, 29); - button7.TabIndex = 137; - button7.Text = "写"; - button7.UseVisualStyleBackColor = true; + BtnWrite07.Location = new Point(255, 108); + BtnWrite07.Name = "BtnWrite07"; + BtnWrite07.Size = new Size(94, 29); + BtnWrite07.TabIndex = 137; + BtnWrite07.Text = "写"; + BtnWrite07.UseVisualStyleBackColor = true; + BtnWrite07.Click += BtnWrite07_Click; // // textBox7 // @@ -668,14 +680,15 @@ label7.TabIndex = 135; label7.Text = "时"; // - // button6 + // BtnWrite06 // - button6.Location = new Point(1040, 77); - button6.Name = "button6"; - button6.Size = new Size(94, 29); - button6.TabIndex = 134; - button6.Text = "写"; - button6.UseVisualStyleBackColor = true; + BtnWrite06.Location = new Point(1040, 77); + BtnWrite06.Name = "BtnWrite06"; + BtnWrite06.Size = new Size(94, 29); + BtnWrite06.TabIndex = 134; + BtnWrite06.Text = "写"; + BtnWrite06.UseVisualStyleBackColor = true; + BtnWrite06.Click += BtnWrite06_Click; // // textBox6 // @@ -693,14 +706,15 @@ label6.TabIndex = 132; label6.Text = "分"; // - // button5 + // BtnWrite05 // - button5.Location = new Point(655, 76); - button5.Name = "button5"; - button5.Size = new Size(94, 29); - button5.TabIndex = 131; - button5.Text = "写"; - button5.UseVisualStyleBackColor = true; + BtnWrite05.Location = new Point(655, 76); + BtnWrite05.Name = "BtnWrite05"; + BtnWrite05.Size = new Size(94, 29); + BtnWrite05.TabIndex = 131; + BtnWrite05.Text = "写"; + BtnWrite05.UseVisualStyleBackColor = true; + BtnWrite05.Click += BtnWrite05_Click; // // textBox5 // @@ -718,14 +732,15 @@ label5.TabIndex = 129; label5.Text = "秒"; // - // button4 + // BtnWrite04 // - button4.Location = new Point(255, 75); - button4.Name = "button4"; - button4.Size = new Size(94, 29); - button4.TabIndex = 128; - button4.Text = "写"; - button4.UseVisualStyleBackColor = true; + BtnWrite04.Location = new Point(255, 75); + BtnWrite04.Name = "BtnWrite04"; + BtnWrite04.Size = new Size(94, 29); + BtnWrite04.TabIndex = 128; + BtnWrite04.Text = "写"; + BtnWrite04.UseVisualStyleBackColor = true; + BtnWrite04.Click += BtnWrite04_Click; // // textBox4 // @@ -743,14 +758,15 @@ label4.TabIndex = 126; label4.Text = "校验位"; // - // button3 + // BtnWrite03 // - button3.Location = new Point(1040, 42); - button3.Name = "button3"; - button3.Size = new Size(94, 29); - button3.TabIndex = 125; - button3.Text = "写"; - button3.UseVisualStyleBackColor = true; + BtnWrite03.Location = new Point(1040, 42); + BtnWrite03.Name = "BtnWrite03"; + BtnWrite03.Size = new Size(94, 29); + BtnWrite03.TabIndex = 125; + BtnWrite03.Text = "写"; + BtnWrite03.UseVisualStyleBackColor = true; + BtnWrite03.Click += BtnWrite03_Click; // // textBox3 // @@ -768,14 +784,15 @@ label3.TabIndex = 123; label3.Text = "波特率"; // - // button2 + // BtnWrite02 // - button2.Location = new Point(655, 41); - button2.Name = "button2"; - button2.Size = new Size(94, 29); - button2.TabIndex = 122; - button2.Text = "写"; - button2.UseVisualStyleBackColor = true; + BtnWrite02.Location = new Point(655, 41); + BtnWrite02.Name = "BtnWrite02"; + BtnWrite02.Size = new Size(94, 29); + BtnWrite02.TabIndex = 122; + BtnWrite02.Text = "写"; + BtnWrite02.UseVisualStyleBackColor = true; + BtnWrite02.Click += BtnWrite02_Click; // // textBox2 // @@ -793,14 +810,15 @@ label2.TabIndex = 120; label2.Text = "本机modbus地址"; // - // button1 + // BtnWrite01 // - button1.Location = new Point(255, 40); - button1.Name = "button1"; - button1.Size = new Size(94, 29); - button1.TabIndex = 119; - button1.Text = "写"; - button1.UseVisualStyleBackColor = true; + BtnWrite01.Location = new Point(255, 40); + BtnWrite01.Name = "BtnWrite01"; + BtnWrite01.Size = new Size(94, 29); + BtnWrite01.TabIndex = 119; + BtnWrite01.Text = "写"; + BtnWrite01.UseVisualStyleBackColor = true; + BtnWrite01.Click += BtnWrite01_Click; // // textBox1 // @@ -824,54 +842,54 @@ groupBox2.Controls.Add(textBox12); groupBox2.Controls.Add(label12); groupBox2.Controls.Add(textBox5); - groupBox2.Controls.Add(button18); + groupBox2.Controls.Add(BtnWrite18); groupBox2.Controls.Add(label1); - groupBox2.Controls.Add(textBox20); + groupBox2.Controls.Add(textBox18); groupBox2.Controls.Add(textBox1); groupBox2.Controls.Add(label18); - groupBox2.Controls.Add(button1); - groupBox2.Controls.Add(button17); + groupBox2.Controls.Add(BtnWrite01); + groupBox2.Controls.Add(BtnWrite17); groupBox2.Controls.Add(label2); - groupBox2.Controls.Add(textBox19); + groupBox2.Controls.Add(textBox17); groupBox2.Controls.Add(label17); - groupBox2.Controls.Add(button2); - groupBox2.Controls.Add(button16); + groupBox2.Controls.Add(BtnWrite02); + groupBox2.Controls.Add(BtnWrite16); groupBox2.Controls.Add(label3); - groupBox2.Controls.Add(textBox18); + groupBox2.Controls.Add(textBox16); groupBox2.Controls.Add(textBox3); groupBox2.Controls.Add(label16); - groupBox2.Controls.Add(button3); - groupBox2.Controls.Add(button15); + groupBox2.Controls.Add(BtnWrite03); + groupBox2.Controls.Add(BtnWrite15); groupBox2.Controls.Add(label4); - groupBox2.Controls.Add(textBox17); + groupBox2.Controls.Add(textBox15); groupBox2.Controls.Add(textBox4); groupBox2.Controls.Add(label15); - groupBox2.Controls.Add(button4); + groupBox2.Controls.Add(BtnWrite04); groupBox2.Controls.Add(label5); - groupBox2.Controls.Add(button14); - groupBox2.Controls.Add(button5); + groupBox2.Controls.Add(BtnWrite14); + groupBox2.Controls.Add(BtnWrite05); groupBox2.Controls.Add(textBox14); groupBox2.Controls.Add(label6); groupBox2.Controls.Add(label14); groupBox2.Controls.Add(textBox6); - groupBox2.Controls.Add(button13); - groupBox2.Controls.Add(button6); + groupBox2.Controls.Add(BtnWrite13); + groupBox2.Controls.Add(BtnWrite06); groupBox2.Controls.Add(textBox13); groupBox2.Controls.Add(label7); groupBox2.Controls.Add(label13); groupBox2.Controls.Add(textBox7); - groupBox2.Controls.Add(button12); - groupBox2.Controls.Add(button7); + groupBox2.Controls.Add(BtnWrite12); + groupBox2.Controls.Add(BtnWrite07); groupBox2.Controls.Add(label8); groupBox2.Controls.Add(textBox8); - groupBox2.Controls.Add(button11); - groupBox2.Controls.Add(button8); + groupBox2.Controls.Add(BtnWrite11); + groupBox2.Controls.Add(BtnWrite08); groupBox2.Controls.Add(textBox11); groupBox2.Controls.Add(label9); groupBox2.Controls.Add(label11); groupBox2.Controls.Add(textBox9); - groupBox2.Controls.Add(button10); - groupBox2.Controls.Add(button9); + groupBox2.Controls.Add(BtnWrite10); + groupBox2.Controls.Add(BtnWrite09); groupBox2.Controls.Add(textBox10); groupBox2.Controls.Add(label10); groupBox2.Location = new Point(32, 90); @@ -1063,1563 +1081,1563 @@ groupBox3.TabStop = false; groupBox3.Text = "A 相线电压"; // - // label164 - // - label164.AutoSize = true; - label164.Location = new Point(815, 512); - label164.Name = "label164"; - label164.Size = new Size(87, 20); - label164.TabIndex = 147; - label164.Text = "0.0001kVA"; + // BtnToggle // - // label165 + BtnToggle.Location = new Point(1023, 508); + BtnToggle.Name = "BtnToggle"; + BtnToggle.Size = new Size(114, 29); + BtnToggle.TabIndex = 150; + BtnToggle.Text = "数据显示切换"; + BtnToggle.UseVisualStyleBackColor = true; + BtnToggle.Click += BtnToggle_Click; // - label165.AutoSize = true; - label165.Location = new Point(691, 512); - label165.Name = "label165"; - label165.Size = new Size(99, 20); - label165.TabIndex = 146; - label165.Text = "A 相视在功率"; + // label186 // - // label166 + label186.AutoSize = true; + label186.Location = new Point(815, 545); + label186.Name = "label186"; + label186.Size = new Size(49, 20); + label186.TabIndex = 177; + label186.Text = "0.001"; // - label166.AutoSize = true; - label166.Location = new Point(584, 512); - label166.Name = "label166"; - label166.Size = new Size(87, 20); - label166.TabIndex = 145; - label166.Text = "0.0001kVA"; + // label187 // - // label167 + label187.AutoSize = true; + label187.Location = new Point(691, 545); + label187.Name = "label187"; + label187.Size = new Size(95, 20); + label187.TabIndex = 176; + label187.Text = "A相功率因数"; // - label167.AutoSize = true; - label167.Location = new Point(460, 512); - label167.Name = "label167"; - label167.Size = new Size(99, 20); - label167.TabIndex = 144; - label167.Text = "A 相视在功率"; + // label188 // - // label168 + label188.AutoSize = true; + label188.Location = new Point(584, 545); + label188.Name = "label188"; + label188.Size = new Size(49, 20); + label188.TabIndex = 175; + label188.Text = "0.001"; // - label168.AutoSize = true; - label168.Location = new Point(355, 512); - label168.Name = "label168"; - label168.Size = new Size(87, 20); - label168.TabIndex = 143; - label168.Text = "0.0001kVA"; + // label189 // - // label169 + label189.AutoSize = true; + label189.Location = new Point(460, 545); + label189.Name = "label189"; + label189.Size = new Size(95, 20); + label189.TabIndex = 174; + label189.Text = "A相功率因数"; // - label169.AutoSize = true; - label169.Location = new Point(227, 512); - label169.Name = "label169"; - label169.Size = new Size(99, 20); - label169.TabIndex = 142; - label169.Text = "A 相视在功率"; + // label190 // - // label170 + label190.AutoSize = true; + label190.Location = new Point(355, 545); + label190.Name = "label190"; + label190.Size = new Size(49, 20); + label190.TabIndex = 173; + label190.Text = "0.001"; // - label170.AutoSize = true; - label170.Location = new Point(143, 512); - label170.Name = "label170"; - label170.Size = new Size(87, 20); - label170.TabIndex = 141; - label170.Text = "0.0001kVA"; + // label191 // - // label171 + label191.AutoSize = true; + label191.Location = new Point(227, 545); + label191.Name = "label191"; + label191.Size = new Size(95, 20); + label191.TabIndex = 172; + label191.Text = "A相功率因数"; // - label171.AutoSize = true; - label171.Location = new Point(19, 512); - label171.Name = "label171"; - label171.Size = new Size(84, 20); - label171.TabIndex = 140; - label171.Text = "总视在功率"; + // label192 // - // label154 + label192.AutoSize = true; + label192.Location = new Point(143, 545); + label192.Name = "label192"; + label192.Size = new Size(49, 20); + label192.TabIndex = 171; + label192.Text = "0.001"; // - label154.AutoSize = true; - label154.Location = new Point(817, 482); - label154.Name = "label154"; - label154.Size = new Size(88, 20); - label154.TabIndex = 137; - label154.Text = "0.0001kvar"; + // label193 // - // label155 + label193.AutoSize = true; + label193.Location = new Point(19, 545); + label193.Name = "label193"; + label193.Size = new Size(88, 20); + label193.TabIndex = 170; + label193.Text = "总功率因数 "; // - label155.AutoSize = true; - label155.Location = new Point(693, 482); - label155.Name = "label155"; - label155.Size = new Size(118, 20); - label155.TabIndex = 136; - label155.Text = "A 相无功总功率 "; + // label176 // - // label156 + label176.AutoSize = true; + label176.Location = new Point(1061, 615); + label176.Name = "label176"; + label176.Size = new Size(68, 20); + label176.TabIndex = 169; + label176.Text = "0.0001V"; // - label156.AutoSize = true; - label156.Location = new Point(586, 482); - label156.Name = "label156"; - label156.Size = new Size(88, 20); - label156.TabIndex = 135; - label156.Text = "0.0001kvar"; + // label177 // - // label157 + label177.AutoSize = true; + label177.Location = new Point(923, 615); + label177.Name = "label177"; + label177.Size = new Size(114, 20); + label177.TabIndex = 168; + label177.Text = "三相平均相电压"; // - label157.AutoSize = true; - label157.Location = new Point(462, 482); - label157.Name = "label157"; - label157.Size = new Size(118, 20); - label157.TabIndex = 134; - label157.Text = "A 相无功总功率 "; + // label178 // - // label158 + label178.AutoSize = true; + label178.Location = new Point(813, 615); + label178.Name = "label178"; + label178.Size = new Size(68, 20); + label178.TabIndex = 167; + label178.Text = "0.0001V"; // - label158.AutoSize = true; - label158.Location = new Point(357, 482); - label158.Name = "label158"; - label158.Size = new Size(88, 20); - label158.TabIndex = 133; - label158.Text = "0.0001kvar"; + // label179 // - // label159 - // - label159.AutoSize = true; - label159.Location = new Point(229, 482); - label159.Name = "label159"; - label159.Size = new Size(118, 20); - label159.TabIndex = 132; - label159.Text = "A 相无功总功率 "; - // - // label160 - // - label160.AutoSize = true; - label160.Location = new Point(145, 482); - label160.Name = "label160"; - label160.Size = new Size(88, 20); - label160.TabIndex = 131; - label160.Text = "0.0001kvar"; + label179.AutoSize = true; + label179.Location = new Point(689, 615); + label179.Name = "label179"; + label179.Size = new Size(122, 20); + label179.TabIndex = 166; + label179.Text = "三相平均线电压 "; // - // label161 + // label180 // - label161.AutoSize = true; - label161.Location = new Point(21, 482); - label161.Name = "label161"; - label161.Size = new Size(88, 20); - label161.TabIndex = 130; - label161.Text = "无功总功率 "; + label180.AutoSize = true; + label180.Location = new Point(582, 615); + label180.Name = "label180"; + label180.Size = new Size(68, 20); + label180.TabIndex = 165; + label180.Text = "0.0001V"; // - // label144 + // label181 // - label144.AutoSize = true; - label144.Location = new Point(817, 450); - label144.Name = "label144"; - label144.Size = new Size(81, 20); - label144.TabIndex = 127; - label144.Text = "0.0001kW"; + label181.AutoSize = true; + label181.Location = new Point(458, 615); + label181.Name = "label181"; + label181.Size = new Size(84, 20); + label181.TabIndex = 164; + label181.Text = "A 相线电压"; // - // label145 + // label182 // - label145.AutoSize = true; - label145.Location = new Point(693, 450); - label145.Name = "label145"; - label145.Size = new Size(114, 20); - label145.TabIndex = 126; - label145.Text = "A 相有功总功率"; + label182.AutoSize = true; + label182.Location = new Point(353, 615); + label182.Name = "label182"; + label182.Size = new Size(68, 20); + label182.TabIndex = 163; + label182.Text = "0.0001V"; // - // label146 + // label183 // - label146.AutoSize = true; - label146.Location = new Point(586, 450); - label146.Name = "label146"; - label146.Size = new Size(81, 20); - label146.TabIndex = 125; - label146.Text = "0.0001kW"; + label183.AutoSize = true; + label183.Location = new Point(225, 615); + label183.Name = "label183"; + label183.Size = new Size(84, 20); + label183.TabIndex = 162; + label183.Text = "A 相线电压"; // - // label147 + // label184 // - label147.AutoSize = true; - label147.Location = new Point(462, 450); - label147.Name = "label147"; - label147.Size = new Size(114, 20); - label147.TabIndex = 124; - label147.Text = "A 相有功总功率"; + label184.AutoSize = true; + label184.Location = new Point(141, 615); + label184.Name = "label184"; + label184.Size = new Size(68, 20); + label184.TabIndex = 161; + label184.Text = "0.0001V"; // - // label148 + // label185 // - label148.AutoSize = true; - label148.Location = new Point(357, 450); - label148.Name = "label148"; - label148.Size = new Size(81, 20); - label148.TabIndex = 123; - label148.Text = "0.0001kW"; + label185.AutoSize = true; + label185.Location = new Point(17, 615); + label185.Name = "label185"; + label185.Size = new Size(84, 20); + label185.TabIndex = 160; + label185.Text = "A 相线电压"; // - // label149 + // label142 // - label149.AutoSize = true; - label149.Location = new Point(229, 450); - label149.Name = "label149"; - label149.Size = new Size(114, 20); - label149.TabIndex = 122; - label149.Text = "A 相有功总功率"; + label142.AutoSize = true; + label142.Location = new Point(817, 581); + label142.Name = "label142"; + label142.Size = new Size(59, 20); + label142.TabIndex = 159; + label142.Text = "0.01Hz"; // - // label150 + // label143 // - label150.AutoSize = true; - label150.Location = new Point(145, 450); - label150.Name = "label150"; - label150.Size = new Size(81, 20); - label150.TabIndex = 121; - label150.Text = "0.0001kW"; + label143.AutoSize = true; + label143.Location = new Point(693, 581); + label143.Name = "label143"; + label143.Size = new Size(69, 20); + label143.TabIndex = 158; + label143.Text = "电网频率"; // - // label151 + // label152 // - label151.AutoSize = true; - label151.Location = new Point(21, 450); - label151.Name = "label151"; - label151.Size = new Size(84, 20); - label151.TabIndex = 120; - label151.Text = "有功总功率"; + label152.AutoSize = true; + label152.Location = new Point(586, 581); + label152.Name = "label152"; + label152.Size = new Size(46, 20); + label152.TabIndex = 157; + label152.Text = "0.01°"; // - // label132 + // label153 // - label132.AutoSize = true; - label132.Location = new Point(836, 419); - label132.Name = "label132"; - label132.Size = new Size(69, 20); - label132.TabIndex = 119; - label132.Text = "0.0001A"; + label153.AutoSize = true; + label153.Location = new Point(462, 581); + label153.Name = "label153"; + label153.Size = new Size(69, 20); + label153.TabIndex = 156; + label153.Text = "A 相相角"; // - // label133 + // label162 // - label133.AutoSize = true; - label133.Location = new Point(752, 419); - label133.Name = "label133"; - label133.Size = new Size(63, 20); - label133.TabIndex = 118; - label133.Text = "B相电流"; + label162.AutoSize = true; + label162.Location = new Point(357, 581); + label162.Name = "label162"; + label162.Size = new Size(46, 20); + label162.TabIndex = 155; + label162.Text = "0.01°"; // - // label134 + // label163 // - label134.AutoSize = true; - label134.Location = new Point(646, 419); - label134.Name = "label134"; - label134.Size = new Size(69, 20); - label134.TabIndex = 117; - label134.Text = "0.0001A"; + label163.AutoSize = true; + label163.Location = new Point(229, 581); + label163.Name = "label163"; + label163.Size = new Size(69, 20); + label163.TabIndex = 154; + label163.Text = "A 相相角"; // - // label135 + // label174 // - label135.AutoSize = true; - label135.Location = new Point(571, 419); - label135.Name = "label135"; - label135.Size = new Size(69, 20); - label135.TabIndex = 116; - label135.Text = "A 相电流"; + label174.AutoSize = true; + label174.Location = new Point(145, 581); + label174.Name = "label174"; + label174.Size = new Size(46, 20); + label174.TabIndex = 153; + label174.Text = "0.01°"; // - // label136 + // label175 // - label136.AutoSize = true; - label136.Location = new Point(450, 419); - label136.Name = "label136"; - label136.Size = new Size(68, 20); - label136.TabIndex = 115; - label136.Text = "0.0001V"; + label175.AutoSize = true; + label175.Location = new Point(21, 581); + label175.Name = "label175"; + label175.Size = new Size(69, 20); + label175.TabIndex = 152; + label175.Text = "A 相相角"; // - // label137 + // label172 // - label137.AutoSize = true; - label137.Location = new Point(380, 419); - label137.Name = "label137"; - label137.Size = new Size(64, 20); - label137.TabIndex = 114; - label137.Text = "C相电压"; + label172.AutoSize = true; + label172.Location = new Point(1022, 419); + label172.Name = "label172"; + label172.Size = new Size(69, 20); + label172.TabIndex = 151; + label172.Text = "0.0001A"; // - // label138 + // label173 // - label138.AutoSize = true; - label138.Location = new Point(270, 419); - label138.Name = "label138"; - label138.Size = new Size(68, 20); - label138.TabIndex = 113; - label138.Text = "0.0001V"; + label173.AutoSize = true; + label173.Location = new Point(938, 419); + label173.Name = "label173"; + label173.Size = new Size(64, 20); + label173.TabIndex = 150; + label173.Text = "C相电流"; // - // label139 + // label164 // - label139.AutoSize = true; - label139.Location = new Point(201, 419); - label139.Name = "label139"; - label139.Size = new Size(63, 20); - label139.TabIndex = 112; - label139.Text = "B相电压"; + label164.AutoSize = true; + label164.Location = new Point(815, 512); + label164.Name = "label164"; + label164.Size = new Size(87, 20); + label164.TabIndex = 147; + label164.Text = "0.0001kVA"; // - // label140 + // label165 // - label140.AutoSize = true; - label140.Location = new Point(100, 419); - label140.Name = "label140"; - label140.Size = new Size(68, 20); - label140.TabIndex = 111; - label140.Text = "0.0001V"; + label165.AutoSize = true; + label165.Location = new Point(691, 512); + label165.Name = "label165"; + label165.Size = new Size(99, 20); + label165.TabIndex = 146; + label165.Text = "A 相视在功率"; // - // label141 + // label166 // - label141.AutoSize = true; - label141.Location = new Point(21, 419); - label141.Name = "label141"; - label141.Size = new Size(73, 20); - label141.TabIndex = 110; - label141.Text = "A 相电压 "; + label166.AutoSize = true; + label166.Location = new Point(584, 512); + label166.Name = "label166"; + label166.Size = new Size(87, 20); + label166.TabIndex = 145; + label166.Text = "0.0001kVA"; // - // label122 + // label167 // - label122.AutoSize = true; - label122.Location = new Point(1067, 369); - label122.Name = "label122"; - label122.Size = new Size(82, 20); - label122.TabIndex = 109; - label122.Text = "0.01kVAh "; + label167.AutoSize = true; + label167.Location = new Point(460, 512); + label167.Name = "label167"; + label167.Size = new Size(99, 20); + label167.TabIndex = 144; + label167.Text = "A 相视在功率"; // - // label123 + // label168 // - label123.AutoSize = true; - label123.Location = new Point(929, 369); - label123.Name = "label123"; - label123.Size = new Size(114, 20); - label123.TabIndex = 108; - label123.Text = "组合有功谷电能"; + label168.AutoSize = true; + label168.Location = new Point(355, 512); + label168.Name = "label168"; + label168.Size = new Size(87, 20); + label168.TabIndex = 143; + label168.Text = "0.0001kVA"; // - // label124 + // label169 // - label124.AutoSize = true; - label124.Location = new Point(819, 369); - label124.Name = "label124"; - label124.Size = new Size(82, 20); - label124.TabIndex = 107; - label124.Text = "0.01kVAh "; + label169.AutoSize = true; + label169.Location = new Point(227, 512); + label169.Name = "label169"; + label169.Size = new Size(99, 20); + label169.TabIndex = 142; + label169.Text = "A 相视在功率"; // - // label125 + // label170 // - label125.AutoSize = true; - label125.Location = new Point(695, 369); - label125.Name = "label125"; - label125.Size = new Size(118, 20); - label125.TabIndex = 106; - label125.Text = "组合有功平电能 "; + label170.AutoSize = true; + label170.Location = new Point(143, 512); + label170.Name = "label170"; + label170.Size = new Size(87, 20); + label170.TabIndex = 141; + label170.Text = "0.0001kVA"; // - // label126 + // label171 // - label126.AutoSize = true; - label126.Location = new Point(588, 369); - label126.Name = "label126"; - label126.Size = new Size(82, 20); - label126.TabIndex = 105; - label126.Text = "0.01kVAh "; + label171.AutoSize = true; + label171.Location = new Point(19, 512); + label171.Name = "label171"; + label171.Size = new Size(84, 20); + label171.TabIndex = 140; + label171.Text = "总视在功率"; // - // label127 + // label154 // - label127.AutoSize = true; - label127.Location = new Point(464, 369); - label127.Name = "label127"; - label127.Size = new Size(118, 20); - label127.TabIndex = 104; - label127.Text = "组合有功峰电能 "; + label154.AutoSize = true; + label154.Location = new Point(817, 482); + label154.Name = "label154"; + label154.Size = new Size(88, 20); + label154.TabIndex = 137; + label154.Text = "0.0001kvar"; // - // label128 + // label155 // - label128.AutoSize = true; - label128.Location = new Point(359, 369); - label128.Name = "label128"; - label128.Size = new Size(82, 20); - label128.TabIndex = 103; - label128.Text = "0.01kVAh "; + label155.AutoSize = true; + label155.Location = new Point(693, 482); + label155.Name = "label155"; + label155.Size = new Size(118, 20); + label155.TabIndex = 136; + label155.Text = "A 相无功总功率 "; // - // label129 + // label156 // - label129.AutoSize = true; - label129.Location = new Point(231, 369); - label129.Name = "label129"; - label129.Size = new Size(122, 20); - label129.TabIndex = 102; - label129.Text = "组合有功尖电能 "; + label156.AutoSize = true; + label156.Location = new Point(586, 482); + label156.Name = "label156"; + label156.Size = new Size(88, 20); + label156.TabIndex = 135; + label156.Text = "0.0001kvar"; // - // label130 + // label157 // - label130.AutoSize = true; - label130.Location = new Point(147, 369); - label130.Name = "label130"; - label130.Size = new Size(82, 20); - label130.TabIndex = 101; - label130.Text = "0.01kVAh "; + label157.AutoSize = true; + label157.Location = new Point(462, 482); + label157.Name = "label157"; + label157.Size = new Size(118, 20); + label157.TabIndex = 134; + label157.Text = "A 相无功总功率 "; // - // label131 + // label158 // - label131.AutoSize = true; - label131.Location = new Point(23, 369); - label131.Name = "label131"; - label131.Size = new Size(114, 20); - label131.TabIndex = 100; - label131.Text = "反向视在总电能"; + label158.AutoSize = true; + label158.Location = new Point(357, 482); + label158.Name = "label158"; + label158.Size = new Size(88, 20); + label158.TabIndex = 133; + label158.Text = "0.0001kvar"; // - // label112 + // label159 // - label112.AutoSize = true; - label112.Location = new Point(1067, 338); - label112.Name = "label112"; - label112.Size = new Size(82, 20); - label112.TabIndex = 99; - label112.Text = "0.01kVAh "; + label159.AutoSize = true; + label159.Location = new Point(229, 482); + label159.Name = "label159"; + label159.Size = new Size(118, 20); + label159.TabIndex = 132; + label159.Text = "A 相无功总功率 "; // - // label113 + // label160 // - label113.AutoSize = true; - label113.Location = new Point(929, 338); - label113.Name = "label113"; - label113.Size = new Size(114, 20); - label113.TabIndex = 98; - label113.Text = "组合有功谷电能"; + label160.AutoSize = true; + label160.Location = new Point(145, 482); + label160.Name = "label160"; + label160.Size = new Size(88, 20); + label160.TabIndex = 131; + label160.Text = "0.0001kvar"; // - // label114 + // label161 // - label114.AutoSize = true; - label114.Location = new Point(819, 338); - label114.Name = "label114"; - label114.Size = new Size(82, 20); - label114.TabIndex = 97; - label114.Text = "0.01kVAh "; + label161.AutoSize = true; + label161.Location = new Point(21, 482); + label161.Name = "label161"; + label161.Size = new Size(88, 20); + label161.TabIndex = 130; + label161.Text = "无功总功率 "; // - // label115 + // label144 // - label115.AutoSize = true; - label115.Location = new Point(695, 338); - label115.Name = "label115"; - label115.Size = new Size(118, 20); - label115.TabIndex = 96; - label115.Text = "组合有功平电能 "; + label144.AutoSize = true; + label144.Location = new Point(817, 450); + label144.Name = "label144"; + label144.Size = new Size(81, 20); + label144.TabIndex = 127; + label144.Text = "0.0001kW"; // - // label116 + // label145 // - label116.AutoSize = true; - label116.Location = new Point(588, 338); - label116.Name = "label116"; - label116.Size = new Size(82, 20); - label116.TabIndex = 95; - label116.Text = "0.01kVAh "; + label145.AutoSize = true; + label145.Location = new Point(693, 450); + label145.Name = "label145"; + label145.Size = new Size(114, 20); + label145.TabIndex = 126; + label145.Text = "A 相有功总功率"; // - // label117 + // label146 // - label117.AutoSize = true; - label117.Location = new Point(464, 338); - label117.Name = "label117"; - label117.Size = new Size(118, 20); - label117.TabIndex = 94; - label117.Text = "组合有功峰电能 "; + label146.AutoSize = true; + label146.Location = new Point(586, 450); + label146.Name = "label146"; + label146.Size = new Size(81, 20); + label146.TabIndex = 125; + label146.Text = "0.0001kW"; // - // label118 + // label147 // - label118.AutoSize = true; - label118.Location = new Point(359, 338); - label118.Name = "label118"; - label118.Size = new Size(82, 20); - label118.TabIndex = 93; - label118.Text = "0.01kVAh "; + label147.AutoSize = true; + label147.Location = new Point(462, 450); + label147.Name = "label147"; + label147.Size = new Size(114, 20); + label147.TabIndex = 124; + label147.Text = "A 相有功总功率"; // - // label119 + // label148 // - label119.AutoSize = true; - label119.Location = new Point(231, 338); - label119.Name = "label119"; - label119.Size = new Size(122, 20); - label119.TabIndex = 92; - label119.Text = "组合有功尖电能 "; + label148.AutoSize = true; + label148.Location = new Point(357, 450); + label148.Name = "label148"; + label148.Size = new Size(81, 20); + label148.TabIndex = 123; + label148.Text = "0.0001kW"; // - // label120 + // label149 // - label120.AutoSize = true; - label120.Location = new Point(147, 338); - label120.Name = "label120"; - label120.Size = new Size(82, 20); - label120.TabIndex = 91; - label120.Text = "0.01kVAh "; + label149.AutoSize = true; + label149.Location = new Point(229, 450); + label149.Name = "label149"; + label149.Size = new Size(114, 20); + label149.TabIndex = 122; + label149.Text = "A 相有功总功率"; // - // label121 + // label150 // - label121.AutoSize = true; - label121.Location = new Point(23, 338); - label121.Name = "label121"; - label121.Size = new Size(118, 20); - label121.TabIndex = 90; - label121.Text = "正向视在总电能 "; + label150.AutoSize = true; + label150.Location = new Point(145, 450); + label150.Name = "label150"; + label150.Size = new Size(81, 20); + label150.TabIndex = 121; + label150.Text = "0.0001kW"; // - // label102 + // label151 // - label102.AutoSize = true; - label102.Location = new Point(1065, 308); - label102.Name = "label102"; - label102.Size = new Size(79, 20); - label102.TabIndex = 89; - label102.Text = "0.01kvarh"; + label151.AutoSize = true; + label151.Location = new Point(21, 450); + label151.Name = "label151"; + label151.Size = new Size(84, 20); + label151.TabIndex = 120; + label151.Text = "有功总功率"; // - // label103 + // label132 // - label103.AutoSize = true; - label103.Location = new Point(927, 308); - label103.Name = "label103"; - label103.Size = new Size(114, 20); - label103.TabIndex = 88; - label103.Text = "组合有功谷电能"; + label132.AutoSize = true; + label132.Location = new Point(836, 419); + label132.Name = "label132"; + label132.Size = new Size(69, 20); + label132.TabIndex = 119; + label132.Text = "0.0001A"; // - // label104 + // label133 // - label104.AutoSize = true; - label104.Location = new Point(817, 308); - label104.Name = "label104"; - label104.Size = new Size(79, 20); - label104.TabIndex = 87; - label104.Text = "0.01kvarh"; + label133.AutoSize = true; + label133.Location = new Point(752, 419); + label133.Name = "label133"; + label133.Size = new Size(63, 20); + label133.TabIndex = 118; + label133.Text = "B相电流"; // - // label105 + // label134 // - label105.AutoSize = true; - label105.Location = new Point(693, 308); - label105.Name = "label105"; - label105.Size = new Size(118, 20); - label105.TabIndex = 86; - label105.Text = "组合有功平电能 "; + label134.AutoSize = true; + label134.Location = new Point(646, 419); + label134.Name = "label134"; + label134.Size = new Size(69, 20); + label134.TabIndex = 117; + label134.Text = "0.0001A"; // - // label106 + // label135 // - label106.AutoSize = true; - label106.Location = new Point(586, 308); - label106.Name = "label106"; - label106.Size = new Size(79, 20); - label106.TabIndex = 85; - label106.Text = "0.01kvarh"; + label135.AutoSize = true; + label135.Location = new Point(571, 419); + label135.Name = "label135"; + label135.Size = new Size(69, 20); + label135.TabIndex = 116; + label135.Text = "A 相电流"; // - // label107 + // label136 // - label107.AutoSize = true; - label107.Location = new Point(462, 308); - label107.Name = "label107"; - label107.Size = new Size(118, 20); - label107.TabIndex = 84; - label107.Text = "组合有功峰电能 "; + label136.AutoSize = true; + label136.Location = new Point(450, 419); + label136.Name = "label136"; + label136.Size = new Size(68, 20); + label136.TabIndex = 115; + label136.Text = "0.0001V"; // - // label108 + // label137 // - label108.AutoSize = true; - label108.Location = new Point(357, 308); - label108.Name = "label108"; - label108.Size = new Size(79, 20); - label108.TabIndex = 83; - label108.Text = "0.01kvarh"; + label137.AutoSize = true; + label137.Location = new Point(380, 419); + label137.Name = "label137"; + label137.Size = new Size(64, 20); + label137.TabIndex = 114; + label137.Text = "C相电压"; // - // label109 + // label138 // - label109.AutoSize = true; - label109.Location = new Point(229, 308); - label109.Name = "label109"; - label109.Size = new Size(122, 20); - label109.TabIndex = 82; - label109.Text = "组合有功尖电能 "; + label138.AutoSize = true; + label138.Location = new Point(270, 419); + label138.Name = "label138"; + label138.Size = new Size(68, 20); + label138.TabIndex = 113; + label138.Text = "0.0001V"; // - // label110 + // label139 // - label110.AutoSize = true; - label110.Location = new Point(145, 308); - label110.Name = "label110"; - label110.Size = new Size(79, 20); - label110.TabIndex = 81; - label110.Text = "0.01kvarh"; + label139.AutoSize = true; + label139.Location = new Point(201, 419); + label139.Name = "label139"; + label139.Size = new Size(63, 20); + label139.TabIndex = 112; + label139.Text = "B相电压"; // - // label111 + // label140 // - label111.AutoSize = true; - label111.Location = new Point(21, 308); - label111.Name = "label111"; - label111.Size = new Size(129, 20); - label111.TabIndex = 80; - label111.Text = "四象限无功总电能"; + label140.AutoSize = true; + label140.Location = new Point(100, 419); + label140.Name = "label140"; + label140.Size = new Size(68, 20); + label140.TabIndex = 111; + label140.Text = "0.0001V"; // - // label92 + // label141 // - label92.AutoSize = true; - label92.Location = new Point(1065, 276); - label92.Name = "label92"; - label92.Size = new Size(79, 20); - label92.TabIndex = 79; - label92.Text = "0.01kvarh"; + label141.AutoSize = true; + label141.Location = new Point(21, 419); + label141.Name = "label141"; + label141.Size = new Size(73, 20); + label141.TabIndex = 110; + label141.Text = "A 相电压 "; // - // label93 + // label122 // - label93.AutoSize = true; - label93.Location = new Point(927, 276); - label93.Name = "label93"; - label93.Size = new Size(114, 20); - label93.TabIndex = 78; - label93.Text = "组合有功谷电能"; + label122.AutoSize = true; + label122.Location = new Point(1067, 369); + label122.Name = "label122"; + label122.Size = new Size(82, 20); + label122.TabIndex = 109; + label122.Text = "0.01kVAh "; // - // label94 + // label123 // - label94.AutoSize = true; - label94.Location = new Point(817, 276); - label94.Name = "label94"; - label94.Size = new Size(79, 20); - label94.TabIndex = 77; - label94.Text = "0.01kvarh"; + label123.AutoSize = true; + label123.Location = new Point(929, 369); + label123.Name = "label123"; + label123.Size = new Size(114, 20); + label123.TabIndex = 108; + label123.Text = "组合有功谷电能"; // - // label95 + // label124 // - label95.AutoSize = true; - label95.Location = new Point(693, 276); - label95.Name = "label95"; - label95.Size = new Size(118, 20); - label95.TabIndex = 76; - label95.Text = "组合有功平电能 "; + label124.AutoSize = true; + label124.Location = new Point(819, 369); + label124.Name = "label124"; + label124.Size = new Size(82, 20); + label124.TabIndex = 107; + label124.Text = "0.01kVAh "; // - // label96 + // label125 // - label96.AutoSize = true; - label96.Location = new Point(586, 276); - label96.Name = "label96"; - label96.Size = new Size(79, 20); - label96.TabIndex = 75; - label96.Text = "0.01kvarh"; + label125.AutoSize = true; + label125.Location = new Point(695, 369); + label125.Name = "label125"; + label125.Size = new Size(118, 20); + label125.TabIndex = 106; + label125.Text = "组合有功平电能 "; // - // label97 + // label126 // - label97.AutoSize = true; - label97.Location = new Point(462, 276); - label97.Name = "label97"; - label97.Size = new Size(118, 20); - label97.TabIndex = 74; - label97.Text = "组合有功峰电能 "; + label126.AutoSize = true; + label126.Location = new Point(588, 369); + label126.Name = "label126"; + label126.Size = new Size(82, 20); + label126.TabIndex = 105; + label126.Text = "0.01kVAh "; // - // label98 + // label127 // - label98.AutoSize = true; - label98.Location = new Point(357, 276); - label98.Name = "label98"; - label98.Size = new Size(79, 20); - label98.TabIndex = 73; - label98.Text = "0.01kvarh"; + label127.AutoSize = true; + label127.Location = new Point(464, 369); + label127.Name = "label127"; + label127.Size = new Size(118, 20); + label127.TabIndex = 104; + label127.Text = "组合有功峰电能 "; // - // label99 + // label128 // - label99.AutoSize = true; - label99.Location = new Point(229, 276); - label99.Name = "label99"; - label99.Size = new Size(122, 20); - label99.TabIndex = 72; - label99.Text = "组合有功尖电能 "; + label128.AutoSize = true; + label128.Location = new Point(359, 369); + label128.Name = "label128"; + label128.Size = new Size(82, 20); + label128.TabIndex = 103; + label128.Text = "0.01kVAh "; // - // label100 + // label129 // - label100.AutoSize = true; - label100.Location = new Point(145, 276); - label100.Name = "label100"; - label100.Size = new Size(79, 20); - label100.TabIndex = 71; - label100.Text = "0.01kvarh"; + label129.AutoSize = true; + label129.Location = new Point(231, 369); + label129.Name = "label129"; + label129.Size = new Size(122, 20); + label129.TabIndex = 102; + label129.Text = "组合有功尖电能 "; // - // label101 + // label130 // - label101.AutoSize = true; - label101.Location = new Point(21, 276); - label101.Name = "label101"; - label101.Size = new Size(129, 20); - label101.TabIndex = 70; - label101.Text = "三象限无功总电能"; + label130.AutoSize = true; + label130.Location = new Point(147, 369); + label130.Name = "label130"; + label130.Size = new Size(82, 20); + label130.TabIndex = 101; + label130.Text = "0.01kVAh "; // - // label82 + // label131 // - label82.AutoSize = true; - label82.Location = new Point(1063, 244); - label82.Name = "label82"; - label82.Size = new Size(79, 20); - label82.TabIndex = 69; - label82.Text = "0.01kvarh"; + label131.AutoSize = true; + label131.Location = new Point(23, 369); + label131.Name = "label131"; + label131.Size = new Size(114, 20); + label131.TabIndex = 100; + label131.Text = "反向视在总电能"; // - // label83 + // label112 // - label83.AutoSize = true; - label83.Location = new Point(925, 244); - label83.Name = "label83"; - label83.Size = new Size(114, 20); - label83.TabIndex = 68; - label83.Text = "组合有功谷电能"; + label112.AutoSize = true; + label112.Location = new Point(1067, 338); + label112.Name = "label112"; + label112.Size = new Size(82, 20); + label112.TabIndex = 99; + label112.Text = "0.01kVAh "; // - // label84 + // label113 // - label84.AutoSize = true; - label84.Location = new Point(815, 244); - label84.Name = "label84"; - label84.Size = new Size(79, 20); - label84.TabIndex = 67; - label84.Text = "0.01kvarh"; + label113.AutoSize = true; + label113.Location = new Point(929, 338); + label113.Name = "label113"; + label113.Size = new Size(114, 20); + label113.TabIndex = 98; + label113.Text = "组合有功谷电能"; // - // label85 + // label114 // - label85.AutoSize = true; - label85.Location = new Point(691, 244); - label85.Name = "label85"; - label85.Size = new Size(118, 20); - label85.TabIndex = 66; - label85.Text = "组合有功平电能 "; + label114.AutoSize = true; + label114.Location = new Point(819, 338); + label114.Name = "label114"; + label114.Size = new Size(82, 20); + label114.TabIndex = 97; + label114.Text = "0.01kVAh "; // - // label86 + // label115 // - label86.AutoSize = true; - label86.Location = new Point(584, 244); - label86.Name = "label86"; - label86.Size = new Size(79, 20); - label86.TabIndex = 65; - label86.Text = "0.01kvarh"; + label115.AutoSize = true; + label115.Location = new Point(695, 338); + label115.Name = "label115"; + label115.Size = new Size(118, 20); + label115.TabIndex = 96; + label115.Text = "组合有功平电能 "; // - // label87 + // label116 // - label87.AutoSize = true; - label87.Location = new Point(460, 244); - label87.Name = "label87"; - label87.Size = new Size(118, 20); - label87.TabIndex = 64; - label87.Text = "组合有功峰电能 "; + label116.AutoSize = true; + label116.Location = new Point(588, 338); + label116.Name = "label116"; + label116.Size = new Size(82, 20); + label116.TabIndex = 95; + label116.Text = "0.01kVAh "; // - // label88 + // label117 // - label88.AutoSize = true; - label88.Location = new Point(355, 244); - label88.Name = "label88"; - label88.Size = new Size(79, 20); - label88.TabIndex = 63; - label88.Text = "0.01kvarh"; + label117.AutoSize = true; + label117.Location = new Point(464, 338); + label117.Name = "label117"; + label117.Size = new Size(118, 20); + label117.TabIndex = 94; + label117.Text = "组合有功峰电能 "; // - // label89 + // label118 // - label89.AutoSize = true; - label89.Location = new Point(227, 244); - label89.Name = "label89"; - label89.Size = new Size(122, 20); - label89.TabIndex = 62; - label89.Text = "组合有功尖电能 "; + label118.AutoSize = true; + label118.Location = new Point(359, 338); + label118.Name = "label118"; + label118.Size = new Size(82, 20); + label118.TabIndex = 93; + label118.Text = "0.01kVAh "; // - // label90 + // label119 // - label90.AutoSize = true; - label90.Location = new Point(143, 244); - label90.Name = "label90"; - label90.Size = new Size(79, 20); - label90.TabIndex = 61; - label90.Text = "0.01kvarh"; + label119.AutoSize = true; + label119.Location = new Point(231, 338); + label119.Name = "label119"; + label119.Size = new Size(122, 20); + label119.TabIndex = 92; + label119.Text = "组合有功尖电能 "; + // + // label120 + // + label120.AutoSize = true; + label120.Location = new Point(147, 338); + label120.Name = "label120"; + label120.Size = new Size(82, 20); + label120.TabIndex = 91; + label120.Text = "0.01kVAh "; // - // label91 + // label121 // - label91.AutoSize = true; - label91.Location = new Point(19, 244); - label91.Name = "label91"; - label91.Size = new Size(129, 20); - label91.TabIndex = 60; - label91.Text = "二象限无功总电能"; + label121.AutoSize = true; + label121.Location = new Point(23, 338); + label121.Name = "label121"; + label121.Size = new Size(118, 20); + label121.TabIndex = 90; + label121.Text = "正向视在总电能 "; // - // label72 + // label102 // - label72.AutoSize = true; - label72.Location = new Point(1063, 210); - label72.Name = "label72"; - label72.Size = new Size(79, 20); - label72.TabIndex = 59; - label72.Text = "0.01kvarh"; + label102.AutoSize = true; + label102.Location = new Point(1065, 308); + label102.Name = "label102"; + label102.Size = new Size(79, 20); + label102.TabIndex = 89; + label102.Text = "0.01kvarh"; // - // label73 + // label103 // - label73.AutoSize = true; - label73.Location = new Point(925, 210); - label73.Name = "label73"; - label73.Size = new Size(114, 20); - label73.TabIndex = 58; - label73.Text = "组合有功谷电能"; + label103.AutoSize = true; + label103.Location = new Point(927, 308); + label103.Name = "label103"; + label103.Size = new Size(114, 20); + label103.TabIndex = 88; + label103.Text = "组合有功谷电能"; // - // label74 + // label104 // - label74.AutoSize = true; - label74.Location = new Point(815, 210); - label74.Name = "label74"; - label74.Size = new Size(79, 20); - label74.TabIndex = 57; - label74.Text = "0.01kvarh"; + label104.AutoSize = true; + label104.Location = new Point(817, 308); + label104.Name = "label104"; + label104.Size = new Size(79, 20); + label104.TabIndex = 87; + label104.Text = "0.01kvarh"; // - // label75 + // label105 // - label75.AutoSize = true; - label75.Location = new Point(691, 210); - label75.Name = "label75"; - label75.Size = new Size(118, 20); - label75.TabIndex = 56; - label75.Text = "组合有功平电能 "; + label105.AutoSize = true; + label105.Location = new Point(693, 308); + label105.Name = "label105"; + label105.Size = new Size(118, 20); + label105.TabIndex = 86; + label105.Text = "组合有功平电能 "; // - // label76 + // label106 // - label76.AutoSize = true; - label76.Location = new Point(584, 210); - label76.Name = "label76"; - label76.Size = new Size(79, 20); - label76.TabIndex = 55; - label76.Text = "0.01kvarh"; + label106.AutoSize = true; + label106.Location = new Point(586, 308); + label106.Name = "label106"; + label106.Size = new Size(79, 20); + label106.TabIndex = 85; + label106.Text = "0.01kvarh"; // - // label77 + // label107 // - label77.AutoSize = true; - label77.Location = new Point(460, 210); - label77.Name = "label77"; - label77.Size = new Size(118, 20); - label77.TabIndex = 54; - label77.Text = "组合有功峰电能 "; + label107.AutoSize = true; + label107.Location = new Point(462, 308); + label107.Name = "label107"; + label107.Size = new Size(118, 20); + label107.TabIndex = 84; + label107.Text = "组合有功峰电能 "; // - // label78 + // label108 // - label78.AutoSize = true; - label78.Location = new Point(355, 210); - label78.Name = "label78"; - label78.Size = new Size(79, 20); - label78.TabIndex = 53; - label78.Text = "0.01kvarh"; + label108.AutoSize = true; + label108.Location = new Point(357, 308); + label108.Name = "label108"; + label108.Size = new Size(79, 20); + label108.TabIndex = 83; + label108.Text = "0.01kvarh"; // - // label79 + // label109 // - label79.AutoSize = true; - label79.Location = new Point(227, 210); - label79.Name = "label79"; - label79.Size = new Size(122, 20); - label79.TabIndex = 52; - label79.Text = "组合有功尖电能 "; + label109.AutoSize = true; + label109.Location = new Point(229, 308); + label109.Name = "label109"; + label109.Size = new Size(122, 20); + label109.TabIndex = 82; + label109.Text = "组合有功尖电能 "; // - // label80 + // label110 // - label80.AutoSize = true; - label80.Location = new Point(143, 210); - label80.Name = "label80"; - label80.Size = new Size(79, 20); - label80.TabIndex = 51; - label80.Text = "0.01kvarh"; + label110.AutoSize = true; + label110.Location = new Point(145, 308); + label110.Name = "label110"; + label110.Size = new Size(79, 20); + label110.TabIndex = 81; + label110.Text = "0.01kvarh"; // - // label81 + // label111 // - label81.AutoSize = true; - label81.Location = new Point(19, 210); - label81.Name = "label81"; - label81.Size = new Size(129, 20); - label81.TabIndex = 50; - label81.Text = "一象限无功总电能"; + label111.AutoSize = true; + label111.Location = new Point(21, 308); + label111.Name = "label111"; + label111.Size = new Size(129, 20); + label111.TabIndex = 80; + label111.Text = "四象限无功总电能"; // - // label62 + // label92 // - label62.AutoSize = true; - label62.Location = new Point(1063, 179); - label62.Name = "label62"; - label62.Size = new Size(79, 20); - label62.TabIndex = 49; - label62.Text = "0.01kvarh"; + label92.AutoSize = true; + label92.Location = new Point(1065, 276); + label92.Name = "label92"; + label92.Size = new Size(79, 20); + label92.TabIndex = 79; + label92.Text = "0.01kvarh"; // - // label63 + // label93 // - label63.AutoSize = true; - label63.Location = new Point(925, 179); - label63.Name = "label63"; - label63.Size = new Size(114, 20); - label63.TabIndex = 48; - label63.Text = "组合有功谷电能"; + label93.AutoSize = true; + label93.Location = new Point(927, 276); + label93.Name = "label93"; + label93.Size = new Size(114, 20); + label93.TabIndex = 78; + label93.Text = "组合有功谷电能"; // - // label64 + // label94 // - label64.AutoSize = true; - label64.Location = new Point(815, 179); - label64.Name = "label64"; - label64.Size = new Size(79, 20); - label64.TabIndex = 47; - label64.Text = "0.01kvarh"; + label94.AutoSize = true; + label94.Location = new Point(817, 276); + label94.Name = "label94"; + label94.Size = new Size(79, 20); + label94.TabIndex = 77; + label94.Text = "0.01kvarh"; // - // label65 + // label95 // - label65.AutoSize = true; - label65.Location = new Point(691, 179); - label65.Name = "label65"; - label65.Size = new Size(118, 20); - label65.TabIndex = 46; - label65.Text = "组合有功平电能 "; + label95.AutoSize = true; + label95.Location = new Point(693, 276); + label95.Name = "label95"; + label95.Size = new Size(118, 20); + label95.TabIndex = 76; + label95.Text = "组合有功平电能 "; // - // label66 + // label96 // - label66.AutoSize = true; - label66.Location = new Point(584, 179); - label66.Name = "label66"; - label66.Size = new Size(79, 20); - label66.TabIndex = 45; - label66.Text = "0.01kvarh"; + label96.AutoSize = true; + label96.Location = new Point(586, 276); + label96.Name = "label96"; + label96.Size = new Size(79, 20); + label96.TabIndex = 75; + label96.Text = "0.01kvarh"; // - // label67 + // label97 // - label67.AutoSize = true; - label67.Location = new Point(460, 179); - label67.Name = "label67"; - label67.Size = new Size(118, 20); - label67.TabIndex = 44; - label67.Text = "组合有功峰电能 "; + label97.AutoSize = true; + label97.Location = new Point(462, 276); + label97.Name = "label97"; + label97.Size = new Size(118, 20); + label97.TabIndex = 74; + label97.Text = "组合有功峰电能 "; // - // label68 + // label98 // - label68.AutoSize = true; - label68.Location = new Point(355, 179); - label68.Name = "label68"; - label68.Size = new Size(79, 20); - label68.TabIndex = 43; - label68.Text = "0.01kvarh"; + label98.AutoSize = true; + label98.Location = new Point(357, 276); + label98.Name = "label98"; + label98.Size = new Size(79, 20); + label98.TabIndex = 73; + label98.Text = "0.01kvarh"; // - // label69 + // label99 // - label69.AutoSize = true; - label69.Location = new Point(227, 179); - label69.Name = "label69"; - label69.Size = new Size(122, 20); - label69.TabIndex = 42; - label69.Text = "组合有功尖电能 "; + label99.AutoSize = true; + label99.Location = new Point(229, 276); + label99.Name = "label99"; + label99.Size = new Size(122, 20); + label99.TabIndex = 72; + label99.Text = "组合有功尖电能 "; // - // label70 + // label100 // - label70.AutoSize = true; - label70.Location = new Point(143, 179); - label70.Name = "label70"; - label70.Size = new Size(79, 20); - label70.TabIndex = 41; - label70.Text = "0.01kvarh"; + label100.AutoSize = true; + label100.Location = new Point(145, 276); + label100.Name = "label100"; + label100.Size = new Size(79, 20); + label100.TabIndex = 71; + label100.Text = "0.01kvarh"; // - // label71 + // label101 // - label71.AutoSize = true; - label71.Location = new Point(19, 179); - label71.Name = "label71"; - label71.Size = new Size(127, 20); - label71.TabIndex = 40; - label71.Text = "组合无功2总电能 "; + label101.AutoSize = true; + label101.Location = new Point(21, 276); + label101.Name = "label101"; + label101.Size = new Size(129, 20); + label101.TabIndex = 70; + label101.Text = "三象限无功总电能"; // - // label52 + // label82 // - label52.AutoSize = true; - label52.Location = new Point(1065, 149); - label52.Name = "label52"; - label52.Size = new Size(79, 20); - label52.TabIndex = 39; - label52.Text = "0.01kvarh"; + label82.AutoSize = true; + label82.Location = new Point(1063, 244); + label82.Name = "label82"; + label82.Size = new Size(79, 20); + label82.TabIndex = 69; + label82.Text = "0.01kvarh"; // - // label53 + // label83 // - label53.AutoSize = true; - label53.Location = new Point(927, 149); - label53.Name = "label53"; - label53.Size = new Size(127, 20); - label53.TabIndex = 38; - label53.Text = "组合无功1谷电能 "; + label83.AutoSize = true; + label83.Location = new Point(925, 244); + label83.Name = "label83"; + label83.Size = new Size(114, 20); + label83.TabIndex = 68; + label83.Text = "组合有功谷电能"; // - // label54 + // label84 // - label54.AutoSize = true; - label54.Location = new Point(817, 149); - label54.Name = "label54"; - label54.Size = new Size(79, 20); - label54.TabIndex = 37; - label54.Text = "0.01kvarh"; + label84.AutoSize = true; + label84.Location = new Point(815, 244); + label84.Name = "label84"; + label84.Size = new Size(79, 20); + label84.TabIndex = 67; + label84.Text = "0.01kvarh"; // - // label55 + // label85 // - label55.AutoSize = true; - label55.Location = new Point(693, 149); - label55.Name = "label55"; - label55.Size = new Size(127, 20); - label55.TabIndex = 36; - label55.Text = "组合无功1平电能 "; + label85.AutoSize = true; + label85.Location = new Point(691, 244); + label85.Name = "label85"; + label85.Size = new Size(118, 20); + label85.TabIndex = 66; + label85.Text = "组合有功平电能 "; // - // label56 + // label86 // - label56.AutoSize = true; - label56.Location = new Point(586, 149); - label56.Name = "label56"; - label56.Size = new Size(79, 20); - label56.TabIndex = 35; - label56.Text = "0.01kvarh"; + label86.AutoSize = true; + label86.Location = new Point(584, 244); + label86.Name = "label86"; + label86.Size = new Size(79, 20); + label86.TabIndex = 65; + label86.Text = "0.01kvarh"; // - // label57 + // label87 // - label57.AutoSize = true; - label57.Location = new Point(462, 149); - label57.Name = "label57"; - label57.Size = new Size(127, 20); - label57.TabIndex = 34; - label57.Text = "组合无功1峰电能 "; + label87.AutoSize = true; + label87.Location = new Point(460, 244); + label87.Name = "label87"; + label87.Size = new Size(118, 20); + label87.TabIndex = 64; + label87.Text = "组合有功峰电能 "; // - // label58 + // label88 // - label58.AutoSize = true; - label58.Location = new Point(357, 149); - label58.Name = "label58"; - label58.Size = new Size(79, 20); - label58.TabIndex = 33; - label58.Text = "0.01kvarh"; + label88.AutoSize = true; + label88.Location = new Point(355, 244); + label88.Name = "label88"; + label88.Size = new Size(79, 20); + label88.TabIndex = 63; + label88.Text = "0.01kvarh"; // - // label59 + // label89 // - label59.AutoSize = true; - label59.Location = new Point(229, 149); - label59.Name = "label59"; - label59.Size = new Size(127, 20); - label59.TabIndex = 32; - label59.Text = "组合无功1尖电能 "; + label89.AutoSize = true; + label89.Location = new Point(227, 244); + label89.Name = "label89"; + label89.Size = new Size(122, 20); + label89.TabIndex = 62; + label89.Text = "组合有功尖电能 "; // - // label60 + // label90 // - label60.AutoSize = true; - label60.Location = new Point(145, 149); - label60.Name = "label60"; - label60.Size = new Size(79, 20); - label60.TabIndex = 31; - label60.Text = "0.01kvarh"; + label90.AutoSize = true; + label90.Location = new Point(143, 244); + label90.Name = "label90"; + label90.Size = new Size(79, 20); + label90.TabIndex = 61; + label90.Text = "0.01kvarh"; // - // label61 + // label91 // - label61.AutoSize = true; - label61.Location = new Point(21, 149); - label61.Name = "label61"; - label61.Size = new Size(123, 20); - label61.TabIndex = 30; - label61.Text = "组合无功1总电能"; + label91.AutoSize = true; + label91.Location = new Point(19, 244); + label91.Name = "label91"; + label91.Size = new Size(129, 20); + label91.TabIndex = 60; + label91.Text = "二象限无功总电能"; // - // label42 + // label72 // - label42.AutoSize = true; - label42.Location = new Point(1063, 120); - label42.Name = "label42"; - label42.Size = new Size(72, 20); - label42.TabIndex = 29; - label42.Text = "0.01kWh"; + label72.AutoSize = true; + label72.Location = new Point(1063, 210); + label72.Name = "label72"; + label72.Size = new Size(79, 20); + label72.TabIndex = 59; + label72.Text = "0.01kvarh"; // - // label43 + // label73 // - label43.AutoSize = true; - label43.Location = new Point(925, 120); - label43.Name = "label43"; - label43.Size = new Size(114, 20); - label43.TabIndex = 28; - label43.Text = "正向有功谷电能"; + label73.AutoSize = true; + label73.Location = new Point(925, 210); + label73.Name = "label73"; + label73.Size = new Size(114, 20); + label73.TabIndex = 58; + label73.Text = "组合有功谷电能"; // - // label44 + // label74 // - label44.AutoSize = true; - label44.Location = new Point(815, 120); - label44.Name = "label44"; - label44.Size = new Size(72, 20); - label44.TabIndex = 27; - label44.Text = "0.01kWh"; + label74.AutoSize = true; + label74.Location = new Point(815, 210); + label74.Name = "label74"; + label74.Size = new Size(79, 20); + label74.TabIndex = 57; + label74.Text = "0.01kvarh"; // - // label45 + // label75 // - label45.AutoSize = true; - label45.Location = new Point(691, 120); - label45.Name = "label45"; - label45.Size = new Size(118, 20); - label45.TabIndex = 26; - label45.Text = "正向有功平电能 "; + label75.AutoSize = true; + label75.Location = new Point(691, 210); + label75.Name = "label75"; + label75.Size = new Size(118, 20); + label75.TabIndex = 56; + label75.Text = "组合有功平电能 "; // - // label46 + // label76 // - label46.AutoSize = true; - label46.Location = new Point(584, 120); - label46.Name = "label46"; - label46.Size = new Size(72, 20); - label46.TabIndex = 25; - label46.Text = "0.01kWh"; + label76.AutoSize = true; + label76.Location = new Point(584, 210); + label76.Name = "label76"; + label76.Size = new Size(79, 20); + label76.TabIndex = 55; + label76.Text = "0.01kvarh"; + // + // label77 // - // label47 + label77.AutoSize = true; + label77.Location = new Point(460, 210); + label77.Name = "label77"; + label77.Size = new Size(118, 20); + label77.TabIndex = 54; + label77.Text = "组合有功峰电能 "; // - label47.AutoSize = true; - label47.Location = new Point(460, 120); - label47.Name = "label47"; - label47.Size = new Size(118, 20); - label47.TabIndex = 24; - label47.Text = "正向有功峰电能 "; + // label78 // - // label48 + label78.AutoSize = true; + label78.Location = new Point(355, 210); + label78.Name = "label78"; + label78.Size = new Size(79, 20); + label78.TabIndex = 53; + label78.Text = "0.01kvarh"; // - label48.AutoSize = true; - label48.Location = new Point(355, 120); - label48.Name = "label48"; - label48.Size = new Size(80, 20); - label48.TabIndex = 23; - label48.Text = "0.01kWh "; + // label79 // - // label49 + label79.AutoSize = true; + label79.Location = new Point(227, 210); + label79.Name = "label79"; + label79.Size = new Size(122, 20); + label79.TabIndex = 52; + label79.Text = "组合有功尖电能 "; // - label49.AutoSize = true; - label49.Location = new Point(227, 120); - label49.Name = "label49"; - label49.Size = new Size(122, 20); - label49.TabIndex = 22; - label49.Text = "正向有功尖电能 "; + // label80 // - // label50 + label80.AutoSize = true; + label80.Location = new Point(143, 210); + label80.Name = "label80"; + label80.Size = new Size(79, 20); + label80.TabIndex = 51; + label80.Text = "0.01kvarh"; // - label50.AutoSize = true; - label50.Location = new Point(143, 120); - label50.Name = "label50"; - label50.Size = new Size(80, 20); - label50.TabIndex = 21; - label50.Text = "0.01kWh "; + // label81 // - // label51 + label81.AutoSize = true; + label81.Location = new Point(19, 210); + label81.Name = "label81"; + label81.Size = new Size(129, 20); + label81.TabIndex = 50; + label81.Text = "一象限无功总电能"; // - label51.AutoSize = true; - label51.Location = new Point(19, 120); - label51.Name = "label51"; - label51.Size = new Size(118, 20); - label51.TabIndex = 20; - label51.Text = "反向有功总电能 "; + // label62 // - // label32 + label62.AutoSize = true; + label62.Location = new Point(1063, 179); + label62.Name = "label62"; + label62.Size = new Size(79, 20); + label62.TabIndex = 49; + label62.Text = "0.01kvarh"; // - label32.AutoSize = true; - label32.Location = new Point(1065, 81); - label32.Name = "label32"; - label32.Size = new Size(72, 20); - label32.TabIndex = 19; - label32.Text = "0.01kWh"; + // label63 // - // label33 + label63.AutoSize = true; + label63.Location = new Point(925, 179); + label63.Name = "label63"; + label63.Size = new Size(114, 20); + label63.TabIndex = 48; + label63.Text = "组合有功谷电能"; // - label33.AutoSize = true; - label33.Location = new Point(927, 81); - label33.Name = "label33"; - label33.Size = new Size(114, 20); - label33.TabIndex = 18; - label33.Text = "组合有功谷电能"; + // label64 // - // label34 + label64.AutoSize = true; + label64.Location = new Point(815, 179); + label64.Name = "label64"; + label64.Size = new Size(79, 20); + label64.TabIndex = 47; + label64.Text = "0.01kvarh"; // - label34.AutoSize = true; - label34.Location = new Point(817, 81); - label34.Name = "label34"; - label34.Size = new Size(72, 20); - label34.TabIndex = 17; - label34.Text = "0.01kWh"; + // label65 // - // label35 + label65.AutoSize = true; + label65.Location = new Point(691, 179); + label65.Name = "label65"; + label65.Size = new Size(118, 20); + label65.TabIndex = 46; + label65.Text = "组合有功平电能 "; // - label35.AutoSize = true; - label35.Location = new Point(693, 81); - label35.Name = "label35"; - label35.Size = new Size(118, 20); - label35.TabIndex = 16; - label35.Text = "组合有功平电能 "; + // label66 // - // label36 + label66.AutoSize = true; + label66.Location = new Point(584, 179); + label66.Name = "label66"; + label66.Size = new Size(79, 20); + label66.TabIndex = 45; + label66.Text = "0.01kvarh"; // - label36.AutoSize = true; - label36.Location = new Point(586, 81); - label36.Name = "label36"; - label36.Size = new Size(72, 20); - label36.TabIndex = 15; - label36.Text = "0.01kWh"; + // label67 // - // label37 + label67.AutoSize = true; + label67.Location = new Point(460, 179); + label67.Name = "label67"; + label67.Size = new Size(118, 20); + label67.TabIndex = 44; + label67.Text = "组合有功峰电能 "; // - label37.AutoSize = true; - label37.Location = new Point(462, 81); - label37.Name = "label37"; - label37.Size = new Size(118, 20); - label37.TabIndex = 14; - label37.Text = "组合有功峰电能 "; + // label68 // - // label38 + label68.AutoSize = true; + label68.Location = new Point(355, 179); + label68.Name = "label68"; + label68.Size = new Size(79, 20); + label68.TabIndex = 43; + label68.Text = "0.01kvarh"; // - label38.AutoSize = true; - label38.Location = new Point(357, 81); - label38.Name = "label38"; - label38.Size = new Size(80, 20); - label38.TabIndex = 13; - label38.Text = "0.01kWh "; + // label69 // - // label39 + label69.AutoSize = true; + label69.Location = new Point(227, 179); + label69.Name = "label69"; + label69.Size = new Size(122, 20); + label69.TabIndex = 42; + label69.Text = "组合有功尖电能 "; // - label39.AutoSize = true; - label39.Location = new Point(229, 81); - label39.Name = "label39"; - label39.Size = new Size(122, 20); - label39.TabIndex = 12; - label39.Text = "组合有功尖电能 "; + // label70 // - // label40 + label70.AutoSize = true; + label70.Location = new Point(143, 179); + label70.Name = "label70"; + label70.Size = new Size(79, 20); + label70.TabIndex = 41; + label70.Text = "0.01kvarh"; // - label40.AutoSize = true; - label40.Location = new Point(145, 81); - label40.Name = "label40"; - label40.Size = new Size(80, 20); - label40.TabIndex = 11; - label40.Text = "0.01kWh "; + // label71 // - // label41 + label71.AutoSize = true; + label71.Location = new Point(19, 179); + label71.Name = "label71"; + label71.Size = new Size(127, 20); + label71.TabIndex = 40; + label71.Text = "组合无功2总电能 "; // - label41.AutoSize = true; - label41.Location = new Point(21, 81); - label41.Name = "label41"; - label41.Size = new Size(118, 20); - label41.TabIndex = 10; - label41.Text = "正向有功总电能 "; + // label52 // - // label30 + label52.AutoSize = true; + label52.Location = new Point(1065, 149); + label52.Name = "label52"; + label52.Size = new Size(79, 20); + label52.TabIndex = 39; + label52.Text = "0.01kvarh"; // - label30.AutoSize = true; - label30.Location = new Point(1065, 43); - label30.Name = "label30"; - label30.Size = new Size(72, 20); - label30.TabIndex = 9; - label30.Text = "0.01kWh"; + // label53 // - // label31 + label53.AutoSize = true; + label53.Location = new Point(927, 149); + label53.Name = "label53"; + label53.Size = new Size(127, 20); + label53.TabIndex = 38; + label53.Text = "组合无功1谷电能 "; // - label31.AutoSize = true; - label31.Location = new Point(927, 43); - label31.Name = "label31"; - label31.Size = new Size(114, 20); - label31.TabIndex = 8; - label31.Text = "组合有功谷电能"; + // label54 // - // label28 + label54.AutoSize = true; + label54.Location = new Point(817, 149); + label54.Name = "label54"; + label54.Size = new Size(79, 20); + label54.TabIndex = 37; + label54.Text = "0.01kvarh"; // - label28.AutoSize = true; - label28.Location = new Point(817, 43); - label28.Name = "label28"; - label28.Size = new Size(72, 20); - label28.TabIndex = 7; - label28.Text = "0.01kWh"; + // label55 + // + label55.AutoSize = true; + label55.Location = new Point(693, 149); + label55.Name = "label55"; + label55.Size = new Size(127, 20); + label55.TabIndex = 36; + label55.Text = "组合无功1平电能 "; // - // label29 + // label56 // - label29.AutoSize = true; - label29.Location = new Point(693, 43); - label29.Name = "label29"; - label29.Size = new Size(118, 20); - label29.TabIndex = 6; - label29.Text = "组合有功平电能 "; + label56.AutoSize = true; + label56.Location = new Point(586, 149); + label56.Name = "label56"; + label56.Size = new Size(79, 20); + label56.TabIndex = 35; + label56.Text = "0.01kvarh"; // - // label26 + // label57 // - label26.AutoSize = true; - label26.Location = new Point(586, 43); - label26.Name = "label26"; - label26.Size = new Size(72, 20); - label26.TabIndex = 5; - label26.Text = "0.01kWh"; + label57.AutoSize = true; + label57.Location = new Point(462, 149); + label57.Name = "label57"; + label57.Size = new Size(127, 20); + label57.TabIndex = 34; + label57.Text = "组合无功1峰电能 "; // - // label27 + // label58 // - label27.AutoSize = true; - label27.Location = new Point(462, 43); - label27.Name = "label27"; - label27.Size = new Size(118, 20); - label27.TabIndex = 4; - label27.Text = "组合有功峰电能 "; + label58.AutoSize = true; + label58.Location = new Point(357, 149); + label58.Name = "label58"; + label58.Size = new Size(79, 20); + label58.TabIndex = 33; + label58.Text = "0.01kvarh"; // - // label24 + // label59 // - label24.AutoSize = true; - label24.Location = new Point(357, 43); - label24.Name = "label24"; - label24.Size = new Size(80, 20); - label24.TabIndex = 3; - label24.Text = "0.01kWh "; + label59.AutoSize = true; + label59.Location = new Point(229, 149); + label59.Name = "label59"; + label59.Size = new Size(127, 20); + label59.TabIndex = 32; + label59.Text = "组合无功1尖电能 "; // - // label25 + // label60 // - label25.AutoSize = true; - label25.Location = new Point(229, 43); - label25.Name = "label25"; - label25.Size = new Size(122, 20); - label25.TabIndex = 2; - label25.Text = "组合有功尖电能 "; + label60.AutoSize = true; + label60.Location = new Point(145, 149); + label60.Name = "label60"; + label60.Size = new Size(79, 20); + label60.TabIndex = 31; + label60.Text = "0.01kvarh"; // - // label23 + // label61 // - label23.AutoSize = true; - label23.Location = new Point(145, 43); - label23.Name = "label23"; - label23.Size = new Size(80, 20); - label23.TabIndex = 1; - label23.Text = "0.01kWh "; + label61.AutoSize = true; + label61.Location = new Point(21, 149); + label61.Name = "label61"; + label61.Size = new Size(123, 20); + label61.TabIndex = 30; + label61.Text = "组合无功1总电能"; // - // label19 + // label42 // - label19.AutoSize = true; - label19.Location = new Point(21, 43); - label19.Name = "label19"; - label19.Size = new Size(118, 20); - label19.TabIndex = 0; - label19.Text = "组合有功总电能 "; + label42.AutoSize = true; + label42.Location = new Point(1063, 120); + label42.Name = "label42"; + label42.Size = new Size(72, 20); + label42.TabIndex = 29; + label42.Text = "0.01kWh"; // - // BtnToggle + // label43 // - BtnToggle.Location = new Point(1023, 508); - BtnToggle.Name = "BtnToggle"; - BtnToggle.Size = new Size(114, 29); - BtnToggle.TabIndex = 150; - BtnToggle.Text = "数据显示切换"; - BtnToggle.UseVisualStyleBackColor = true; - BtnToggle.Click += BtnToggle_Click; + label43.AutoSize = true; + label43.Location = new Point(925, 120); + label43.Name = "label43"; + label43.Size = new Size(114, 20); + label43.TabIndex = 28; + label43.Text = "正向有功谷电能"; // - // label172 + // label44 // - label172.AutoSize = true; - label172.Location = new Point(1022, 419); - label172.Name = "label172"; - label172.Size = new Size(69, 20); - label172.TabIndex = 151; - label172.Text = "0.0001A"; + label44.AutoSize = true; + label44.Location = new Point(815, 120); + label44.Name = "label44"; + label44.Size = new Size(72, 20); + label44.TabIndex = 27; + label44.Text = "0.01kWh"; // - // label173 + // label45 // - label173.AutoSize = true; - label173.Location = new Point(938, 419); - label173.Name = "label173"; - label173.Size = new Size(64, 20); - label173.TabIndex = 150; - label173.Text = "C相电流"; + label45.AutoSize = true; + label45.Location = new Point(691, 120); + label45.Name = "label45"; + label45.Size = new Size(118, 20); + label45.TabIndex = 26; + label45.Text = "正向有功平电能 "; // - // label142 + // label46 // - label142.AutoSize = true; - label142.Location = new Point(817, 581); - label142.Name = "label142"; - label142.Size = new Size(59, 20); - label142.TabIndex = 159; - label142.Text = "0.01Hz"; + label46.AutoSize = true; + label46.Location = new Point(584, 120); + label46.Name = "label46"; + label46.Size = new Size(72, 20); + label46.TabIndex = 25; + label46.Text = "0.01kWh"; // - // label143 + // label47 // - label143.AutoSize = true; - label143.Location = new Point(693, 581); - label143.Name = "label143"; - label143.Size = new Size(69, 20); - label143.TabIndex = 158; - label143.Text = "电网频率"; + label47.AutoSize = true; + label47.Location = new Point(460, 120); + label47.Name = "label47"; + label47.Size = new Size(118, 20); + label47.TabIndex = 24; + label47.Text = "正向有功峰电能 "; // - // label152 + // label48 // - label152.AutoSize = true; - label152.Location = new Point(586, 581); - label152.Name = "label152"; - label152.Size = new Size(46, 20); - label152.TabIndex = 157; - label152.Text = "0.01°"; + label48.AutoSize = true; + label48.Location = new Point(355, 120); + label48.Name = "label48"; + label48.Size = new Size(80, 20); + label48.TabIndex = 23; + label48.Text = "0.01kWh "; // - // label153 + // label49 // - label153.AutoSize = true; - label153.Location = new Point(462, 581); - label153.Name = "label153"; - label153.Size = new Size(69, 20); - label153.TabIndex = 156; - label153.Text = "A 相相角"; + label49.AutoSize = true; + label49.Location = new Point(227, 120); + label49.Name = "label49"; + label49.Size = new Size(122, 20); + label49.TabIndex = 22; + label49.Text = "正向有功尖电能 "; // - // label162 + // label50 // - label162.AutoSize = true; - label162.Location = new Point(357, 581); - label162.Name = "label162"; - label162.Size = new Size(46, 20); - label162.TabIndex = 155; - label162.Text = "0.01°"; + label50.AutoSize = true; + label50.Location = new Point(143, 120); + label50.Name = "label50"; + label50.Size = new Size(80, 20); + label50.TabIndex = 21; + label50.Text = "0.01kWh "; // - // label163 + // label51 // - label163.AutoSize = true; - label163.Location = new Point(229, 581); - label163.Name = "label163"; - label163.Size = new Size(69, 20); - label163.TabIndex = 154; - label163.Text = "A 相相角"; + label51.AutoSize = true; + label51.Location = new Point(19, 120); + label51.Name = "label51"; + label51.Size = new Size(118, 20); + label51.TabIndex = 20; + label51.Text = "反向有功总电能 "; // - // label174 + // label32 // - label174.AutoSize = true; - label174.Location = new Point(145, 581); - label174.Name = "label174"; - label174.Size = new Size(46, 20); - label174.TabIndex = 153; - label174.Text = "0.01°"; + label32.AutoSize = true; + label32.Location = new Point(1065, 81); + label32.Name = "label32"; + label32.Size = new Size(72, 20); + label32.TabIndex = 19; + label32.Text = "0.01kWh"; // - // label175 + // label33 // - label175.AutoSize = true; - label175.Location = new Point(21, 581); - label175.Name = "label175"; - label175.Size = new Size(69, 20); - label175.TabIndex = 152; - label175.Text = "A 相相角"; + label33.AutoSize = true; + label33.Location = new Point(927, 81); + label33.Name = "label33"; + label33.Size = new Size(114, 20); + label33.TabIndex = 18; + label33.Text = "组合有功谷电能"; // - // label176 + // label34 // - label176.AutoSize = true; - label176.Location = new Point(1061, 615); - label176.Name = "label176"; - label176.Size = new Size(68, 20); - label176.TabIndex = 169; - label176.Text = "0.0001V"; + label34.AutoSize = true; + label34.Location = new Point(817, 81); + label34.Name = "label34"; + label34.Size = new Size(72, 20); + label34.TabIndex = 17; + label34.Text = "0.01kWh"; // - // label177 + // label35 // - label177.AutoSize = true; - label177.Location = new Point(923, 615); - label177.Name = "label177"; - label177.Size = new Size(114, 20); - label177.TabIndex = 168; - label177.Text = "三相平均相电压"; + label35.AutoSize = true; + label35.Location = new Point(693, 81); + label35.Name = "label35"; + label35.Size = new Size(118, 20); + label35.TabIndex = 16; + label35.Text = "组合有功平电能 "; // - // label178 + // label36 // - label178.AutoSize = true; - label178.Location = new Point(813, 615); - label178.Name = "label178"; - label178.Size = new Size(68, 20); - label178.TabIndex = 167; - label178.Text = "0.0001V"; + label36.AutoSize = true; + label36.Location = new Point(586, 81); + label36.Name = "label36"; + label36.Size = new Size(72, 20); + label36.TabIndex = 15; + label36.Text = "0.01kWh"; // - // label179 + // label37 // - label179.AutoSize = true; - label179.Location = new Point(689, 615); - label179.Name = "label179"; - label179.Size = new Size(122, 20); - label179.TabIndex = 166; - label179.Text = "三相平均线电压 "; + label37.AutoSize = true; + label37.Location = new Point(462, 81); + label37.Name = "label37"; + label37.Size = new Size(118, 20); + label37.TabIndex = 14; + label37.Text = "组合有功峰电能 "; // - // label180 + // label38 // - label180.AutoSize = true; - label180.Location = new Point(582, 615); - label180.Name = "label180"; - label180.Size = new Size(68, 20); - label180.TabIndex = 165; - label180.Text = "0.0001V"; + label38.AutoSize = true; + label38.Location = new Point(357, 81); + label38.Name = "label38"; + label38.Size = new Size(80, 20); + label38.TabIndex = 13; + label38.Text = "0.01kWh "; // - // label181 + // label39 // - label181.AutoSize = true; - label181.Location = new Point(458, 615); - label181.Name = "label181"; - label181.Size = new Size(84, 20); - label181.TabIndex = 164; - label181.Text = "A 相线电压"; + label39.AutoSize = true; + label39.Location = new Point(229, 81); + label39.Name = "label39"; + label39.Size = new Size(122, 20); + label39.TabIndex = 12; + label39.Text = "组合有功尖电能 "; // - // label182 + // label40 // - label182.AutoSize = true; - label182.Location = new Point(353, 615); - label182.Name = "label182"; - label182.Size = new Size(68, 20); - label182.TabIndex = 163; - label182.Text = "0.0001V"; + label40.AutoSize = true; + label40.Location = new Point(145, 81); + label40.Name = "label40"; + label40.Size = new Size(80, 20); + label40.TabIndex = 11; + label40.Text = "0.01kWh "; // - // label183 + // label41 // - label183.AutoSize = true; - label183.Location = new Point(225, 615); - label183.Name = "label183"; - label183.Size = new Size(84, 20); - label183.TabIndex = 162; - label183.Text = "A 相线电压"; + label41.AutoSize = true; + label41.Location = new Point(21, 81); + label41.Name = "label41"; + label41.Size = new Size(118, 20); + label41.TabIndex = 10; + label41.Text = "正向有功总电能 "; // - // label184 + // label30 // - label184.AutoSize = true; - label184.Location = new Point(141, 615); - label184.Name = "label184"; - label184.Size = new Size(68, 20); - label184.TabIndex = 161; - label184.Text = "0.0001V"; + label30.AutoSize = true; + label30.Location = new Point(1065, 43); + label30.Name = "label30"; + label30.Size = new Size(72, 20); + label30.TabIndex = 9; + label30.Text = "0.01kWh"; // - // label185 + // label31 // - label185.AutoSize = true; - label185.Location = new Point(17, 615); - label185.Name = "label185"; - label185.Size = new Size(84, 20); - label185.TabIndex = 160; - label185.Text = "A 相线电压"; + label31.AutoSize = true; + label31.Location = new Point(927, 43); + label31.Name = "label31"; + label31.Size = new Size(114, 20); + label31.TabIndex = 8; + label31.Text = "组合有功谷电能"; // - // label186 + // label28 // - label186.AutoSize = true; - label186.Location = new Point(815, 545); - label186.Name = "label186"; - label186.Size = new Size(49, 20); - label186.TabIndex = 177; - label186.Text = "0.001"; + label28.AutoSize = true; + label28.Location = new Point(817, 43); + label28.Name = "label28"; + label28.Size = new Size(72, 20); + label28.TabIndex = 7; + label28.Text = "0.01kWh"; // - // label187 + // label29 // - label187.AutoSize = true; - label187.Location = new Point(691, 545); - label187.Name = "label187"; - label187.Size = new Size(95, 20); - label187.TabIndex = 176; - label187.Text = "A相功率因数"; + label29.AutoSize = true; + label29.Location = new Point(693, 43); + label29.Name = "label29"; + label29.Size = new Size(118, 20); + label29.TabIndex = 6; + label29.Text = "组合有功平电能 "; // - // label188 + // label26 // - label188.AutoSize = true; - label188.Location = new Point(584, 545); - label188.Name = "label188"; - label188.Size = new Size(49, 20); - label188.TabIndex = 175; - label188.Text = "0.001"; + label26.AutoSize = true; + label26.Location = new Point(586, 43); + label26.Name = "label26"; + label26.Size = new Size(72, 20); + label26.TabIndex = 5; + label26.Text = "0.01kWh"; // - // label189 + // label27 // - label189.AutoSize = true; - label189.Location = new Point(460, 545); - label189.Name = "label189"; - label189.Size = new Size(95, 20); - label189.TabIndex = 174; - label189.Text = "A相功率因数"; + label27.AutoSize = true; + label27.Location = new Point(462, 43); + label27.Name = "label27"; + label27.Size = new Size(118, 20); + label27.TabIndex = 4; + label27.Text = "组合有功峰电能 "; // - // label190 + // label24 // - label190.AutoSize = true; - label190.Location = new Point(355, 545); - label190.Name = "label190"; - label190.Size = new Size(49, 20); - label190.TabIndex = 173; - label190.Text = "0.001"; + label24.AutoSize = true; + label24.Location = new Point(357, 43); + label24.Name = "label24"; + label24.Size = new Size(80, 20); + label24.TabIndex = 3; + label24.Text = "0.01kWh "; // - // label191 + // label25 // - label191.AutoSize = true; - label191.Location = new Point(227, 545); - label191.Name = "label191"; - label191.Size = new Size(95, 20); - label191.TabIndex = 172; - label191.Text = "A相功率因数"; + label25.AutoSize = true; + label25.Location = new Point(229, 43); + label25.Name = "label25"; + label25.Size = new Size(122, 20); + label25.TabIndex = 2; + label25.Text = "组合有功尖电能 "; // - // label192 + // label23 // - label192.AutoSize = true; - label192.Location = new Point(143, 545); - label192.Name = "label192"; - label192.Size = new Size(49, 20); - label192.TabIndex = 171; - label192.Text = "0.001"; + label23.AutoSize = true; + label23.Location = new Point(145, 43); + label23.Name = "label23"; + label23.Size = new Size(80, 20); + label23.TabIndex = 1; + label23.Text = "0.01kWh "; // - // label193 + // label19 // - label193.AutoSize = true; - label193.Location = new Point(19, 545); - label193.Name = "label193"; - label193.Size = new Size(88, 20); - label193.TabIndex = 170; - label193.Text = "总功率因数 "; + label19.AutoSize = true; + label19.Location = new Point(21, 43); + label19.Name = "label19"; + label19.Size = new Size(118, 20); + label19.TabIndex = 0; + label19.Text = "组合有功总电能 "; // // FrmPLCConnect // @@ -2641,17 +2659,17 @@ } #endregion - private Button button18; - private TextBox textBox20; + private Button BtnWrite18; + private TextBox textBox18; private Label label18; - private Button button17; - private TextBox textBox19; + private Button BtnWrite17; + private TextBox textBox17; private Label label17; - private Button button16; - private TextBox textBox18; + private Button BtnWrite16; + private TextBox textBox16; private Label label16; - private Button button15; - private TextBox textBox17; + private Button BtnWrite15; + private TextBox textBox15; private Label label15; private GroupBox groupBox1; private Button BtnCollectionAssignment; @@ -2663,46 +2681,46 @@ private Button BtnConnect; private TextBox TxtPort; private TextBox TxtIp; - private Button button14; + private Button BtnWrite14; private TextBox textBox14; private Label label14; - private Button button13; + private Button BtnWrite13; private TextBox textBox13; private Label label13; - private Button button12; + private Button BtnWrite12; private TextBox textBox12; private Label label12; - private Button button11; + private Button BtnWrite11; private TextBox textBox11; private Label label11; - private Button button10; + private Button BtnWrite10; private TextBox textBox10; private Label label10; - private Button button9; + private Button BtnWrite09; private TextBox textBox9; private Label label9; - private Button button8; + private Button BtnWrite08; private TextBox textBox8; private Label label8; - private Button button7; + private Button BtnWrite07; private TextBox textBox7; private Label label7; - private Button button6; + private Button BtnWrite06; private TextBox textBox6; private Label label6; - private Button button5; + private Button BtnWrite05; private TextBox textBox5; private Label label5; - private Button button4; + private Button BtnWrite04; private TextBox textBox4; private Label label4; - private Button button3; + private Button BtnWrite03; private TextBox textBox3; private Label label3; - private Button button2; + private Button BtnWrite02; private TextBox textBox2; private Label label2; - private Button button1; + private Button BtnWrite01; private TextBox textBox1; private Label label1; private GroupBox groupBox2; diff --git a/WinFormStarter/FrmPLCConnect.cs b/WinFormStarter/FrmPLCConnect.cs index 19b8dd1..4474d0e 100644 --- a/WinFormStarter/FrmPLCConnect.cs +++ b/WinFormStarter/FrmPLCConnect.cs @@ -2,7 +2,11 @@ using HslCommunication.Core.Address; using HslCommunication.ModBus; using HybirdFrameworkCore.Utils; +using HybirdFrameworkDriver.ModbusTcpMaster; +using HybirdFrameworkDriver.TcpServer; +using HybirdFrameworkServices.Init.Entity; using HybirdFrameworkServices.Plc; +using SqlSugar; using System; using System.Collections.Generic; using System.ComponentModel; @@ -13,6 +17,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using static StackExchange.Redis.Role; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button; namespace WinFormStarter @@ -50,15 +55,14 @@ namespace WinFormStarter } #endregion - PlcReadAndWritten PlcReadAndWritten; - PlcReadonly PlcReadonly; - PlcTurnsRatio PlcTurnsRatio; + PlcDate PlcDate = new PlcDate(); public FrmPLCConnect() { InitializeComponent(); } + #region 连接 private void BtnConnect_Click(object sender, EventArgs e) { //简单判断 @@ -90,203 +94,555 @@ namespace WinFormStarter LblConState.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "连接失败"; } } + #endregion + #region 读取 private void BtnCollectionAssignment_Click(object sender, EventArgs e) { - OperateResult read1 = _client.Read("x=3;100", 164); - OperateResult read2 = _client.Read("x=3;39424", 110); - OperateResult read3 = _client.Read("x=3;40960", 18); - - PlcReadAndWritten = ModelConvert.Decode(read1.Content); - PlcReadonly = ModelConvert.Decode(read1.Content); - PlcTurnsRatio = ModelConvert.Decode(read1.Content); - - textBox1.Text = PlcReadAndWritten.ProgrammingEnable.ToString(); - textBox2.Text = PlcReadAndWritten.Modbus1Addres.ToString(); - textBox3.Text = PlcReadAndWritten.BaudRate.ToString(); - textBox4.Text = PlcReadAndWritten.CheckBit.ToString(); - textBox5.Text = PlcReadAndWritten.Seconds.ToString(); - textBox6.Text = PlcReadAndWritten.Points.ToString(); - textBox7.Text = PlcReadAndWritten.When.ToString(); - textBox8.Text = PlcReadAndWritten.Weeks.ToString(); - textBox9.Text = PlcReadAndWritten.Day.ToString(); - textBox10.Text = PlcReadAndWritten.Month.ToString(); - textBox11.Text = PlcReadAndWritten.Years.ToString(); - textBox12.Text = PlcReadAndWritten.Modbus1Addres2.ToString(); - textBox13.Text = PlcReadAndWritten.Reserve.ToString(); - textBox14.Text = PlcReadAndWritten.VoltageRatio.ToString(); - textBox17.Text = PlcReadAndWritten.CurrentRatio.ToString(); - textBox18.Text = PlcReadAndWritten.PulsePerSecond.ToString(); - textBox19.Text = PlcReadAndWritten.CurrentReversal.ToString(); - textBox20.Text = PlcReadAndWritten.MeterReset.ToString(); + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo==null) + { + MessageBox.Show("PLC未连接"); + return; + } + + textBox1.Text = plcInfo.PlcReadAndWritten1.ProgrammingEnable.ToString(); + textBox2.Text = plcInfo.PlcReadAndWritten1.Modbus1Addres.ToString(); + textBox3.Text = plcInfo.PlcReadAndWritten1.BaudRate.ToString(); + textBox4.Text = plcInfo.PlcReadAndWritten1.CheckBit.ToString(); + textBox5.Text = plcInfo.PlcReadAndWritten2.Seconds.ToString(); + textBox6.Text = plcInfo.PlcReadAndWritten2.Points.ToString(); + textBox7.Text = plcInfo.PlcReadAndWritten2.When.ToString(); + textBox8.Text = plcInfo.PlcReadAndWritten2.Weeks.ToString(); + textBox9.Text = plcInfo.PlcReadAndWritten2.Day.ToString(); + textBox10.Text = plcInfo.PlcReadAndWritten2.Month.ToString(); + textBox11.Text = plcInfo.PlcReadAndWritten2.Years.ToString(); + textBox12.Text = plcInfo.PlcReadAndWritten2.Modbus1Addres2.ToString(); + textBox13.Text = plcInfo.PlcReadAndWritten2.Reserve.ToString(); + textBox14.Text = plcInfo.PlcReadAndWritten2.VoltageRatio.ToString(); + textBox15.Text = plcInfo.PlcReadAndWritten2.CurrentRatio.ToString(); + textBox16.Text = plcInfo.PlcReadAndWritten1.PulsePerSecond.ToString(); + textBox17.Text = plcInfo.PlcReadAndWritten1.CurrentReversal.ToString(); + textBox18.Text = plcInfo.PlcReadAndWritten1.MeterReset.ToString(); + string datetime = plcInfo.PlcReadAndWritten2.Years + "-" + + plcInfo.PlcReadAndWritten2.Month + "-" + + plcInfo.PlcReadAndWritten2.Day + " " + + plcInfo.PlcReadAndWritten2.When + ":" + + plcInfo.PlcReadAndWritten2.Points + ":" + + plcInfo.PlcReadAndWritten2.Seconds; } + #endregion + #region 切换数据 bool now; private void BtnToggle_Click(object sender, EventArgs e) { + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + now = !now; if (now) { - + #region - label31.Text = PlcReadonly.GroupHaveAll.ToString(); - label29.Text = PlcReadonly.GroupHaveTip.ToString(); - label27.Text = PlcReadonly.GroupHavePeak.ToString(); - label25.Text = PlcReadonly.GroupHaveFlat.ToString(); - label19.Text = PlcReadonly.GroupHaveValley.ToString(); - label40.Text = PlcReadonly.ForwardHaveAll.ToString(); - label38.Text = PlcReadonly.ForwardHaveTip.ToString(); - label36.Text = PlcReadonly.ForwardHavePeak.ToString(); - label34.Text = PlcReadonly.ForwardHaveFlat.ToString(); - label32.Text = PlcReadonly.ForwardHaveValley.ToString(); - label50.Text = PlcReadonly.ReverseHaveAll.ToString(); - label48.Text = PlcReadonly.ReverseHaveTip.ToString(); - label46.Text = PlcReadonly.ReverseHavePeak.ToString(); - label44.Text = PlcReadonly.ReverseHaveFlat.ToString(); - label42.Text = PlcReadonly.ReverseHaveValley.ToString(); - label60.Text = PlcReadonly.GroupNoAll1.ToString(); - label58.Text = PlcReadonly.GroupNoTip1.ToString(); - label56.Text = PlcReadonly.GroupNoPeak1.ToString(); - label54.Text = PlcReadonly.GroupNoFlat1.ToString(); - label52.Text = PlcReadonly.GroupNoValley1.ToString(); - label70.Text = PlcReadonly.GroupNoAll2.ToString(); - label68.Text = PlcReadonly.GroupNoTip2.ToString(); - label66.Text = PlcReadonly.GroupNoPeak2.ToString(); - label64.Text = PlcReadonly.GroupNoFlat2.ToString(); - label62.Text = PlcReadonly.GroupNoValley2.ToString(); - label80.Text = PlcReadonly.QuadrantNoAll1.ToString(); - label78.Text = PlcReadonly.QuadrantNoTip1.ToString(); - label76.Text = PlcReadonly.QuadrantNoPeak1.ToString(); - label74.Text = PlcReadonly.QuadrantNoFlat1.ToString(); - label72.Text = PlcReadonly.QuadrantNoValley1.ToString(); - label90.Text = PlcReadonly.QuadrantNoAll2.ToString(); - label88.Text = PlcReadonly.QuadrantNoTip2.ToString(); - label86.Text = PlcReadonly.QuadrantNoPeak2.ToString(); - label84.Text = PlcReadonly.QuadrantNoFlat2.ToString(); - label82.Text = PlcReadonly.QuadrantNoValley2.ToString(); - label100.Text = PlcReadonly.QuadrantNoAll3.ToString(); - label98.Text = PlcReadonly.QuadrantNoTip3.ToString(); - label96.Text = PlcReadonly.QuadrantNoPeak3.ToString(); - label94.Text = PlcReadonly.QuadrantNoFlat3.ToString(); - label92.Text = PlcReadonly.QuadrantNoValley3.ToString(); - label110.Text = PlcReadonly.QuadrantNoAll4.ToString(); - label108.Text = PlcReadonly.QuadrantNoTip4.ToString(); - label106.Text = PlcReadonly.QuadrantNoPeak4.ToString(); - label104.Text = PlcReadonly.QuadrantNoFlat4.ToString(); - label102.Text = PlcReadonly.QuadrantNoValley4.ToString(); - label120.Text = PlcReadonly.ForwardHaveApparentAll.ToString(); - label118.Text = PlcReadonly.ForwardHaveApparentTip.ToString(); - label116.Text = PlcReadonly.ForwardHaveApparentPeak.ToString(); - label114.Text = PlcReadonly.ForwardHaveApparentFlat.ToString(); - label112.Text = PlcReadonly.ForwardHaveApparentValley.ToString(); - label130.Text = PlcReadonly.ReverseHaveApparentAll.ToString(); - label128.Text = PlcReadonly.ReverseHaveApparentTip.ToString(); - label126.Text = PlcReadonly.ReverseHaveApparentPeak.ToString(); - label124.Text = PlcReadonly.ReverseHaveApparentFlat.ToString(); - label122.Text = PlcReadonly.ReverseHaveApparentValley.ToString(); - - - label140.Text = PlcReadonly.PhaseVoltageA.ToString(); - label138.Text = PlcReadonly.PhaseVoltageB.ToString(); - label136.Text = PlcReadonly.PhaseVoltageC.ToString(); - label134.Text = PlcReadonly.PhaseElectricityA.ToString(); - label132.Text = PlcReadonly.PhaseElectricityB.ToString(); - label172.Text = PlcReadonly.PhaseElectricityC.ToString(); - - label150.Text = PlcReadonly.TotalActivePower.ToString(); - label148.Text = PlcReadonly.TotalActivePowerA.ToString(); - label146.Text = PlcReadonly.TotalActivePowerB.ToString(); - label144.Text = PlcReadonly.TotalActivePowerC.ToString(); - - label160.Text = PlcReadonly.TotalReactivePower.ToString(); - label158.Text = PlcReadonly.TotalReactivePowerA.ToString(); - label156.Text = PlcReadonly.TotalReactivePowerB.ToString(); - label144.Text = PlcReadonly.TotalReactivePowerC.ToString(); - - label170.Text = PlcReadonly.TotalApparentPower.ToString(); - label168.Text = PlcReadonly.TotalApparentPowerA.ToString(); - label166.Text = PlcReadonly.TotalApparentPowerB.ToString(); - label164.Text = PlcReadonly.TotalApparentPowerC.ToString(); - - label192.Text = PlcReadonly.OverallPowerFactor.ToString(); - label190.Text = PlcReadonly.OverallPowerFactorA.ToString(); - label188.Text = PlcReadonly.OverallPowerFactorB.ToString(); - label184.Text = PlcReadonly.OverallPowerFactorC.ToString(); - - label174.Text = PlcReadonly.PhaseAngleA.ToString(); - label162.Text = PlcReadonly.PhaseAngleB.ToString(); - label152.Text = PlcReadonly.PhaseAngleC.ToString(); - label142.Text = PlcReadonly.LineFrequency.ToString(); - - label184.Text = PlcReadonly.PhaseLineVoltageA.ToString(); - label182.Text = PlcReadonly.PhaseLineVoltageB.ToString(); - label180.Text = PlcReadonly.PhaseLineVoltageC.ToString(); - label178.Text = PlcReadonly.ThreePhaseMeanLineVoltage.ToString(); - label176.Text = PlcReadonly.ThreePhaseMeanPhaseVoltage.ToString(); + label31.Text = plcInfo.PlcReadonly.GroupHaveAll.ToString(); + label29.Text = plcInfo.PlcReadonly.GroupHaveTip.ToString(); + label27.Text = plcInfo.PlcReadonly.GroupHavePeak.ToString(); + label25.Text = plcInfo.PlcReadonly.GroupHaveFlat.ToString(); + label19.Text = plcInfo.PlcReadonly.GroupHaveValley.ToString(); + label40.Text = plcInfo.PlcReadonly.ForwardHaveAll.ToString(); + label38.Text = plcInfo.PlcReadonly.ForwardHaveTip.ToString(); + label36.Text = plcInfo.PlcReadonly.ForwardHavePeak.ToString(); + label34.Text = plcInfo.PlcReadonly.ForwardHaveFlat.ToString(); + label32.Text = plcInfo.PlcReadonly.ForwardHaveValley.ToString(); + label50.Text = plcInfo.PlcReadonly.ReverseHaveAll.ToString(); + label48.Text = plcInfo.PlcReadonly.ReverseHaveTip.ToString(); + label46.Text = plcInfo.PlcReadonly.ReverseHavePeak.ToString(); + label44.Text = plcInfo.PlcReadonly.ReverseHaveFlat.ToString(); + label42.Text = plcInfo.PlcReadonly.ReverseHaveValley.ToString(); + label60.Text = plcInfo.PlcReadonly.GroupNoAll1.ToString(); + label58.Text = plcInfo.PlcReadonly.GroupNoTip1.ToString(); + label56.Text = plcInfo.PlcReadonly.GroupNoPeak1.ToString(); + label54.Text = plcInfo.PlcReadonly.GroupNoFlat1.ToString(); + label52.Text = plcInfo.PlcReadonly.GroupNoValley1.ToString(); + label70.Text = plcInfo.PlcReadonly.GroupNoAll2.ToString(); + label68.Text = plcInfo.PlcReadonly.GroupNoTip2.ToString(); + label66.Text = plcInfo.PlcReadonly.GroupNoPeak2.ToString(); + label64.Text = plcInfo.PlcReadonly.GroupNoFlat2.ToString(); + label62.Text = plcInfo.PlcReadonly.GroupNoValley2.ToString(); + label80.Text = plcInfo.PlcReadonly.QuadrantNoAll1.ToString(); + label78.Text = plcInfo.PlcReadonly.QuadrantNoTip1.ToString(); + label76.Text = plcInfo.PlcReadonly.QuadrantNoPeak1.ToString(); + label74.Text = plcInfo.PlcReadonly.QuadrantNoFlat1.ToString(); + label72.Text = plcInfo.PlcReadonly.QuadrantNoValley1.ToString(); + label90.Text = plcInfo.PlcReadonly.QuadrantNoAll2.ToString(); + label88.Text = plcInfo.PlcReadonly.QuadrantNoTip2.ToString(); + label86.Text = plcInfo.PlcReadonly.QuadrantNoPeak2.ToString(); + label84.Text = plcInfo.PlcReadonly.QuadrantNoFlat2.ToString(); + label82.Text = plcInfo.PlcReadonly.QuadrantNoValley2.ToString(); + label100.Text = plcInfo.PlcReadonly.QuadrantNoAll3.ToString(); + label98.Text = plcInfo.PlcReadonly.QuadrantNoTip3.ToString(); + label96.Text = plcInfo.PlcReadonly.QuadrantNoPeak3.ToString(); + label94.Text = plcInfo.PlcReadonly.QuadrantNoFlat3.ToString(); + label92.Text = plcInfo.PlcReadonly.QuadrantNoValley3.ToString(); + label110.Text = plcInfo.PlcReadonly.QuadrantNoAll4.ToString(); + label108.Text = plcInfo.PlcReadonly.QuadrantNoTip4.ToString(); + label106.Text = plcInfo.PlcReadonly.QuadrantNoPeak4.ToString(); + label104.Text = plcInfo.PlcReadonly.QuadrantNoFlat4.ToString(); + label102.Text = plcInfo.PlcReadonly.QuadrantNoValley4.ToString(); + label120.Text = plcInfo.PlcReadonly.ForwardHaveApparentAll.ToString(); + label118.Text = plcInfo.PlcReadonly.ForwardHaveApparentTip.ToString(); + label116.Text = plcInfo.PlcReadonly.ForwardHaveApparentPeak.ToString(); + label114.Text = plcInfo.PlcReadonly.ForwardHaveApparentFlat.ToString(); + label112.Text = plcInfo.PlcReadonly.ForwardHaveApparentValley.ToString(); + label130.Text = plcInfo.PlcReadonly.ReverseHaveApparentAll.ToString(); + label128.Text = plcInfo.PlcReadonly.ReverseHaveApparentTip.ToString(); + label126.Text = plcInfo.PlcReadonly.ReverseHaveApparentPeak.ToString(); + label124.Text = plcInfo.PlcReadonly.ReverseHaveApparentFlat.ToString(); + label122.Text = plcInfo.PlcReadonly.ReverseHaveApparentValley.ToString(); + + + label140.Text = plcInfo.PlcReadonly.PhaseVoltageA.ToString(); + label138.Text = plcInfo.PlcReadonly.PhaseVoltageB.ToString(); + label136.Text = plcInfo.PlcReadonly.PhaseVoltageC.ToString(); + label134.Text = plcInfo.PlcReadonly.PhaseElectricityA.ToString(); + label132.Text = plcInfo.PlcReadonly.PhaseElectricityB.ToString(); + label172.Text = plcInfo.PlcReadonly.PhaseElectricityC.ToString(); + + label150.Text = plcInfo.PlcReadonly.TotalActivePower.ToString(); + label148.Text = plcInfo.PlcReadonly.TotalActivePowerA.ToString(); + label146.Text = plcInfo.PlcReadonly.TotalActivePowerB.ToString(); + label144.Text = plcInfo.PlcReadonly.TotalActivePowerC.ToString(); + + label160.Text = plcInfo.PlcReadonly.TotalReactivePower.ToString(); + label158.Text = plcInfo.PlcReadonly.TotalReactivePowerA.ToString(); + label156.Text = plcInfo.PlcReadonly.TotalReactivePowerB.ToString(); + label144.Text = plcInfo.PlcReadonly.TotalReactivePowerC.ToString(); + + label170.Text = plcInfo.PlcReadonly.TotalApparentPower.ToString(); + label168.Text = plcInfo.PlcReadonly.TotalApparentPowerA.ToString(); + label166.Text = plcInfo.PlcReadonly.TotalApparentPowerB.ToString(); + label164.Text = plcInfo.PlcReadonly.TotalApparentPowerC.ToString(); + + label192.Text = plcInfo.PlcReadonly.OverallPowerFactor.ToString(); + label190.Text = plcInfo.PlcReadonly.OverallPowerFactorA.ToString(); + label188.Text = plcInfo.PlcReadonly.OverallPowerFactorB.ToString(); + label184.Text = plcInfo.PlcReadonly.OverallPowerFactorC.ToString(); + + label174.Text = plcInfo.PlcReadonly.PhaseAngleA.ToString(); + label162.Text = plcInfo.PlcReadonly.PhaseAngleB.ToString(); + label152.Text = plcInfo.PlcReadonly.PhaseAngleC.ToString(); + label142.Text = plcInfo.PlcReadonly.LineFrequency.ToString(); + + label184.Text = plcInfo.PlcReadonly.PhaseLineVoltageA.ToString(); + label182.Text = plcInfo.PlcReadonly.PhaseLineVoltageB.ToString(); + label180.Text = plcInfo.PlcReadonly.PhaseLineVoltageC.ToString(); + label178.Text = plcInfo.PlcReadonly.ThreePhaseMeanLineVoltage.ToString(); + label176.Text = plcInfo.PlcReadonly.ThreePhaseMeanPhaseVoltage.ToString(); #endregion } if (now) { #region - label31.Text = PlcTurnsRatio.GroupHaveAll.ToString(); - label29.Text = PlcTurnsRatio.GroupHaveTip.ToString(); - label27.Text = PlcTurnsRatio.GroupHavePeak.ToString(); - label25.Text = PlcTurnsRatio.GroupHaveFlat.ToString(); - label19.Text = PlcTurnsRatio.GroupHaveValley.ToString(); - label40.Text = PlcTurnsRatio.ForwardHaveAll.ToString(); - label38.Text = PlcTurnsRatio.ForwardHaveTip.ToString(); - label36.Text = PlcTurnsRatio.ForwardHavePeak.ToString(); - label34.Text = PlcTurnsRatio.ForwardHaveFlat.ToString(); - label32.Text = PlcTurnsRatio.ForwardHaveValley.ToString(); - label50.Text = PlcTurnsRatio.ReverseHaveAll.ToString(); - label48.Text = PlcTurnsRatio.ReverseHaveTip.ToString(); - label46.Text = PlcTurnsRatio.ReverseHavePeak.ToString(); - label44.Text = PlcTurnsRatio.ReverseHaveFlat.ToString(); - label42.Text = PlcTurnsRatio.ReverseHaveValley.ToString(); - label60.Text = PlcTurnsRatio.GroupNoAll1.ToString(); - label58.Text = PlcTurnsRatio.GroupNoTip1.ToString(); - label56.Text = PlcTurnsRatio.GroupNoPeak1.ToString(); - label54.Text = PlcTurnsRatio.GroupNoFlat1.ToString(); - label52.Text = PlcTurnsRatio.GroupNoValley1.ToString(); - label70.Text = PlcTurnsRatio.GroupNoAll2.ToString(); - label68.Text = PlcTurnsRatio.GroupNoTip2.ToString(); - label66.Text = PlcTurnsRatio.GroupNoPeak2.ToString(); - label64.Text = PlcTurnsRatio.GroupNoFlat2.ToString(); - label62.Text = PlcTurnsRatio.GroupNoValley2.ToString(); - label80.Text = PlcTurnsRatio.QuadrantNoAll1.ToString(); - label78.Text = PlcTurnsRatio.QuadrantNoTip1.ToString(); - label76.Text = PlcTurnsRatio.QuadrantNoPeak1.ToString(); - label74.Text = PlcTurnsRatio.QuadrantNoFlat1.ToString(); - label72.Text = PlcTurnsRatio.QuadrantNoValley1.ToString(); - label90.Text = PlcTurnsRatio.QuadrantNoAll2.ToString(); - label88.Text = PlcTurnsRatio.QuadrantNoTip2.ToString(); - label86.Text = PlcTurnsRatio.QuadrantNoPeak2.ToString(); - label84.Text = PlcTurnsRatio.QuadrantNoFlat2.ToString(); - label82.Text = PlcTurnsRatio.QuadrantNoValley2.ToString(); - label100.Text = PlcTurnsRatio.QuadrantNoAll3.ToString(); - label98.Text = PlcTurnsRatio.QuadrantNoTip3.ToString(); - label96.Text = PlcTurnsRatio.QuadrantNoPeak3.ToString(); - label94.Text = PlcTurnsRatio.QuadrantNoFlat3.ToString(); - label92.Text = PlcTurnsRatio.QuadrantNoValley3.ToString(); - label110.Text = PlcTurnsRatio.QuadrantNoAll4.ToString(); - label108.Text = PlcTurnsRatio.QuadrantNoTip4.ToString(); - label106.Text = PlcTurnsRatio.QuadrantNoPeak4.ToString(); - label104.Text = PlcTurnsRatio.QuadrantNoFlat4.ToString(); - label102.Text = PlcTurnsRatio.QuadrantNoValley4.ToString(); - label120.Text = PlcTurnsRatio.ForwardHaveApparentAll.ToString(); - label118.Text = PlcTurnsRatio.ForwardHaveApparentTip.ToString(); - label116.Text = PlcTurnsRatio.ForwardHaveApparentPeak.ToString(); - label114.Text = PlcTurnsRatio.ForwardHaveApparentFlat.ToString(); - label112.Text = PlcTurnsRatio.ForwardHaveApparentValley.ToString(); - label130.Text = PlcTurnsRatio.ReverseHaveApparentAll.ToString(); - label128.Text = PlcTurnsRatio.ReverseHaveApparentTip.ToString(); - label126.Text = PlcTurnsRatio.ReverseHaveApparentPeak.ToString(); - label124.Text = PlcTurnsRatio.ReverseHaveApparentFlat.ToString(); - label122.Text = PlcTurnsRatio.ReverseHaveApparentValley.ToString(); + label31.Text = plcInfo.PlcTurnsRatio.GroupHaveAll.ToString(); + label29.Text = plcInfo.PlcTurnsRatio.GroupHaveTip.ToString(); + label27.Text = plcInfo.PlcTurnsRatio.GroupHavePeak.ToString(); + label25.Text = plcInfo.PlcTurnsRatio.GroupHaveFlat.ToString(); + label19.Text = plcInfo.PlcTurnsRatio.GroupHaveValley.ToString(); + label40.Text = plcInfo.PlcTurnsRatio.ForwardHaveAll.ToString(); + label38.Text = plcInfo.PlcTurnsRatio.ForwardHaveTip.ToString(); + label36.Text = plcInfo.PlcTurnsRatio.ForwardHavePeak.ToString(); + label34.Text = plcInfo.PlcTurnsRatio.ForwardHaveFlat.ToString(); + label32.Text = plcInfo.PlcTurnsRatio.ForwardHaveValley.ToString(); + label50.Text = plcInfo.PlcTurnsRatio.ReverseHaveAll.ToString(); + label48.Text = plcInfo.PlcTurnsRatio.ReverseHaveTip.ToString(); + label46.Text = plcInfo.PlcTurnsRatio.ReverseHavePeak.ToString(); + label44.Text = plcInfo.PlcTurnsRatio.ReverseHaveFlat.ToString(); + label42.Text = plcInfo.PlcTurnsRatio.ReverseHaveValley.ToString(); + label60.Text = plcInfo.PlcTurnsRatio.GroupNoAll1.ToString(); + label58.Text = plcInfo.PlcTurnsRatio.GroupNoTip1.ToString(); + label56.Text = plcInfo.PlcTurnsRatio.GroupNoPeak1.ToString(); + label54.Text = plcInfo.PlcTurnsRatio.GroupNoFlat1.ToString(); + label52.Text = plcInfo.PlcTurnsRatio.GroupNoValley1.ToString(); + label70.Text = plcInfo.PlcTurnsRatio.GroupNoAll2.ToString(); + label68.Text = plcInfo.PlcTurnsRatio.GroupNoTip2.ToString(); + label66.Text = plcInfo.PlcTurnsRatio.GroupNoPeak2.ToString(); + label64.Text = plcInfo.PlcTurnsRatio.GroupNoFlat2.ToString(); + label62.Text = plcInfo.PlcTurnsRatio.GroupNoValley2.ToString(); + label80.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll1.ToString(); + label78.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip1.ToString(); + label76.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak1.ToString(); + label74.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat1.ToString(); + label72.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley1.ToString(); + label90.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll2.ToString(); + label88.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip2.ToString(); + label86.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak2.ToString(); + label84.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat2.ToString(); + label82.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley2.ToString(); + label100.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll3.ToString(); + label98.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip3.ToString(); + label96.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak3.ToString(); + label94.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat3.ToString(); + label92.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley3.ToString(); + label110.Text = plcInfo.PlcTurnsRatio.QuadrantNoAll4.ToString(); + label108.Text = plcInfo.PlcTurnsRatio.QuadrantNoTip4.ToString(); + label106.Text = plcInfo.PlcTurnsRatio.QuadrantNoPeak4.ToString(); + label104.Text = plcInfo.PlcTurnsRatio.QuadrantNoFlat4.ToString(); + label102.Text = plcInfo.PlcTurnsRatio.QuadrantNoValley4.ToString(); + label120.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentAll.ToString(); + label118.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentTip.ToString(); + label116.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentPeak.ToString(); + label114.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentFlat.ToString(); + label112.Text = plcInfo.PlcTurnsRatio.ForwardHaveApparentValley.ToString(); + label130.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentAll.ToString(); + label128.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentTip.ToString(); + label126.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentPeak.ToString(); + label124.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentFlat.ToString(); + label122.Text = plcInfo.PlcTurnsRatio.ReverseHaveApparentValley.ToString(); #endregion } } - //TODO::没有数据写入,稍后添加 + #endregion + + #region 方法 + + #endregion 写入方法 + + + private void BtnWrite01_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox1.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if(plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult=session.Write(PlcDate.ProgrammingEnable); + + } + + private void BtnWrite02_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox2.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Modbus1Addres); + } + + private void BtnWrite03_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox3.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.BaudRate); + } + + private void BtnWrite04_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox4.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.CheckBit); + } + + private void BtnWrite05_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox5.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Seconds); + } + + private void BtnWrite06_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox6.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Points); + } + + private void BtnWrite07_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox7.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.When); + } + + private void BtnWrite08_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox8.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Weeks); + } + + private void BtnWrite09_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox9.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Day); + } + + private void BtnWrite10_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox10.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Month); + } + + private void BtnWrite11_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox11.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Years); + } + + private void BtnWrite12_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox12.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Modbus1Addres2); + } + + private void BtnWrite13_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox13.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.Reserve); + } + + private void BtnWrite14_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox14.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.VoltageRatio); + } + + private void BtnWrite15_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox15.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.CurrentRatio); + } + + private void BtnWrite16_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox16.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.PulsePerSecond); + } + + private void BtnWrite17_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox15.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.CurrentReversal); + } + + private void BtnWrite18_Click(object sender, EventArgs e) + { + bool bConvert = int.TryParse(this.textBox16.Text, out int iValue); + if (!bConvert) + { + MessageBox.Show("请输入有效值"); + return; + } + ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo); + if (plcInfo == null) + { + MessageBox.Show("PLC未连接"); + return; + } + ModbusSession session = SessionMgr.GetModbusSession(plcInfo.ChannelId); + bool bResult = session.Write(PlcDate.MeterReset); + } + + #region 进制数据转换 + + + + #endregion } } diff --git a/WinFormStarter/Program.cs b/WinFormStarter/Program.cs index 4851cc3..64a8798 100644 --- a/WinFormStarter/Program.cs +++ b/WinFormStarter/Program.cs @@ -1,6 +1,7 @@ using Autofac; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Configuration; +using HybirdFrameworkServices; using log4net.Config; using SqlSugar; using SqlSugar.IOC; @@ -50,7 +51,10 @@ static class Program // 构建容器 Container = builder.Build(); AppInfo.Container = Container.BeginLifetimeScope("root"); + EquipmentInit equipmentInit = AppInfo.Container.Resolve(); + equipmentInit.Connect(); Application.Run(AppInfo.Container.ResolveNamed
("Form2")); + } private static void Application_ThreadException(object sender, ThreadExceptionEventArgs ex) diff --git a/WinFormStarter/WinFormStarter.csproj b/WinFormStarter/WinFormStarter.csproj index f234456..c76a7b8 100644 --- a/WinFormStarter/WinFormStarter.csproj +++ b/WinFormStarter/WinFormStarter.csproj @@ -6,6 +6,7 @@ enable true enable + true diff --git a/WinFormStarter/txt.txt b/WinFormStarter/txt.txt new file mode 100644 index 0000000..a48a1d6 --- /dev/null +++ b/WinFormStarter/txt.txt @@ -0,0 +1,21 @@ + +保持型x=4:30000 +输入型x=3:40000 + + +线圈: + 线圈寄存器: + 离散输入寄存器: +寄存器: + 输入寄存器 + 保持寄存器: + +功能码 描述 说明 MOUBUS地址 异常功能码(+ 0×80) +1 读取输出线圈 位操作 00001 ~ 09999 0×81 +2 读取输入线圈 位操作 10001 ~ 19999 0×82 +3 读取输出寄存器 字操作 40001 ~ 49999 0×83 +4 读取输入寄存器 字操作 30001 ~ 39999 0×84 +5 写入单个输出线圈 位操作 00001 ~ 09999 0×85 +6 写入单个输出寄存器 字操作 40001 ~ 49999 0×86 +OF 写入多个输出线圈 位搡作 00001 ~ 09999 Ox8F +10 写入多个输出寄存器 字操作 40001 ~ 49999 0×90