dep
wangsr 12 months ago
commit f94acb881a

@ -246,7 +246,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
//手动加糊化料 //手动加糊化料
if (ButtonE.WetManualGel == runtime.Sender) if (ButtonE.WetManualGel == runtime.Sender)
{ {
if (MessageBox.Show("请使用手动加料", "请使用手动加料", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) if (MessageBox.Show("糊化机打成手动 然后开门放料", "请使用手动加料", MessageBoxButtons.OK, MessageBoxIcon.Question) == DialogResult.No)
{ {
return; return;
} }
@ -276,13 +276,17 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
return; return;
} }
WetGelatDownload(TextE, RadioE); bool b= WetGelatDownload(TextE, RadioE);
if (b)
{
LjLogControl.ManualLogControl("手动下冷水", 3, Convert.ToInt32(TextE.ManualWeight.MCValue.ToString()), ControlsHelper.SingleSelect(RadioE), 2); LjLogControl.ManualLogControl("手动下冷水", 3, Convert.ToInt32(TextE.ManualWeight.MCValue.ToString()), ControlsHelper.SingleSelect(RadioE), 2);
MessageBox.Show("数据下传成功!"); MessageBox.Show("数据下传成功!");
} }
}
if(ButtonE.WetManualControlStop== runtime.Sender) if(ButtonE.WetManualControlStop== runtime.Sender)
{ {
WetGelatStopDownload(RadioE); WetGelatStopDownload(RadioE);

@ -714,7 +714,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
#region 湿混机手动下粉料 #region 湿混机手动下粉料
public static void WetGelatDownload(MCTextBoxEntity TextE, MCRadioButtonEntity RadioE) public static bool WetGelatDownload(MCTextBoxEntity TextE, MCRadioButtonEntity RadioE)
{ {
float t = Convert.ToSingle(TextE.ManualTolerance.MCValue.ToString()); float t = Convert.ToSingle(TextE.ManualTolerance.MCValue.ToString());
float w = Convert.ToSingle(TextE.ManualWeight.MCValue.ToString()); float w = Convert.ToSingle(TextE.ManualWeight.MCValue.ToString());
@ -722,7 +722,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (t < 0.1) if (t < 0.1)
{ {
MessageBox.Show("公差不能小于0.1"); MessageBox.Show("公差不能小于0.1");
return; return false;
} }
SetValue value = new SetValue() SetValue value = new SetValue()
@ -732,7 +732,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
}; };
DB2105Helper dB2105= new DB2105Helper(); DB2105Helper dB2105= new DB2105Helper();
bool run = false;
var singE = ControlsHelper.SingleSelect(RadioE); var singE = ControlsHelper.SingleSelect(RadioE);
switch (singE) switch (singE)
{ {
@ -742,7 +742,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (h1.RunStatus) if (h1.RunStatus)
{ {
ShowError(); ShowError();
return; run = true;
} }
break; break;
@ -752,7 +753,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (h2.RunStatus) if (h2.RunStatus)
{ {
ShowError(); ShowError();
return; run = true;
} }
break; break;
@ -762,7 +764,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (h3.RunStatus) if (h3.RunStatus)
{ {
ShowError(); ShowError();
return; run = true;
} }
break; break;
@ -773,13 +776,15 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (h4.RunStatus) if (h4.RunStatus)
{ {
ShowError(); ShowError();
return; run = true;
} }
break; break;
} }
if (run == false)
{
switch (singE) switch (singE)
{ {
case 1: case 1:
@ -841,11 +846,19 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
break; break;
default: default:
MessageBox.Show("当前未选择产线!"); MessageBox.Show("当前未选择产线!");
return; return false;
} }
ManualWeightLog(w, t, RadioE); ManualWeightLog(w, t, RadioE);
return true;
}
return false;
} }

@ -82,7 +82,6 @@ namespace DataBlockHelper.DBHelpers
private WaterEntity GetWater(int start) private WaterEntity GetWater(int start)
{ {
var instanceByteTransform = PlcConnect.Instance.ByteTransform; var instanceByteTransform = PlcConnect.Instance.ByteTransform;
var ls = this.bytes = PlcConnect.Instance.Read($"DB2104.{start}.0", 16).Content; var ls = this.bytes = PlcConnect.Instance.Read($"DB2104.{start}.0", 16).Content;
WaterEntity entity = new WaterEntity WaterEntity entity = new WaterEntity
{ {

@ -27,19 +27,22 @@ namespace DataBlockHelper
SiemensPLCS siemensPLCS = SiemensPLCS.S1500; SiemensPLCS siemensPLCS = SiemensPLCS.S1500;
SiemensS7Net s7 = new SiemensS7Net(siemensPLCS); SiemensS7Net s7 = new SiemensS7Net(siemensPLCS);
s7.SetPersistentConnection(); s7.SetPersistentConnection();
s7.IpAddress = "172.18.4.100"; // s7.IpAddress = "172.18.4.100";
s7.IpAddress = "192.168.1.110";
s7.Port = 102; s7.Port = 102;
var su = s7.ConnectServer(); var su = s7.ConnectServer();
if (!su.IsSuccess) if (!su.IsSuccess)
{ {
s7.IpAddress = "192.168.0.100"; //s7.IpAddress = "192.168.0.100";
s7.Port = 7788; //s7.Port = 7788;
var fn = s7.ConnectServer(); //var fn = s7.ConnectServer();
if (!fn.IsSuccess) //if (!fn.IsSuccess)
{ //{
return new SiemensS7Net(siemensPLCS); // return new SiemensS7Net(siemensPLCS);
} //}
} }
return s7; return s7;

Loading…
Cancel
Save