新增1线,是从2线平移过去的。
This commit is contained in:
@@ -224,8 +224,8 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
}
|
||||
|
||||
//一. 从plc 中获取 subIdList 和 lineNum
|
||||
String[] subIdList = (String[])read(S7Client.S7_DDJ1,Step2Plc2MesVar.SubIdList);
|
||||
Integer listSize = (Integer)read(S7Client.S7_DDJ1,Step2Plc2MesVar.PackageNumberSet)-1;
|
||||
String[] subIdList = (String[])read(S7Client.S7_DDJ2,Step2Plc2MesVar.SubIdList);
|
||||
Integer listSize = (Integer)read(S7Client.S7_DDJ2,Step2Plc2MesVar.PackageNumberSet)-1;
|
||||
|
||||
|
||||
//二. MES 业务
|
||||
@@ -301,11 +301,11 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
//=============== MES 业务 结束 =================
|
||||
|
||||
//三. 把生成的BoxId 告诉kuka
|
||||
write(S7Client.S7_DDJ1,Step2Mes2PlcVar.BoxId,boxId);
|
||||
write(S7Client.S7_DDJ2,Step2Mes2PlcVar.BoxId,boxId);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"传给PLC 成功");
|
||||
|
||||
//四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
|
||||
write(S7Client.S7_DDJ1,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
write(S7Client.S7_DDJ2,Step2Mes2PlcVar.ShelfIsFullFinish,true);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为true 成功");
|
||||
//四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
|
||||
Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
|
||||
@@ -314,7 +314,7 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
}else if(subArrived2 == 2){
|
||||
throw new Exception("MES 监听值出现异常。");
|
||||
}
|
||||
write(S7Client.S7_DDJ1,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
write(S7Client.S7_DDJ2,Step2Mes2PlcVar.ShelfIsFullFinish,false);
|
||||
logger.info("BOXID生成Event-------boxId :"+ boxId+"ShelfIsFullFinish 置为false 成功,Event2 成功结束");
|
||||
logger.info("================================== 现在开始执行 过程二 任务( 结束 ) ===================================");
|
||||
logger.info("");
|
||||
@@ -342,7 +342,7 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
while (true){
|
||||
try {
|
||||
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ1,var);
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ2,var);
|
||||
//注意:即使now为null ,这里也不会抛出异常,这里很容易产生 空轮询。
|
||||
if(now == null){
|
||||
throw new Exception("");
|
||||
@@ -373,7 +373,7 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
Integer res = 0;
|
||||
while (true){
|
||||
try {
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ1,var);
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ2,var);
|
||||
if(now == null){
|
||||
throw new Exception("");
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public class KukaEvent2ThreadLine2 implements ApplicationRunner {
|
||||
Integer res = 0;
|
||||
while (true){
|
||||
try {
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ1,var);
|
||||
Boolean now = (Boolean) read(S7Client.S7_DDJ2,var);
|
||||
if(now == null){
|
||||
throw new Exception("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user