|
|
|
|
@ -143,24 +143,8 @@ public class PlcEventTask { |
|
|
|
|
if (plcList.size() == 0) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (WcsPlcConnectVo conn : plcList) { |
|
|
|
|
if(conn.getPlcIp().contains(".41")){ |
|
|
|
|
PlcOperate plcOperate_41 = plcInit.getPlcOperate_41(); |
|
|
|
|
if (plcOperate_41 ==null){ |
|
|
|
|
plcInit.connect(conn.getPlcIp()); |
|
|
|
|
} |
|
|
|
|
plcTask(plcInit.getPlcOperate_41(), conn, conn.getPointTables()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(conn.getPlcIp().contains(".50")){ |
|
|
|
|
PlcOperate plcOperate_50 = plcInit.getPlcOperate_50(); |
|
|
|
|
if (plcOperate_50 ==null){ |
|
|
|
|
plcInit.connect(conn.getPlcIp()); |
|
|
|
|
} |
|
|
|
|
plcTask(plcOperate_50, conn, conn.getPointTables()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("1".equals(conn.getDevType())){ |
|
|
|
|
if(conn.getPlcIp().contains(".60")){ |
|
|
|
|
PlcOperate plcOperate_60 = plcInit.getPlcOperate_60(); |
|
|
|
|
if (plcOperate_60 ==null){ |
|
|
|
|
@ -215,6 +199,60 @@ public class PlcEventTask { |
|
|
|
|
doDevStatus(plcOperate_110,"6"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if(conn.getPlcIp().contains(".41")){
|
|
|
|
|
// PlcOperate plcOperate_41 = plcInit.getPlcOperate_41();
|
|
|
|
|
// if (plcOperate_41 ==null){
|
|
|
|
|
// plcInit.connect(conn.getPlcIp());
|
|
|
|
|
// }
|
|
|
|
|
// plcTask(plcInit.getPlcOperate_41(), conn, conn.getPointTables());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(conn.getPlcIp().contains(".50")){
|
|
|
|
|
// PlcOperate plcOperate_50 = plcInit.getPlcOperate_50();
|
|
|
|
|
// if (plcOperate_50 ==null){
|
|
|
|
|
// plcInit.connect(conn.getPlcIp());
|
|
|
|
|
// }
|
|
|
|
|
// plcTask(plcOperate_50, conn, conn.getPointTables());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Scheduled(fixedRate = 200)
|
|
|
|
|
public void init1() { |
|
|
|
|
//查询需要连接的PLC,初始化连接对象
|
|
|
|
|
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); |
|
|
|
|
if (plcList.size() == 0) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
for (WcsPlcConnectVo conn : plcList) { |
|
|
|
|
if ("2".equals(conn.getDevType()) && conn.getPlcIp().contains(".41")){ |
|
|
|
|
PlcOperate plcOperate_41 = plcInit.getPlcOperate_41(); |
|
|
|
|
if (plcOperate_41 ==null){ |
|
|
|
|
plcInit.connect(conn.getPlcIp()); |
|
|
|
|
} |
|
|
|
|
plcTask(plcInit.getPlcOperate_41(), conn, conn.getPointTables()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Scheduled(fixedRate = 200)
|
|
|
|
|
public void init2() { |
|
|
|
|
//查询需要连接的PLC,初始化连接对象
|
|
|
|
|
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); |
|
|
|
|
if (plcList.size() == 0) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
for (WcsPlcConnectVo conn : plcList) { |
|
|
|
|
if ("3".equals(conn.getDevType()) && conn.getPlcIp().contains(".50")){ |
|
|
|
|
PlcOperate plcOperate_50 = plcInit.getPlcOperate_50(); |
|
|
|
|
if (plcOperate_50 ==null){ |
|
|
|
|
plcInit.connect(conn.getPlcIp()); |
|
|
|
|
} |
|
|
|
|
plcTask(plcOperate_50, conn, conn.getPointTables()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(fixedDelay = 6000) |
|
|
|
|
|