设置PLC时效性和写PLC数据方法

master
CZ 6 months ago
parent 416b1b8473
commit 27456ce459

@ -2,6 +2,7 @@
using HybirdFrameworkDriver.ModbusTcpMaster;
using HybirdFrameworkDriver.Session;
using HybirdFrameworkServices.Plc;
using Newtonsoft.Json.Linq;
using Service.Init.Entity;
namespace Service
@ -53,6 +54,8 @@ namespace Service
if (connected)
{
PlcStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo);
plcInfo.Connected = true;
break;
}
@ -64,7 +67,7 @@ namespace Service
SessionMgr.RegisterModbusSession(master.connectId, modbusSession);
SessionMgr.SetAttrModbus(modbusSession, "eqm_sn", 1);
PlcInfo waterColdInfo = new PlcInfo(master.connectId, 1);
ChargerStaticInfo.PlcInfos.TryAdd(1, waterColdInfo);
PlcStaticInfo.PlcInfos.TryAdd(1, waterColdInfo);
}
/**
@ -72,69 +75,43 @@ namespace Service
*/
private static void BatchReadPlc(ModbusTcpMaster master)
{
while (true)
{
int sn = 3; //(int)SessionMgr.GetAttrModbus(master.connectId, "eqm_sn");
//这里不设置while。
int sn = 3; //(int)SessionMgr.GetAttrModbus(master.connectId, "eqm_sn");
ChargerStaticInfo.PlcInfos.TryGetValue(sn, out PlcInfo plcInfo);
if (plcInfo != null)
PlcStaticInfo.PlcInfos.TryGetValue(sn, out PlcInfo plcInfo);
if (plcInfo != null)
{
var bytes01 = master.BatchRead(1, 115);
if (bytes01 != null)
{
var bytes01 = master.BatchRead(1, 115);
if (bytes01 != null)
{
ModbusDecoder.Decode<HostToPlc>(bytes01, plcInfo.hostToPlc);
}
var bytes02 = master.BatchRead(201, 222);
if (bytes02 != null)
{
ModbusDecoder.Decode<PlcToHost>(bytes02, plcInfo.plcToHost);
}
var bytes03 = master.BatchRead(701, 10);
if (bytes03 != null)
{
ModbusDecoder.Decode<PlcFault>(bytes03, plcInfo.plcFault);
}
//OperateResult<byte[]> result2 = ModbusTcpNet.Read("x=3;201", 222);
ModbusDecoder.Decode<HostToPlc>(bytes01, plcInfo.hostToPlc);
}
/*
if (plcInfo != null)
{
byte[]? bytes01 = master.BatchRead(0, 22);
if (bytes01 != null)
{
ModbusDecoder.DecodeByT<PlcReadAndWrite2>(bytes01, plcInfo.PlcReadAndWritten2);
}
byte[]? bytes02 = master.BatchRead(256, 170);
if (bytes02 != null)
{
ModbusDecoder.DecodeByT<PlcReadonly>(bytes02, plcInfo.PlcReadonly);
}
byte[]? bytes03 = master.BatchRead(39424, 108);
if (bytes03 != null)
{
ModbusDecoder.DecodeByT<PlcTurnsRatio>(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);//电表清零
var bytes02 = master.BatchRead(201, 222);
if (bytes02 != null)
{
ModbusDecoder.Decode<PlcToHost>(bytes02, plcInfo.plcToHost);
plcInfo.RemoteNot = plcInfo.plcToHost.RemoteLocalControlState.Value == 1010 ? true : false;
plcInfo.EntranceRadar = plcInfo.plcToHost.RadarStatesOut.Value == 1000 ? true : false;
plcInfo.ChannelLocationState = plcInfo.plcToHost.ChannelLocationState.Value == 1000 ? true : false;
if (bytes04 != null)
{
ModbusDecoder.DecodeByT<PlcReadAndWrite1>(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);
plcInfo.BatteryDisassembly = plcInfo.plcToHost.TaskStates.Value == 1002 ? true : false;
plcInfo.StorageBatteries = plcInfo.plcToHost.TaskStates.Value == 1003 ? true : false;
plcInfo.BatteryDelivery = plcInfo.plcToHost.TaskStates.Value == 1004 ? true : false;
plcInfo.BatteryInstallation = plcInfo.plcToHost.TaskStates.Value == 1005 ? true : false;
plcInfo.BatteryInstallationComplete = plcInfo.plcToHost.TaskStates.Value == 1006 ? true : false;
plcInfo.SetExitLightGreen = (plcInfo.plcToHost.LightOut.Value == 1000 || plcInfo.plcToHost.LightOut.Value == 1010) ? true : false;
plcInfo.ExitRadarSensingTrigger = plcInfo.plcToHost.RadarStatesOut.Value == 1000 ? true : false;
}
}
*/
var bytes03 = master.BatchRead(701, 10);
if (bytes03 != null)
{
ModbusDecoder.Decode<PlcFault>(bytes03, plcInfo.plcFault);
}
//OperateResult<byte[]> result2 = ModbusTcpNet.Read("x=3;201", 222);
}
}
}
}

@ -1,6 +1,9 @@
using HybirdFrameworkDriver.ModbusTcpMaster;
using DotNetty.Codecs.Mqtt.Packets;
using HybirdFrameworkDriver.ModbusTcpMaster;
using HybirdFrameworkDriver.Session;
using HybirdFrameworkServices.Plc;
using Newtonsoft.Json.Linq;
using System.Net.NetworkInformation;
namespace Service.Init.Entity
{
@ -58,6 +61,338 @@ namespace Service.Init.Entity
public PlcToHost plcToHost = new PlcToHost();
public PlcFault plcFault = new PlcFault();
#region
int DataTimeSeconds = 2;
DateTime DataValidityTime = DateTime.Now;
/// <summary>
/// plc是否连接
/// </summary>
public bool Connected { get; set; }
/// <summary>
/// plc是否处于远程模式
/// </summary>
public bool RemoteNot
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= DataTimeSeconds)
{
return RemoteNot;
}
else
{
return false;
}
}
set
{
RemoteNot = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读入口雷达是否感应触发
/// </summary>
public bool EntranceRadar
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return EntranceRadar;
}
else
{
return false;
}
}
set
{
EntranceRadar = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取通道定位状态(拍照是否OK)
/// </summary>
public bool ChannelLocationState
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return ChannelLocationState;
}
else
{
return false;
}
}
set
{
ChannelLocationState = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取plc任务状态电池拆卸中
/// </summary>
public bool BatteryDisassembly
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return BatteryDisassembly;
}
else
{
return false;
}
}
set
{
BatteryDisassembly = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取plc任务状态电池入库搬运中
/// </summary>
public bool StorageBatteries
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return StorageBatteries;
}
else
{
return false;
}
}
set
{
StorageBatteries = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取plc任务状态电池出库搬运中
/// </summary>
public bool BatteryDelivery
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return BatteryDelivery;
}
else
{
return false;
}
}
set
{
BatteryDelivery = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取plc任务状态电池安装中
/// </summary>
public bool BatteryInstallation
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return BatteryInstallation;
}
else
{
return false;
}
}
set
{
BatteryInstallation = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读取plc任务状态电池安装完成
/// </summary>
public bool BatteryInstallationComplete
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return BatteryInstallationComplete;
}
else
{
return false;
}
}
set
{
BatteryInstallationComplete = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 设置出口灯:绿灯(通知车辆可以驶离)
/// </summary>
public bool SetExitLightGreen
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return SetExitLightGreen;
}
else
{
return false;
}
}
set
{
SetExitLightGreen = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 读出口雷达是否感应触发
/// </summary>
public bool ExitRadarSensingTrigger
{
get
{
if ((DateTime.Now - DataValidityTime).Seconds <= 2)
{
return ExitRadarSensingTrigger;
}
else
{
return false;
}
}
set
{
ExitRadarSensingTrigger = value;
DataValidityTime = DateTime.Now;
}
}
/// <summary>
/// 写入口灯绿
/// </summary>
/// <returns></returns>
public bool SendLightGreen()
{
bool bResult = false;
if (Connected)
{
hostToPlc.LightIn.Value = 1000;
bResult = WriteUint16(hostToPlc.LightIn);
}
return bResult;
}
/// <summary>
/// 下发选包数据给plc(入仓位
/// </summary>
/// <param name="loc">1:缓存位舱位号 2-20 电池存储舱位</param>
/// <returns></returns>
public bool SendSelectRuleIn(ushort loc)
{
bool bResult = false;
if (Connected)
{
hostToPlc.EntrySelection.Value = loc;
bResult = WriteUint16(hostToPlc.EntrySelection);
}
return bResult;
}
/// <summary>
/// 下发选包数据给plc(出仓位
/// </summary>
/// <param name="loc">1:缓存位舱位号 2-20 电池存储舱位</param>
/// <returns></returns>
public bool SendSelectRuleOut(ushort loc)
{
bool bResult = false;
if (Connected)
{
hostToPlc.ExitSelection.Value = loc;
bResult = WriteUint16(hostToPlc.ExitSelection);
}
return bResult;
}
/// <summary>
/// 写入口灯:红灯
/// </summary>
/// <returns></returns>
public bool SendLightRed()
{
bool bResult = false;
if (Connected)
{
hostToPlc.LightIn.Value = 1020;
bResult = WriteUint16(hostToPlc.LightIn);
}
return bResult;
}
/// <summary>
/// 下发plc开启换电任务
/// </summary>
/// <returns></returns>
public bool SendTaskType()
{
bool bResult = false;
if (Connected)
{
hostToPlc.TaskType.Value = 1;
bResult = WriteUint16(hostToPlc.TaskType);
}
return bResult;
}
/// <summary>
/// 设置出口灯:绿灯
/// </summary>
/// <returns></returns>
public bool SendLightOutGreen()
{
bool bResult = false;
if (Connected)
{
hostToPlc.LightOut.Value = 1000;
bResult = WriteUint16(hostToPlc.LightOut);
}
return bResult;
}
/// <summary>
/// 设置出口灯:红灯
/// </summary>
/// <returns></returns>
public bool SendLightOutRed()
{
bool bResult = false;
if (Connected)
{
hostToPlc.LightOut.Value = 1020;
bResult = WriteUint16(hostToPlc.LightOut);
}
return bResult;
}
#endregion
public PlcInfo(string channelId, int eqmSn)
{

@ -2,7 +2,7 @@
namespace Service.Init.Entity
{
public class ChargerStaticInfo
public class PlcStaticInfo
{
/// <summary>
/// PLC管理

@ -13,75 +13,375 @@ namespace HybirdFrameworkServices.Plc
public ModbusProperty<short> ProtocolVersion1 { get; set; } = new(40001); // 协议版本
public ModbusProperty<short> ProtocolVersion2 { get; set; } = new(40002); // 协议版本
public ModbusProperty<short> ProtocolVersion3 { get; set; } = new(40003); // 协议版本
public ModbusProperty<ushort> CommunicationDiagnosis { get; set; } = new(40004); // 通讯诊断
public ModbusProperty<ushort> ModeControl { get; set; } = new(40005); // 模式控制
public ModbusProperty<ushort> EquipmentControl { get; set; } = new(40006); // 设备控制
public ModbusProperty<ushort> ExhaustFanControl { get; set; } = new(40007); // 排风扇控制
public ModbusProperty<ushort> LightingControl { get; set; } = new(40008); // 灯光控制
/// <summary>
/// 通讯诊断
/// 站控PC心跳0、1 跳变)
/// </summary>
public ModbusProperty<ushort> CommunicationDiagnosis { get; set; } = new(40004); //
/// <summary>
/// 模式控制
/// <para>0无操作</para>
/// <para>1000自动</para>
/// <para>1010手动</para>
/// </summary>
public ModbusProperty<ushort> ModeControl { get; set; } = new(40005); //
/// <summary>
/// 设备控制
/// <para>0:无操作</para>
/// <para>1000:复位</para>
/// <para>1010:启动</para>
/// <para>1020:暂停</para>
/// <para>1030:急停</para>
/// <para>1050:整站断电</para>
/// </summary>
public ModbusProperty<ushort> EquipmentControl { get; set; } = new(40006); //
/// <summary>
/// 排风扇控制
/// <para>0无操作</para>
/// <para>1000全部打开</para>
/// <para>1010全部关闭</para>
/// <para>1020预留</para>
/// </summary>
public ModbusProperty<ushort> ExhaustFanControl { get; set; } = new(40007); //
/// <summary>
/// 灯光控制
/// <para>0无操作</para>
/// <para>1000全部打开</para>
/// <para>1010全部关闭</para>
/// </summary>
public ModbusProperty<ushort> LightingControl { get; set; } = new(40008); //
public ModbusProperty<ushort> Standby1 { get; set; } = new(40009); // 备用
public ModbusProperty<ushort> Standby2 { get; set; } = new(40010); // 备用
public ModbusProperty<ushort> Seconds { get; set; } = new(40011); // 对时时钟:秒
public ModbusProperty<ushort> Points { get; set; } = new(40012); // 对时时钟:分
public ModbusProperty<ushort> Hour { get; set; } = new(40013); // 对时时钟:时
public ModbusProperty<ushort> Day { get; set; } = new(40014); // 对时时钟:天
public ModbusProperty<ushort> Month { get; set; } = new(40015); // 对时时钟:月
public ModbusProperty<ushort> Years { get; set; } = new(40016); // 对时时钟:年
/// <summary>
/// 对时时钟:秒
/// </summary>
public ModbusProperty<ushort> Seconds { get; set; } = new(40011);
/// <summary>
/// 对时时钟:分
/// </summary>
public ModbusProperty<ushort> Points { get; set; } = new(40012);
/// <summary>
/// 对时时钟:时
/// </summary>
public ModbusProperty<ushort> Hour { get; set; } = new(40013);
/// <summary>
/// 对时时钟:天
/// </summary>
public ModbusProperty<ushort> Day { get; set; } = new(40014);
/// <summary>
/// 对时时钟:月
/// </summary>
public ModbusProperty<ushort> Month { get; set; } = new(40015);
/// <summary>
/// 对时时钟:年
/// </summary>
public ModbusProperty<ushort> Years { get; set; } = new(40016);
public ModbusProperty<string> Standby3 { get; set; } = new(40017, length: 4); // 备用3
public ModbusProperty<string> ChargingStatus { get; set; } = new(40021, length: 40); // 仓位充电状态
public ModbusProperty<short> ChargingStatus01 { get; set; } = new(40021); // 仓位充电状态
public ModbusProperty<short> ChargingStatus02 { get; set; } = new(40022); // 仓位充电状态
public ModbusProperty<short> ChargingStatus03 { get; set; } = new(40023); // 仓位充电状态
public ModbusProperty<short> ChargingStatus04 { get; set; } = new(40024); // 仓位充电状态
public ModbusProperty<short> ChargingStatus05 { get; set; } = new(40025); // 仓位充电状态
public ModbusProperty<short> ChargingStatus06 { get; set; } = new(40026); // 仓位充电状态
public ModbusProperty<short> ChargingStatus07 { get; set; } = new(40027); // 仓位充电状态
public ModbusProperty<short> ChargingStatus08 { get; set; } = new(40028); // 仓位充电状态
public ModbusProperty<short> ChargingStatus09 { get; set; } = new(40029); // 仓位充电状态
public ModbusProperty<short> ChargingStatus10 { get; set; } = new(40030); // 仓位充电状态
public ModbusProperty<short> ChargingStatus11 { get; set; } = new(40031); // 仓位充电状态
public ModbusProperty<short> ChargingStatus12 { get; set; } = new(40032); // 仓位充电状态
public ModbusProperty<short> ChargingStatus13 { get; set; } = new(40033); // 仓位充电状态
public ModbusProperty<short> ChargingStatus14 { get; set; } = new(40034); // 仓位充电状态
public ModbusProperty<short> ChargingStatus15 { get; set; } = new(40035); // 仓位充电状态
public ModbusProperty<short> ChargingStatus16 { get; set; } = new(40036); // 仓位充电状态
public ModbusProperty<short> ChargingStatus17 { get; set; } = new(40037); // 仓位充电状态
public ModbusProperty<short> ChargingStatus18 { get; set; } = new(40038); // 仓位充电状态
public ModbusProperty<short> ChargingStatus19 { get; set; } = new(40039); // 仓位充电状态
public ModbusProperty<short> ChargingStatus20 { get; set; } = new(40040); // 仓位充电状态
public ModbusProperty<string> BatteryType { get; set; } = new(40061, length: 40); // 仓位所在电池型号
public ModbusProperty<short> BatteryType01 { get; set; } = new(40061); // 仓位所在电池型号
public ModbusProperty<short> BatteryType02 { get; set; } = new(40062); // 仓位所在电池型号
public ModbusProperty<short> BatteryType03 { get; set; } = new(40063); // 仓位所在电池型号
public ModbusProperty<short> BatteryType04 { get; set; } = new(40064); // 仓位所在电池型号
public ModbusProperty<short> BatteryType05 { get; set; } = new(40065); // 仓位所在电池型号
public ModbusProperty<short> BatteryType06 { get; set; } = new(40066); // 仓位所在电池型号
public ModbusProperty<short> BatteryType07 { get; set; } = new(40067); // 仓位所在电池型号
public ModbusProperty<short> BatteryType08 { get; set; } = new(40068); // 仓位所在电池型号
public ModbusProperty<short> BatteryType09 { get; set; } = new(40069); // 仓位所在电池型号
public ModbusProperty<short> BatteryType10 { get; set; } = new(40070); // 仓位所在电池型号
public ModbusProperty<short> BatteryType11 { get; set; } = new(40071); // 仓位所在电池型号
public ModbusProperty<short> BatteryType12 { get; set; } = new(40072); // 仓位所在电池型号
public ModbusProperty<short> BatteryType13 { get; set; } = new(40073); // 仓位所在电池型号
public ModbusProperty<short> BatteryType14 { get; set; } = new(40074); // 仓位所在电池型号
public ModbusProperty<short> BatteryType15 { get; set; } = new(40075); // 仓位所在电池型号
public ModbusProperty<short> BatteryType16 { get; set; } = new(40076); // 仓位所在电池型号
public ModbusProperty<short> BatteryType17 { get; set; } = new(40077); // 仓位所在电池型号
public ModbusProperty<short> BatteryType18 { get; set; } = new(40078); // 仓位所在电池型号
public ModbusProperty<short> BatteryType19 { get; set; } = new(40079); // 仓位所在电池型号
public ModbusProperty<short> BatteryType20 { get; set; } = new(40080); // 仓位所在电池型号
//public ModbusProperty<string> ChargingStatus { get; set; } = new(40021, length: 40); // 仓位充电状态
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus01 { get; set; } = new(40021);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus02 { get; set; } = new(40022);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus03 { get; set; } = new(40023);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus04 { get; set; } = new(40024);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus05 { get; set; } = new(40025);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus06 { get; set; } = new(40026);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus07 { get; set; } = new(40027);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus08 { get; set; } = new(40028);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus09 { get; set; } = new(40029);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus10 { get; set; } = new(40030);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus11 { get; set; } = new(40031);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus12 { get; set; } = new(40032);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus13 { get; set; } = new(40033);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus14 { get; set; } = new(40034);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus15 { get; set; } = new(40035);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus16 { get; set; } = new(40036);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus17 { get; set; } = new(40037);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus18 { get; set; } = new(40038);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus19 { get; set; } = new(40039);
/// <summary>
/// 仓位充电状态
/// <para>0未知</para>
/// <para>1000空闲</para>
/// <para>1010充电</para>
/// </summary>
public ModbusProperty<short> ChargingStatus20 { get; set; } = new(40040);
//public ModbusProperty<string> BatteryType { get; set; } = new(40061, length: 40); // 仓位所在电池型号
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType01 { get; set; } = new(40061);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType02 { get; set; } = new(40062);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType03 { get; set; } = new(40063);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType04 { get; set; } = new(40064);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType05 { get; set; } = new(40065);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType06 { get; set; } = new(40066);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType07 { get; set; } = new(40067);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType08 { get; set; } = new(40068);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType09 { get; set; } = new(40069);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType10 { get; set; } = new(40070);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType11 { get; set; } = new(40071);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType12 { get; set; } = new(40072);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType13 { get; set; } = new(40073);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType14 { get; set; } = new(40074);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType15 { get; set; } = new(40075);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType16 { get; set; } = new(40076);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType17 { get; set; } = new(40077);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType18 { get; set; } = new(40078);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType19 { get; set; } = new(40079);
/// <summary>
/// 仓位所在电池型号
/// </summary>
public ModbusProperty<short> BatteryType20 { get; set; } = new(40080);
public ModbusProperty<ushort> VehicleParkingLocation { get; set; } = new(40101); // 车辆驻车位置
public ModbusProperty<ushort> VehicleParkingStatus { get; set; } = new(40102); // 车辆驻车状态
public ModbusProperty<ushort> LightIn { get; set; } = new(40103); // "三色灯控制整站状态(入口)"
public ModbusProperty<ushort> LightOut { get; set; } = new(40104); // "三色灯控制整站状态(出口)"
public ModbusProperty<ushort> StopCommand { get; set; } = new(40105); // 电池包锁止异常,暂停命令
/// <summary>
/// 车辆驻车位置
/// <para>0 无效</para>
/// <para>2=2#换电位</para>
/// <para>3=3#换电位</para>
/// <para>4=4#换电位</para>
/// <para>5=5#换电位</para>
/// <para>6=6#换电位</para>
/// </summary>
public ModbusProperty<ushort> VehicleParkingLocation { get; set; } = new(40101);
/// <summary>
/// 车辆驻车状态
/// <para>0=车辆状态未知</para>
/// <para>1=车辆运动中</para>
/// <para>2=车辆停止、驻停</para>
/// </summary>
public ModbusProperty<ushort> VehicleParkingStatus { get; set; } = new(40102);
/// <summary>
/// 三色灯控制整站状态(入口)
/// <para>0无效值</para>
/// <para>1000绿灯</para>
/// <para>1010绿灯闪烁</para>
/// <para>1020红灯</para>
/// <para>1030红灯闪烁</para>
/// <para>1040黄灯</para>
/// <para>1050黄灯闪烁</para>
/// <para>1100所有灯亮</para>
/// </summary>
public ModbusProperty<ushort> LightIn { get; set; } = new(40103);
/// <summary>
/// 三色灯控制整站状态(出口)
/// <para>0无效值</para>
/// <para>1000绿灯</para>
/// <para>1010绿灯闪烁</para>
/// <para>1020红灯</para>
/// <para>1030红灯闪烁</para>
/// <para>1040黄灯</para>
/// <para>1050黄灯闪烁</para>
/// <para>1100所有灯亮</para>
/// </summary>
public ModbusProperty<ushort> LightOut { get; set; } = new(40104);
/// <summary>
/// 电池包锁止异常,暂停命令 0无命令1000暂停使能
/// </summary>
public ModbusProperty<ushort> StopCommand { get; set; } = new(40105);
public ModbusProperty<string> Standby4 { get; set; } = new(40106, length: 5); // 备用4
public ModbusProperty<ushort> TaskType { get; set; } = new(40111); // 任务类型
public ModbusProperty<ushort> EntrySelection { get; set; } = new(40112); // 入仓位选择
public ModbusProperty<ushort> ExitSelection { get; set; } = new(40113); // 出仓仓位选择
public ModbusProperty<ushort> BatteryPackType { get; set; } = new(40114); // 电池包类型
public ModbusProperty<ushort> TaskEnablement { get; set; } = new(40115); // 任务使能
/// <summary>
/// 任务类型
/// <para>0.无任务</para>
/// <para>1.换电任务</para>
/// <para>2.移舱任务</para>
/// <para>3.移出任务</para>
/// <para>4.移入任务</para>
/// <para>5.消防任务</para>
/// </summary>
public ModbusProperty<ushort> TaskType { get; set; } = new(40111);
/// <summary>
/// 入仓位选择
/// 0无操作
/// 范围1-20
/// 1:缓存位舱位号
/// 2-20 电池存储舱位
/// </summary>
public ModbusProperty<ushort> EntrySelection { get; set; } = new(40112);
/// <summary>
/// 出仓仓位选择
/// 0无操作
/// 范围1-20
/// 1:缓存位舱位号
/// 2-20 电池存储舱位
/// </summary>
public ModbusProperty<ushort> ExitSelection { get; set; } = new(40113);
/// <summary>
/// 电池包类型
/// </summary>
public ModbusProperty<ushort> BatteryPackType { get; set; } = new(40114);
/// <summary>
/// 0:无操作
/// 1000任务使能
/// </summary>
public ModbusProperty<ushort> TaskEnablement { get; set; } = new(40115);
}
}

@ -17,9 +17,21 @@ namespace HybirdFrameworkServices.Plc
public ModbusProperty<ushort> ProtocolVersion1 { get; set; } = new(40201); // 协议版本
public ModbusProperty<ushort> ProtocolVersion2 { get; set; } = new(40202); // 协议版本
public ModbusProperty<ushort> ProtocolVersion3 { get; set; } = new(40203); // 协议版本
public ModbusProperty<ushort> CommunicationDiagnosis { get; set; } = new(40204); // 通讯诊断
public ModbusProperty<ushort> ModeControl { get; set; } = new(40205); // 模式状态
public ModbusProperty<ushort> DeviceSystemStatus { get; set; } = new(40206); // 设备系统状态
/// <summary>
/// 通讯诊断 站控PC心跳0、1 跳变)
/// </summary>
public ModbusProperty<ushort> CommunicationDiagnosis { get; set; } = new(40204);
/// <summary>
/// 模式状态
/// <para>0无效值</para>
/// <para>1000手动模式</para>
/// <para>1010自动模式</para>
/// </summary>
public ModbusProperty<ushort> ModeControl { get; set; } = new(40205);
/// <summary>
/// 设备系统状态
/// </summary>
public ModbusProperty<ushort> DeviceSystemStatus { get; set; } = new(40206);
//public ModbusProperty<bool> type00 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT0:复位
//public ModbusProperty<bool> type01 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT1:启动
@ -30,37 +42,297 @@ namespace HybirdFrameworkServices.Plc
//public ModbusProperty<bool> type06 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT6:自动运行中
//public ModbusProperty<bool> type07 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT7:PLC停机报警
//public ModbusProperty<bool> type08 { get; set; } = new(400206,length:1, type: ModbusDataType.Bit); //BIT8:PLC提示预警
public ModbusProperty<ushort> RemoteLocalControlState { get; set; } = new(40207); // 遥本控状态
public ModbusProperty<ushort> LightStatus { get; set; } = new(40208); // 灯光状态
public ModbusProperty<ushort> ExhaustFanStatus { get; set; } = new(40209); // 排风扇状态
public ModbusProperty<ushort> WaterStatusStation { get; set; } = new(40210); // 站内积水状态
public ModbusProperty<string> value09 { get; set; } = new(40211, length: 30); // 备用
public ModbusProperty<string> InPosition { get; set; } = new(40241, length: 40); // 在位状态
public ModbusProperty<string> value11 { get; set; } = new(40281, length: 20); // 备用
public ModbusProperty<ushort> CarStatus { get; set; } = new(40301); // 载行车设备状态
/// <summary>
/// 遥本控状态
/// <para>0无效值</para>
/// <para>1000本地控制</para>
/// <para>1010远程控制</para>
/// </summary>
public ModbusProperty<ushort> RemoteLocalControlState { get; set; } = new(40207);
/// <summary>
/// 灯光状态
/// <para>0无状态</para>
/// <para>1000已全部打开</para>
/// <para>1010已全部关闭</para>
/// </summary>
public ModbusProperty<ushort> LightStatus { get; set; } = new(40208);
/// <summary>
/// 排风扇状态
/// <para>0无状态</para>
/// <para>1000已全部打开</para>
/// <para>1010已全部关闭</para>
/// </summary>
public ModbusProperty<ushort> ExhaustFanStatus { get; set; } = new(40209);
/// <summary>
/// 站内积水状态
/// BIT0积水预警
/// BIT1积水报警
/// </summary>
public ModbusProperty<ushort> WaterStatusStation { get; set; } = new(40210);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<string> value09 { get; set; } = new(40211, length: 30);
/// <summary>
/// 在位状态
/// </summary>
public ModbusProperty<string> InPosition { get; set; } = new(40241, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition01 { get; set; } = new(40241, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition02 { get; set; } = new(40242, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition03 { get; set; } = new(40243, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition04 { get; set; } = new(40244, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition05 { get; set; } = new(40245, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition06 { get; set; } = new(40246, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition07 { get; set; } = new(40247, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition08 { get; set; } = new(40248, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition09 { get; set; } = new(40249, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition10 { get; set; } = new(40250, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition11 { get; set; } = new(40251, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition12 { get; set; } = new(40252, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition13 { get; set; } = new(40253, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition14 { get; set; } = new(40254, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition15 { get; set; } = new(40255, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition16 { get; set; } = new(40256, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition17 { get; set; } = new(40257, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition18 { get; set; } = new(40258, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition19 { get; set; } = new(40259, length: 40);
/// <summary>
/// 在位状态
/// Bit0:有料检测
/// Bit1:有料检测开关故障"
/// </summary>
public ModbusProperty<ushort> InPosition20 { get; set; } = new(40260, length: 40);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<string> value11 { get; set; } = new(40281, length: 20);
/// <summary>
/// 载行车设备状态
/// <para>0无效值</para>
/// <para>1000:待机中</para>
/// <para>1001:定位识别中</para>
/// <para>1100:取电池中</para>
/// <para>1101:取电池完成</para>
/// <para>1102:取电池动作故障</para>
/// <para>1200:放电池中</para>
/// <para>1201:放电池完成</para>
/// <para>1202:放电池动作故障</para>
/// </summary>
public ModbusProperty<ushort> CarStatus { get; set; } = new(40301);
public ModbusProperty<ushort> value13 { get; set; } = new(40302); // 备用
public ModbusProperty<ushort> value14 { get; set; } = new(40303); // 备用
public ModbusProperty<ushort> value15 { get; set; } = new(40304); // 备用
public ModbusProperty<ushort> value16 { get; set; } = new(40305); // 备用
public ModbusProperty<short> PercentageTorqueX { get; set; } = new(40306); // x轴扭矩百分比
public ModbusProperty<short> PercentageTorqueY { get; set; } = new(40307); // y轴扭矩百分比
public ModbusProperty<short> PercentageTorqueZ { get; set; } = new(40308); // z轴扭矩百分比
/// <summary>
/// x轴扭矩百分比
/// </summary>
public ModbusProperty<short> PercentageTorqueX { get; set; } = new(40306);
/// <summary>
/// y轴扭矩百分比
/// </summary>
public ModbusProperty<short> PercentageTorqueY { get; set; } = new(40307);
/// <summary>
/// z轴扭矩百分比
/// </summary>
public ModbusProperty<short> PercentageTorqueZ { get; set; } = new(40308);
public ModbusProperty<string> value20 { get; set; } = new(40309, length: 92); // 备用
public ModbusProperty<ushort> RadarStatesIn{ get; set; } = new(40401); // " 入口雷达状态"
public ModbusProperty<ushort> RadarStatesOut { get; set; } = new(40402); // " 出口雷达状态"
public ModbusProperty<ushort> SpotPhotoelectricSignal { get; set; } = new(40403); // 到位光电信号
public ModbusProperty<ushort> PhysicalButtonState { get; set; } = new(40404); // 实体按钮状态
public ModbusProperty<ushort> LightIn { get; set; } = new(40405); // "三色灯控制通道状态(入口)"
public ModbusProperty<ushort> LightOut { get; set; } = new(40406); // "三色灯控制通道状态(出口)"
public ModbusProperty<ushort> TaskType { get; set; } = new(40407); // "任务类型状态(是否允许允许执行任务)"
public ModbusProperty<ushort> TaskStates { get; set; } = new(40408); // 任务状态
public ModbusProperty<ushort> OperationalTrainNumber { get; set; } = new(40409); // 执行任务行车号
public ModbusProperty<ushort> ChannelLocationState { get; set; } = new(40410); // 通道定位状态
public ModbusProperty<short> DeviationX { get; set; } = new(40411); // x偏差
public ModbusProperty<short> DeviationY { get; set; } = new(40412); // y偏差
public ModbusProperty<short> DeviationZ { get; set; } = new(40413); // z偏差
/// <summary>
/// 入口雷达状态
/// 0未触发
/// 1000感应触发
/// </summary>
public ModbusProperty<ushort> RadarStatesIn { get; set; } = new(40401);
/// <summary>
/// 出口雷达状态
/// 0未触发
/// 1000感应触发
/// </summary>
public ModbusProperty<ushort> RadarStatesOut { get; set; } = new(40402);
/// <summary>
/// 到位光电信号
/// 1000到位
/// 其它值:未到位
/// </summary>
public ModbusProperty<ushort> SpotPhotoelectricSignal { get; set; } = new(40403);
/// <summary>
/// 实体按钮状态
/// 0:无状态
/// 1000:已拍按钮
/// </summary>
public ModbusProperty<ushort> PhysicalButtonState { get; set; } = new(40404);
/// <summary>
/// 三色灯控制通道状态(入口)
/// <para>0无颜色</para>
/// <para>1000绿灯</para>
/// <para>1010绿灯闪烁</para>
/// <para>1020红灯</para>
/// <para>1030红灯闪烁</para>
/// <para>1040黄灯</para>
/// <para>1050黄灯闪烁</para>
/// <para>1100所有灯亮</para>
/// </summary>
public ModbusProperty<ushort> LightIn { get; set; } = new(40405);
/// <summary>
/// 三色灯控制通道状态(出口)
/// <para>0无颜色</para>
/// <para>1000绿灯</para>
/// <para>1010绿灯闪烁</para>
/// <para>1020红灯</para>
/// <para>1030红灯闪烁</para>
/// <para>1040黄灯</para>
/// <para>1050黄灯闪烁</para>
/// <para>1100所有灯亮</para>
/// </summary>
public ModbusProperty<ushort> LightOut { get; set; } = new(40406);
/// <summary>
/// 任务类型状态(是否允许允许执行任务)
/// <para>0.无任务 (不允许换电)</para>
/// <para>1.换电任务</para>
/// <para>2.移舱任务</para>
/// <para>3.移出任务</para>
/// <para>4.移入任务</para>
/// <para>5.消防任务</para>
/// </summary>
public ModbusProperty<ushort> TaskType { get; set; } = new(40407);
/// <summary>
/// 任务状态
/// <para>0无效值</para>
/// <para>1000准备中Not Ready</para>
/// <para>1001待机中Ready</para>
/// <para>1002电池拆卸中</para>
/// <para>1003电池入库搬运中</para>
/// <para>1004电池出库搬运中</para>
/// <para>1005电池安装中</para>
/// <para>1006电池安装完成</para>
/// <para>1007航车回归至安全位置</para>
/// <para>1008: 缓存-放仓位, 移仓状态</para>
/// <para>1100消防任务 执行中</para>
/// <para>1101消防任务 出现异常</para>
/// <para>1200移仓任务 执行中</para>
/// <para>1201移仓任务 出现异常</para>
/// <para>9000任务完成</para>
/// </summary>
public ModbusProperty<ushort> TaskStates { get; set; } = new(40408);
/// <summary>
/// 执行任务行车号
/// </summary>
public ModbusProperty<ushort> OperationalTrainNumber { get; set; } = new(40409);
/// <summary>
/// 通道定位状态
/// <para>0无效值</para>
/// <para>1000;拍照OK</para>
/// <para>1010;拍照NG</para>
/// <para>1020;拍照超限,请移车</para>
/// </summary>
public ModbusProperty<ushort> ChannelLocationState { get; set; } = new(40410);
/// <summary>
/// x偏差
/// </summary>
public ModbusProperty<short> DeviationX { get; set; } = new(40411);
/// <summary>
/// y偏差
/// </summary>
public ModbusProperty<short> DeviationY { get; set; } = new(40412);
/// <summary>
/// z偏差
/// </summary>
public ModbusProperty<short> DeviationZ { get; set; } = new(40413);
public ModbusProperty<string> value44 { get; set; } = new(40414, length: 7); // 备用

@ -36,7 +36,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -54,7 +54,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -72,7 +72,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -90,7 +90,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -108,7 +108,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -126,7 +126,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -144,7 +144,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -162,7 +162,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -180,7 +180,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -198,7 +198,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -216,7 +216,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -239,7 +239,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -257,7 +257,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -280,7 +280,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -298,7 +298,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -320,7 +320,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -338,7 +338,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -360,7 +360,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -378,7 +378,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -396,7 +396,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -414,7 +414,7 @@ namespace WinFormStarter
MessageBox.Show("请输入有效值");
return;
}
ChargerStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(1, out PlcInfo plcInfo);
if (plcInfo == null)
{
MessageBox.Show("PLC未连接");
@ -430,7 +430,7 @@ namespace WinFormStarter
bool bConvert2 = short.TryParse(this.txtValue02.Text, out short iValue2);
bool bConvert3 = short.TryParse(this.txtValue03.Text, out short iValue3);
ChargerStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo);
if (plcInfo != null)
{
HostToPlc hostToPlc = new HostToPlc();
@ -450,7 +450,7 @@ namespace WinFormStarter
/// <param name="e"></param>
private void BtnCollectionAssignment_Click(object sender, EventArgs e)
{
ChargerStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo);
PlcStaticInfo.PlcInfos.TryGetValue(3, out PlcInfo plcInfo);
if (plcInfo != null)
{
lblValue01.Text = plcInfo.plcToHost.ProtocolVersion1.Value + "." +

@ -9,6 +9,10 @@
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "6.0.0"
}
]
}

@ -29,6 +29,17 @@
}
}
},
"AutoMapper/12.0.1": {
"dependencies": {
"Microsoft.CSharp": "4.7.0"
},
"runtime": {
"lib/netstandard2.1/AutoMapper.dll": {
"assemblyVersion": "12.0.0.0",
"fileVersion": "12.0.1.0"
}
}
},
"DotNetty.Buffers/0.7.5": {
"dependencies": {
"DotNetty.Common": "0.7.5",
@ -130,7 +141,7 @@
}
}
},
"Microsoft.CSharp/4.5.0": {},
"Microsoft.CSharp/4.7.0": {},
"Microsoft.Data.SqlClient/2.1.4": {
"dependencies": {
"Microsoft.Data.SqlClient.SNI.runtime": "2.1.1",
@ -206,6 +217,7 @@
}
}
},
"Microsoft.Extensions.ApiDescription.Server/6.0.5": {},
"Microsoft.Extensions.Configuration/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
@ -408,7 +420,7 @@
},
"Microsoft.IdentityModel.Tokens/6.8.0": {
"dependencies": {
"Microsoft.CSharp": "4.5.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.IdentityModel.Logging": "6.8.0",
"System.Security.Cryptography.Cng": "4.5.0"
},
@ -421,6 +433,14 @@
},
"Microsoft.NETCore.Platforms/5.0.0": {},
"Microsoft.NETCore.Targets/1.1.0": {},
"Microsoft.OpenApi/1.2.3": {
"runtime": {
"lib/netstandard2.0/Microsoft.OpenApi.dll": {
"assemblyVersion": "1.2.3.0",
"fileVersion": "1.2.3.0"
}
}
},
"Microsoft.Win32.Registry/4.7.0": {
"dependencies": {
"System.Security.AccessControl": "6.0.0",
@ -723,7 +743,7 @@
}
}
},
"SqlSugarCore/5.1.4.95": {
"SqlSugarCore/5.1.4.115": {
"dependencies": {
"Microsoft.Data.SqlClient": "2.1.4",
"Microsoft.Data.Sqlite": "7.0.5",
@ -738,8 +758,8 @@
},
"runtime": {
"lib/netstandard2.1/SqlSugar.dll": {
"assemblyVersion": "5.1.4.94",
"fileVersion": "5.1.4.94"
"assemblyVersion": "5.1.4.115",
"fileVersion": "5.1.4.115"
}
}
},
@ -774,6 +794,44 @@
}
}
},
"Swashbuckle.AspNetCore/6.5.0": {
"dependencies": {
"Microsoft.Extensions.ApiDescription.Server": "6.0.5",
"Swashbuckle.AspNetCore.Swagger": "6.5.0",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0",
"Swashbuckle.AspNetCore.SwaggerUI": "6.5.0"
}
},
"Swashbuckle.AspNetCore.Swagger/6.5.0": {
"dependencies": {
"Microsoft.OpenApi": "1.2.3"
},
"runtime": {
"lib/net6.0/Swashbuckle.AspNetCore.Swagger.dll": {
"assemblyVersion": "6.5.0.0",
"fileVersion": "6.5.0.0"
}
}
},
"Swashbuckle.AspNetCore.SwaggerGen/6.5.0": {
"dependencies": {
"Swashbuckle.AspNetCore.Swagger": "6.5.0"
},
"runtime": {
"lib/net6.0/Swashbuckle.AspNetCore.SwaggerGen.dll": {
"assemblyVersion": "6.5.0.0",
"fileVersion": "6.5.0.0"
}
}
},
"Swashbuckle.AspNetCore.SwaggerUI/6.5.0": {
"runtime": {
"lib/net6.0/Swashbuckle.AspNetCore.SwaggerUI.dll": {
"assemblyVersion": "6.5.0.0",
"fileVersion": "6.5.0.0"
}
}
},
"System.Collections/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
@ -1286,6 +1344,13 @@
"path": "autofac.extensions.dependencyinjection/8.0.0",
"hashPath": "autofac.extensions.dependencyinjection.8.0.0.nupkg.sha512"
},
"AutoMapper/12.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-hvV62vl6Hp/WfQ24yzo3Co9+OPl8wH8hApwVtgWpiAynVJkUcs7xvehnSftawL8Pe8FrPffBRM3hwzLQqWDNjA==",
"path": "automapper/12.0.1",
"hashPath": "automapper.12.0.1.nupkg.sha512"
},
"DotNetty.Buffers/0.7.5": {
"type": "package",
"serviceable": true,
@ -1342,12 +1407,12 @@
"path": "log4net/2.0.15",
"hashPath": "log4net.2.0.15.nupkg.sha512"
},
"Microsoft.CSharp/4.5.0": {
"Microsoft.CSharp/4.7.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==",
"path": "microsoft.csharp/4.5.0",
"hashPath": "microsoft.csharp.4.5.0.nupkg.sha512"
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
"path": "microsoft.csharp/4.7.0",
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
},
"Microsoft.Data.SqlClient/2.1.4": {
"type": "package",
@ -1377,6 +1442,13 @@
"path": "microsoft.data.sqlite.core/7.0.5",
"hashPath": "microsoft.data.sqlite.core.7.0.5.nupkg.sha512"
},
"Microsoft.Extensions.ApiDescription.Server/6.0.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Ckb5EDBUNJdFWyajfXzUIMRkhf52fHZOQuuZg/oiu8y7zDCVwD0iHhew6MnThjHmevanpxL3f5ci2TtHQEN6bw==",
"path": "microsoft.extensions.apidescription.server/6.0.5",
"hashPath": "microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512"
},
"Microsoft.Extensions.Configuration/7.0.0": {
"type": "package",
"serviceable": true,
@ -1524,6 +1596,13 @@
"path": "microsoft.netcore.targets/1.1.0",
"hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512"
},
"Microsoft.OpenApi/1.2.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Nug3rO+7Kl5/SBAadzSMAVgqDlfGjJZ0GenQrLywJ84XGKO0uRqkunz5Wyl0SDwcR71bAATXvSdbdzPrYRYKGw==",
"path": "microsoft.openapi/1.2.3",
"hashPath": "microsoft.openapi.1.2.3.nupkg.sha512"
},
"Microsoft.Win32.Registry/4.7.0": {
"type": "package",
"serviceable": true,
@ -1643,12 +1722,12 @@
"path": "sqlsugar.ioc/2.0.0",
"hashPath": "sqlsugar.ioc.2.0.0.nupkg.sha512"
},
"SqlSugarCore/5.1.4.95": {
"SqlSugarCore/5.1.4.115": {
"type": "package",
"serviceable": true,
"sha512": "sha512-7+xQXOZhe0dHplO6AJC3V9VAcO7XPhprrgpjMsrj+LUUJ/k1yVrbag8vHVFZyPyC3PfvHTcpJsepuTJMruUPEw==",
"path": "sqlsugarcore/5.1.4.95",
"hashPath": "sqlsugarcore.5.1.4.95.nupkg.sha512"
"sha512": "sha512-D/1b4vxR0rECaRsIDqk3tkkAwf7wEEkO1+VAAnHLECu5mbPESS6T5o+l/DCDvdWDgD0koCHgKhlU1c/SYR9Sig==",
"path": "sqlsugarcore/5.1.4.115",
"hashPath": "sqlsugarcore.5.1.4.115.nupkg.sha512"
},
"SqlSugarCore.Dm/1.2.0": {
"type": "package",
@ -1671,6 +1750,34 @@
"path": "stackexchange.redis/2.7.33",
"hashPath": "stackexchange.redis.2.7.33.nupkg.sha512"
},
"Swashbuckle.AspNetCore/6.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-FK05XokgjgwlCI6wCT+D4/abtQkL1X1/B9Oas6uIwHFmYrIO9WUD5aLC9IzMs9GnHfUXOtXZ2S43gN1mhs5+aA==",
"path": "swashbuckle.aspnetcore/6.5.0",
"hashPath": "swashbuckle.aspnetcore.6.5.0.nupkg.sha512"
},
"Swashbuckle.AspNetCore.Swagger/6.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XWmCmqyFmoItXKFsQSwQbEAsjDKcxlNf1l+/Ki42hcb6LjKL8m5Db69OTvz5vLonMSRntYO1XLqz0OP+n3vKnA==",
"path": "swashbuckle.aspnetcore.swagger/6.5.0",
"hashPath": "swashbuckle.aspnetcore.swagger.6.5.0.nupkg.sha512"
},
"Swashbuckle.AspNetCore.SwaggerGen/6.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Y/qW8Qdg9OEs7V013tt+94OdPxbRdbhcEbw4NiwGvf4YBcfhL/y7qp/Mjv/cENsQ2L3NqJ2AOu94weBy/h4KvA==",
"path": "swashbuckle.aspnetcore.swaggergen/6.5.0",
"hashPath": "swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512"
},
"Swashbuckle.AspNetCore.SwaggerUI/6.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-OvbvxX+wL8skxTBttcBsVxdh73Fag4xwqEU2edh4JMn7Ws/xJHnY/JB1e9RoCb6XpDxUF3hD9A0Z1lEUx40Pfw==",
"path": "swashbuckle.aspnetcore.swaggerui/6.5.0",
"hashPath": "swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512"
},
"System.Collections/4.3.0": {
"type": "package",
"serviceable": true,

@ -9,6 +9,10 @@
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "6.0.0"
}
],
"additionalProbingPaths": [

Loading…
Cancel
Save