|
|
|
@ -74,10 +74,18 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
RefreshMagNet();
|
|
|
|
|
RefreshSpiral();
|
|
|
|
|
RefreshHot();
|
|
|
|
|
RefreshUnPack();
|
|
|
|
|
if (plc != null)
|
|
|
|
|
{
|
|
|
|
|
RefreshMagNet();
|
|
|
|
|
RefreshSpiral();
|
|
|
|
|
RefreshHot();
|
|
|
|
|
RefreshUnPack();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"设备监听启动失败;PLC连接失败!");
|
|
|
|
|
Thread.Sleep(1000 * 30);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -581,9 +589,9 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度值")) * 100;
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度值"));
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"), true);
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), value2);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), value2);
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
result = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"));
|
|
|
|
|
}
|
|
|
|
@ -671,7 +679,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
int value1 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度值"));
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"), true);
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), value1 * 100);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), value1);
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
result = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"));
|
|
|
|
|
|
|
|
|
@ -766,7 +774,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
}
|
|
|
|
|
int value = int.Parse(baseBusiness.GetPlcAddressByConfigKey("烘干机温度设定值"));
|
|
|
|
|
SendPulseSignal("烘干机燃烧启动");
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机温度设定"), value * 100);
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机温度设定"), value * 10);
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -963,11 +971,11 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
HotSignal1_1.Fill = signal1_1==2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal1_1.Fill = signal1_1==1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal1_1_Value.Text = ChangeHotStatus(signal1_1);
|
|
|
|
|
HotSignal2_1.Fill = signal2_1 == 2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_1.Fill = signal2_1 == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_1_Value.Text = ChangeHotStatus(signal2_1);
|
|
|
|
|
HotSignal3_1.Fill = signal3_1 == 2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_1.Fill = signal3_1 == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_1_Value.Text = ChangeHotStatus(signal3_1);
|
|
|
|
|
|
|
|
|
|
HotSignal1_2.Fill = signal1_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
@ -1001,10 +1009,11 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
switch (status)
|
|
|
|
|
{
|
|
|
|
|
case 1: return "未知"; break;
|
|
|
|
|
case 2: return "运行"; break;
|
|
|
|
|
case 4: return "停止"; break;
|
|
|
|
|
default: return "未知"; break;
|
|
|
|
|
case 0: return "未知";
|
|
|
|
|
case 1: return "运行";
|
|
|
|
|
case 2: return "停止";
|
|
|
|
|
case 3: return "故障";
|
|
|
|
|
default: return "未知";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private string ChangeHotWarn(int status)
|
|
|
|
@ -1072,8 +1081,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
BaseConfigInfo configInfo1 = configInfos.Where(x => x.ConfigKey == "螺旋1速度值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo2 = configInfos.Where(x => x.ConfigKey == "螺旋2速度值").FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), speed1 * 100);
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), speed2 * 100);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), speed1 );
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), speed2 );
|
|
|
|
|
|
|
|
|
|
configInfo1.ConfigValue = Speed1Txt.Text;
|
|
|
|
|
configInfo2.ConfigValue = Speed2Txt.Text;
|
|
|
|
@ -1154,7 +1163,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
List<BaseConfigInfo> configInfos = _configInfoBusiness.GetConfigInfos();
|
|
|
|
|
BaseConfigInfo configInfo = configInfos.Where(x => x.ConfigKey == "烘干机螺旋频率设定值").FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机温度设定"), temp/100);
|
|
|
|
|
plc.writeInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机温度设定"), temp*10);
|
|
|
|
|
|
|
|
|
|
configInfo.ConfigValue = HotTempTxt.Text;
|
|
|
|
|
|
|
|
|
|