合并2
This commit is contained in:
1 parent
7b2c4fa68a
commit
b2ba8650d2
4 files changed
+194
-12
No files matched your search
@@ -139,16 +139,22 @@ namespace WindowsFormsApp1
|
||||
if (oldstatus != PlcData.Read_Status || (Plc_Time - oldPlcstatus_LastTime).TotalSeconds > 5)
|
||||
{
|
||||
//反馈状态
|
||||
Init.Plcstatus = PlcData.Read_Status;
|
||||
Init.Plcstatus_LastTime = DateTime.Now;
|
||||
otherdata.Plc_Status = PlcData.Read_Status;
|
||||
var statusresult = apiClient.CallFunctionByName("Status", PlcData, otherdata);
|
||||
if (statusresult.Success)
|
||||
{
|
||||
Init.Plcstatus = PlcData.Read_Status;
|
||||
Init.Plcstatus_LastTime = DateTime.Now;
|
||||
MES链接状态.Text = "MES链接状态:OK";
|
||||
MES链接状态.BackColor = SystemColors.Control;
|
||||
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
|
||||
MES_MsgfORM("Status", statusresult.Mesresult, statusresult.Requesttime);
|
||||
if (statusresult.Mesresult != mesresult.PASS)
|
||||
{
|
||||
PlcData.Write_Status = 1001;
|
||||
siemensHelp.WriteAddress(plcaddress, PlcData);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -168,15 +174,21 @@ namespace WindowsFormsApp1
|
||||
///////////////////////////////测试用
|
||||
list.Add("M03CVSO-01");
|
||||
otherdata.Plc_ErrorMsgs = list;
|
||||
Init.Plcstatus = PlcData.Read_Status;
|
||||
Init.Plcstatus_LastTime = DateTime.Now;
|
||||
var statusresult = apiClient.CallFunctionByName("Alarm", PlcData, otherdata);
|
||||
if (statusresult.Success)
|
||||
{
|
||||
Init.Plcstatus = PlcData.Read_Status;
|
||||
Init.Plcstatus_LastTime = DateTime.Now;
|
||||
MES链接状态.Text = "MES链接状态:OK";
|
||||
MES链接状态.BackColor = SystemColors.Control;
|
||||
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
|
||||
MES_MsgfORM("Alarm", statusresult.Mesresult, statusresult.Requesttime);
|
||||
if (statusresult.Mesresult != mesresult.PASS)
|
||||
{
|
||||
PlcData.Write_Status = 1001;
|
||||
siemensHelp.WriteAddress(plcaddress, PlcData);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -230,7 +242,7 @@ namespace WindowsFormsApp1
|
||||
if(nowinterface.code == "SN_CheckIN")
|
||||
{
|
||||
请扫描LOT号.Enabled = true;
|
||||
ScanPort.Read();
|
||||
//ScanPort.Read();
|
||||
|
||||
|
||||
}
|
||||
@@ -243,7 +255,7 @@ namespace WindowsFormsApp1
|
||||
var result = apiClient.CallFunctionByName(nowinterface.code,PlcData, otherdata);
|
||||
if (result.Success)
|
||||
{
|
||||
var writeresult = siemensHelp.WriteAddress(Init.t_Plcaddresses.FindAll(a => a.plcid == Plc.id),PlcData);
|
||||
var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData);
|
||||
if (!writeresult.Success)
|
||||
{
|
||||
PLC链接状态.Text = "PLC链接状态:NG";
|
||||
@@ -256,6 +268,12 @@ namespace WindowsFormsApp1
|
||||
MES链接状态.Text = "MES链接状态:OK";
|
||||
MES链接状态.BackColor = SystemColors.Control;
|
||||
MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss");
|
||||
if (result.Mesresult != mesresult.PASS)
|
||||
{
|
||||
PlcData.Write_Status = 1001;
|
||||
siemensHelp.WriteAddress(plcaddress, PlcData);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user