ZengTao
2025-06-10 05bd172d550f1b6b963fcb23ef21d79e2a43d757
更新S7通讯程序
15个文件已修改
432 ■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/config/S7Config.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcEdgTask.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassTask.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/config/S7Config.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -16,24 +16,28 @@
    @Bean(name = "s7SerializerWLOne")
    public S7Serializer s7SerializerWLOne() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.100");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerWLTwo")
    public S7Serializer s7SerializerWLTwo() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.130");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerMBOne")
    public S7Serializer s7SerializerMBOne() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.58");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerMBTwo")
    public S7Serializer s7SerializerMBTwo() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.18");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
@@ -19,7 +19,6 @@
import com.mes.edgstoragecage.service.EdgStorageCageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.opctask.entity.EdgStorageDeviceTask;
import com.mes.opctask.entity.EdgStorageDeviceTaskHistory;
import com.mes.opctask.service.EdgStorageDeviceTaskHistoryService;
import com.mes.opctask.service.EdgStorageDeviceTaskService;
@@ -27,7 +26,6 @@
import com.mes.s7.entity.S7DataWL;
import com.mes.s7.entity.S7DataWLExtra;
import com.mes.sysconfig.service.SysConfigService;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -126,10 +124,11 @@
    public void startOneOpcTask() throws Exception {
        S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
        S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
        log.info("二线卧理: {}", s7DataWLTwo);
        log.info("一线卧理: {}", s7DataWLOne);
        //获取第二条线路的卧式理片笼状态
//        ReadWriteEntity twoInkageEntity = miloService.readFromOpcUa("WL2.WL2.deviceState");
        Boolean twoInkageEntity = s7DataWLTwo.getDeviceState();
//        Boolean twoInkageEntity = Boolean.FALSE;
        //默认只跑一台卧式理片,两条线路都可以走
        int cellFlag = 1;
        //如果两条线都启动则只能跑一条线
@@ -144,7 +143,7 @@
    public void startTwoOpcTask() throws Exception {
        S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
        S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
        log.info("一线卧理: {}", s7DataWLOne);
        log.info("二线卧理: {}", s7DataWLTwo);
//        ReadWriteEntity oneInkageEntity = miloService.readFromOpcUa("WL1.WL1.deviceState");
        Boolean oneInkageEntity = s7DataWLOne.getDeviceState();
        int cellFlag = 1;
@@ -204,9 +203,11 @@
//            task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING);
//            edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
            if (device == 2) {
                s7SerializerWLTwo.write(S7DataWL.builder().taskRunning(Const.GLASS_CACHE_TYPE_RUNNING.shortValue()).build());
                task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING);
                s7SerializerWLTwo.write(S7DataWL.builder().taskRunning(Const.GLASS_CACHE_TYPE_RUNNING).build());
            } else {
                s7SerializerWLOne.write(S7DataWL.builder().taskRunning(Const.GLASS_CACHE_TYPE_RUNNING.shortValue()).build());
                task.setTaskRunning(Const.GLASS_CACHE_TYPE_RUNNING);
                s7SerializerWLOne.write(S7DataWL.builder().taskRunning(Const.GLASS_CACHE_TYPE_RUNNING).build());
            }
        } else if (request == 5) {
@@ -234,6 +235,7 @@
//        String glassId = task.getGlassId();
        S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
        String glassId = s7DataWLOne.getGlassId();
        log.info("1号线玻璃id{},历史id{}", glassId, glassIdOne);
        if (StringUtils.isBlank(glassId) || glassId.equals(glassIdOne)) {
            log.info("{}号线磨边前玻璃未就位,结束本次任务", 1);
            return;
@@ -246,7 +248,10 @@
//        EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(EDG_STORAGE_DEVICE_TWO_TASK);
//        String glassId = task.getGlassId();
        S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
//        S7DataMB s7DataMB = s7SerializerMBOne.read(S7DataMB.class);
//        log.info("磨边数据{}", s7DataMB);
        String glassId = s7DataWLTwo.getGlassId();
        log.info("2号线玻璃id{},历史id{}", glassId, glassIdTwo);
        if (StringUtils.isBlank(glassId) || glassId.equals(glassIdTwo)) {
            log.info("{}号线磨边前玻璃未就位,结束本次任务", 2);
            return;
@@ -271,15 +276,21 @@
//
//        miloService.writeToOpcUa(list);
//        miloService.writeToOpcWord(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".thickness", (int) glassInfo.getThickness() * ratio));
        S7DataMB s7DataMB = new S7DataMB();
        s7DataMB.setToEdingId(Integer.parseInt(toEndingId));
        s7DataMB.setGlassId(Integer.parseInt(toEndingId));
        s7DataMB.setWidth((int) Math.max(glassInfo.getWidth() * ratio, glassInfo.getHeight() * ratio));
        s7DataMB.setHeight((int) Math.min(glassInfo.getWidth() * ratio, glassInfo.getHeight() * ratio));
        s7SerializerMBOne.write(s7DataMB);
        log.info("玻璃id:{},{}线向PLC发送宽高数据{}", glassId, cell, s7DataMB);
        if (cell == 1) {
            s7SerializerMBOne.write(s7DataMB);
        } else {
            s7SerializerMBTwo.write(s7DataMB);
        }
        s7DataMB = new S7DataMB();
        s7DataMB.setThickness((short) (glassInfo.getThickness() * ratio));
        s7DataMB.setThickness((int) (glassInfo.getThickness() * ratio));
        log.info("{}线向PLC发送厚度数据{}", cell, s7DataMB);
        if (cell == 1) {
            s7SerializerMBOne.write(s7DataMB);
        } else {
@@ -346,17 +357,17 @@
//        task.setStartCell(edgStorageCage.getSlot());
//        task.setTaskRunning(Const.GLASS_CACHE_TYPE_IN);
//        edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
        task.setStartCell(edgStorageCage.getSlot().shortValue());
        task.setTaskRunning(Const.GLASS_CACHE_TYPE_IN.shortValue());
        task.setStartCell(edgStorageCage.getSlot());
        task.setTaskRunning(Const.GLASS_CACHE_TYPE_IN);
        if (deviceId == 1) {
            s7SerializerWLOne.write(
                    S7DataWL.builder().startCell(edgStorageCage.getSlot().shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_IN.shortValue()).build()
                    S7DataWL.builder().startCell(edgStorageCage.getSlot())
                            .taskRunning(Const.GLASS_CACHE_TYPE_IN).build()
            );
        } else {
            s7SerializerWLTwo.write(
                    S7DataWL.builder().startCell(edgStorageCage.getSlot().shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_IN.shortValue()).build()
                    S7DataWL.builder().startCell(edgStorageCage.getSlot())
                            .taskRunning(Const.GLASS_CACHE_TYPE_IN).build()
            );
        }
        saveHistoryTask(task, deviceId);
@@ -380,9 +391,9 @@
        S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
        S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
        S7DataWLExtra s7DataWLExtraTwo = s7SerializerWLTwo.read(S7DataWLExtra.class);
        Short oneOutStateEntity = s7DataWLOne.getSlotState();
        Short twoOutStateEntity = s7DataWLTwo.getSlotState();
        Short d06OutStateEntity = s7DataWLExtraTwo.getD06SlotState();
        Integer oneOutStateEntity = s7DataWLOne.getSlotState();
        Integer twoOutStateEntity = s7DataWLTwo.getSlotState();
        Integer d06OutStateEntity = s7DataWLExtraTwo.getD06SlotState();
        //状态有3中情况:0空闲 1忙碌 2禁用
        String oneOutState = Const.OUT_DISABLE;
        String twoOutState = Const.OUT_DISABLE;
@@ -590,27 +601,27 @@
            log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT);
        }
        //生成出片任务
//        task.setGlassIdOut(edgStorageCageDetails.getGlassId());
//        task.setStartCell(edgStorageCageDetails.getSlot());
//        task.setTaskRunning(taskType);
//        task.setEndCell(cell);
        task.setGlassIdOut(edgStorageCageDetails.getGlassId());
        task.setStartCell(edgStorageCageDetails.getSlot());
        task.setTaskRunning(taskType);
        task.setEndCell(cell);
//        edgStorageDeviceTaskService.updateTaskMessage(tableName, task);
        if (deviceId == 1) {
            s7SerializerWLOne.write(
                    S7DataWL.builder()
                            .glassIdOut(edgStorageCageDetails.getGlassId())
                            .startCell(edgStorageCageDetails.getSlot().shortValue())
                            .taskRunning((short) taskType)
                            .endCell((short) cell)
                            .startCell(edgStorageCageDetails.getSlot())
                            .taskRunning(taskType)
                            .endCell(cell)
                            .build()
            );
        } else {
            s7SerializerWLTwo.write(
                    S7DataWL.builder()
                            .glassIdOut(edgStorageCageDetails.getGlassId())
                            .startCell(edgStorageCageDetails.getSlot().shortValue())
                            .taskRunning((short) taskType)
                            .endCell((short) cell)
                            .startCell(edgStorageCageDetails.getSlot())
                            .taskRunning(taskType)
                            .endCell(cell)
                            .build()
            );
        }
@@ -671,19 +682,19 @@
        if (device == 1) {
            s7SerializerWLOne.write(
                    S7DataWL.builder()
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY.shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY)
                            .glassIdOut("")
                            .startCell((short) 0)
                            .endCell((short) 0)
                            .startCell(0)
                            .endCell(0)
                            .build()
            );
        } else {
            s7SerializerWLTwo.write(
                    S7DataWL.builder()
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY.shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY)
                            .glassIdOut("")
                            .startCell((short) 0)
                            .endCell((short) 0)
                            .startCell(0)
                            .endCell(0)
                            .build()
            );
        }
@@ -736,19 +747,19 @@
        if (device == 1) {
            s7SerializerWLOne.write(
                    S7DataWL.builder()
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY.shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY)
                            .glassIdOut("")
                            .startCell((short) 0)
                            .endCell((short) 0)
                            .startCell(0)
                            .endCell(0)
                            .build()
            );
        } else {
            s7SerializerWLTwo.write(
                    S7DataWL.builder()
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY.shortValue())
                            .taskRunning(Const.GLASS_CACHE_TYPE_EMPTY)
                            .glassIdOut("")
                            .startCell((short) 0)
                            .endCell((short) 0)
                            .startCell(0)
                            .endCell(0)
                            .build()
            );
        }
@@ -896,7 +907,7 @@
        EdgStorageDeviceTaskHistory taskHistory = new EdgStorageDeviceTaskHistory();
        BeanUtils.copyProperties(task, taskHistory);
//        taskHistory.setTaskType(task.getTaskRunning());
        taskHistory.setTaskType(Integer.parseInt(task.getTaskRunning().toString()));
        taskHistory.setTaskType(task.getTaskRunning());
        taskHistory.setCreateTime(new Date());
        taskHistory.setTaskState(Const.RAW_GLASS_TASK_NEW);
        taskHistory.setDeviceId(deviceId);
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcEdgTask.java
@@ -38,7 +38,6 @@
    @Resource
    GlassInfoService glassInfoService;
    @Scheduled(fixedDelay = 2000)
    public void startOneEdgTask() throws Exception {
        startEdgTaskChild("01");
@@ -51,7 +50,7 @@
    private void startEdgTaskChild(String cell) throws Exception {
        S7DataMBExtra s7DataMBExtra = s7SerializerMBExtra.read(S7DataMBExtra.class);
        log.info("MB04读取数据{}", s7DataMBExtra);
//        ReadWriteEntity request = miloService.readFromOpcUa("MB04.MB04.request" + cell);
//        if (null == request || "0".equals(request.getValue() + "")) {
        String request = "";
@@ -84,13 +83,13 @@
//        ualist.add(generateReadWriteEntity("MB04.MB04.thickness" + cell, (int) glassInfo.getThickness() * 10));
//        miloService.writeToOpcWord(ualist);
//        miloService.writeToOpcUa(generateReadWriteEntity("MB04.MB04.mes_glass_Id_" + cell, glassId));
        log.info("{}线发送尺寸信息宽:{},高:{},厚度:{}", cell, Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10), Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10), glassInfo.getThickness() * 10);
        if ("01".equals(cell)) {
            s7SerializerMBExtra.write(
                    S7DataMBExtra.builder()
                            .widthOne((short) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .heightOne((short) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .thicknessOne((short) (glassInfo.getThickness() * 10))
                            .widthOne((int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .heightOne((int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .thicknessOne((int) (glassInfo.getThickness() * 10))
                            .build()
            );
            s7SerializerMBExtra.write(
@@ -99,9 +98,9 @@
        } else {
            s7SerializerMBExtra.write(
                    S7DataMBExtra.builder()
                            .widthTwo((short) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .heightTwo((short) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .thicknessTwo((short) (glassInfo.getThickness() * 10))
                            .widthTwo((int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .heightTwo((int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))
                            .thicknessTwo((int) (glassInfo.getThickness() * 10))
                            .build()
            );
            s7SerializerMBExtra.write(
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMB.java
@@ -13,25 +13,40 @@
public class S7DataMB {
    @S7Variable(address = "DB19.6", type = EDataType.FLOAT32)
    @S7Variable(address = "DB323.6", type = EDataType.FLOAT32)
    private Float speed;
    @S7Variable(address = "DB49.10", type = EDataType.INT32)
    private Integer width;
    @S7Variable(address = "DB49.2", type = EDataType.INT32)
    @S7Variable(address = "DB324.2", type = EDataType.INT32)
    private Integer toEdingId;
    @S7Variable(address = "DB49.6", type = EDataType.INT32)
    @S7Variable(address = "DB324.6", type = EDataType.INT32)
    private Integer glassId;
    @S7Variable(address = "DB49.14", type = EDataType.INT32)
    @S7Variable(address = "DB324.10", type = EDataType.INT32)
    private Integer width;
    @S7Variable(address = "DB324.14", type = EDataType.INT32)
    private Integer height;
    @S7Variable(address = "DB49.18", type = EDataType.INT16)
    private Short thickness;
    @S7Variable(address = "DB324.18", type = EDataType.UINT16)
    private Integer thickness;
    @S7Variable(address = "DB49.0.3", type = EDataType.BOOL)
    @S7Variable(address = "DB324.0.3", type = EDataType.BOOL)
    private Boolean mesControl;
//    @S7Variable(address = "DB49.126", type = EDataType.INT32)
//    private Integer toEdingId;
//
//    @S7Variable(address = "DB49.130", type = EDataType.INT32)
//    private Integer glassId;
//
//    @S7Variable(address = "DB49.134", type = EDataType.INT32)
//    private Integer width;
//
//    @S7Variable(address = "DB49.138", type = EDataType.INT32)
//    private Integer height;
//
//    @S7Variable(address = "DB49.142", type = EDataType.UINT16)
//    private Short thickness;
}
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataMBExtra.java
@@ -19,40 +19,40 @@
public class S7DataMBExtra {
    @S7Variable(address = "DB49.0", type = EDataType.INT16)
    private Short requestOne;
    @S7Variable(address = "DB49.0", type = EDataType.UINT16)
    private Integer requestOne;
    @S7Variable(address = "DB49.46", type = EDataType.INT16)
    private Short widthOne;
    @S7Variable(address = "DB49.46", type = EDataType.UINT16)
    private Integer widthOne;
    @S7Variable(address = "DB49.48", type = EDataType.INT16)
    private Short heightOne;
    @S7Variable(address = "DB49.48", type = EDataType.UINT16)
    private Integer heightOne;
    @S7Variable(address = "DB49.50", type = EDataType.INT16)
    private Short thicknessOne;
    @S7Variable(address = "DB49.50", type = EDataType.UINT16)
    private Integer thicknessOne;
    @S7Variable(address = "DB49.52", type = EDataType.INT16)
    private Short requestTwo;
    @S7Variable(address = "DB49.52", type = EDataType.UINT16)
    private Integer requestTwo;
    @S7Variable(address = "DB49.98", type = EDataType.INT16)
    private Short widthTwo;
    @S7Variable(address = "DB49.98", type = EDataType.UINT16)
    private Integer widthTwo;
    @S7Variable(address = "DB49.100", type = EDataType.INT16)
    private Short heightTwo;
    @S7Variable(address = "DB49.100", type = EDataType.UINT16)
    private Integer heightTwo;
    @S7Variable(address = "DB49.102", type = EDataType.INT16)
    private Short thicknessTwo;
    @S7Variable(address = "DB49.102", type = EDataType.UINT16)
    private Integer thicknessTwo;
    @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 20)
    private String plcGlassIdOne;
    @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 20)
    private String mesGlassIdOne;
    @S7Variable(address = "DB49.54", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.54", type = EDataType.STRING, count = 20)
    private String plcGlassIdTwo;
    @S7Variable(address = "DB49.76", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.76", type = EDataType.STRING, count = 20)
    private String mesglassIdTwo;
}
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWL.java
@@ -19,37 +19,37 @@
public class S7DataWL {
    @S7Variable(address = "DB49.0", type = EDataType.INT16)
    private Short taskRunning;
    @S7Variable(address = "DB49.0", type = EDataType.UINT16)
    private Integer taskRunning;
    @S7Variable(address = "DB49.46", type = EDataType.INT16)
    private Short currentCell;
    @S7Variable(address = "DB49.46", type = EDataType.UINT16)
    private Integer currentCell;
    @S7Variable(address = "DB49.48", type = EDataType.INT16)
    private Short startCell;
    @S7Variable(address = "DB49.48", type = EDataType.UINT16)
    private Integer startCell;
    @S7Variable(address = "DB49.50", type = EDataType.INT16)
    private Short endCell;
    @S7Variable(address = "DB49.50", type = EDataType.UINT16)
    private Integer endCell;
    @S7Variable(address = "DB49.52", type = EDataType.INT16)
    private Short TaskState;
    @S7Variable(address = "DB49.52", type = EDataType.UINT16)
    private Integer TaskState;
    @S7Variable(address = "DB49.116", type = EDataType.INT16)
    private Short inPlace;
    @S7Variable(address = "DB49.116", type = EDataType.UINT16)
    private Integer inPlace;
    @S7Variable(address = "DB49.124", type = EDataType.INT16)
    private Short slotState;
    @S7Variable(address = "DB49.124", type = EDataType.UINT16)
    private Integer slotState;
    @S7Variable(address = "DB49.118", type = EDataType.FLOAT32)
    private Float speed;
    @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.2", type = EDataType.STRING, count = 20)
    private String glassIdIn;
    @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.24", type = EDataType.STRING, count = 20)
    private String glassIdOut;
    @S7Variable(address = "DB49.94", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB49.94", type = EDataType.STRING, count = 20)
    private String glassId;
    @S7Variable(address = "DB49.112.0", type = EDataType.BOOL)
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/s7/entity/S7DataWLExtra.java
@@ -12,7 +12,7 @@
@Data
public class S7DataWLExtra {
    @S7Variable(address = "DB49.126", type = EDataType.INT16)
    private Short d06SlotState;
    @S7Variable(address = "DB49.126", type = EDataType.UINT16)
    private Integer d06SlotState;
}
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -15,13 +15,13 @@
public class S7Config {
    @Bean(name = "s7SerializerDLPOne")
    public S7Serializer s7SerializerDLPOne() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.20.140");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.140");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerDLPTwo")
    public S7Serializer s7SerializerDLPTwo() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.20.140");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.140");
        return S7Serializer.newInstance(s7PLC);
    }
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPOne.java
@@ -16,7 +16,7 @@
public class S7DataDLPOne {
    @S7Variable(address = "DB3.3118", type = EDataType.BOOL)
    @S7Variable(address = "DB3.3118.0", type = EDataType.BOOL)
    private Boolean mesControl;
    @S7Variable(address = "DB19.0", type = EDataType.INT16)
@@ -82,22 +82,22 @@
    @S7Variable(address = "DB19.1246", type = EDataType.INT16)
    private Short glassCount;
    @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 20)
    private String id1;
    @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 20)
    private String id2;
    @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 20)
    private String id3;
    @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 20)
    private String id4;
    @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 20)
    private String id5;
    @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 20)
    private String id6;
    @S7Variable(address = "MW1002", type = EDataType.INT16)
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/s7/entity/S7DataDLPTwo.java
@@ -13,7 +13,7 @@
public class S7DataDLPTwo {
    @S7Variable(address = "DB3.3118", type = EDataType.BOOL)
    @S7Variable(address = "DB3.3118.0", type = EDataType.BOOL)
    private Boolean mesControl;
    @S7Variable(address = "DB19.4", type = EDataType.INT16)
@@ -76,22 +76,22 @@
    @S7Variable(address = "DB19.342", type = EDataType.INT16)
    private Short state6;
    @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 20)
    private String id1;
    @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 20)
    private String id2;
    @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 20)
    private String id3;
    @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 20)
    private String id4;
    @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 20)
    private String id5;
    @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 22)
    @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 20)
    private String id6;
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/config/S7Config.java
@@ -16,19 +16,22 @@
    @Bean(name = "s7SerializerCC")
    public S7Serializer s7SerializerCC() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.80");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.80");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerSPOne")
    public S7Serializer s7SerializerSPOne() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.15");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.15");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerSPTwo")
    public S7Serializer s7SerializerSPTwo() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.21");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.21");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
}
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassTask.java
@@ -103,7 +103,7 @@
            if ("1".equals(confireWord) && "0".equals(reportWord)) {
//            if ("1".equals(confireWord.getValue() + "") && "0".equals(reportWord.getValue() + "")) {
                S7DataCC s7Data = new S7DataCC();
                s7Data.setConfirmation((short) 0);
                s7Data.setConfirmation(0);
                s7SerializerCC.write(s7Data);
//                List<ReadWriteEntity> list = new ArrayList<>();
//                list.add(generateReadWriteEntity("CC.CC.confirmation", 0));
@@ -112,9 +112,9 @@
            if ("1".equals(taskWord)) {
//          if ("1".equals(taskWord.getValue() + "")) {
                S7DataCC s7Data = new S7DataCC();
                s7Data.setTaskWord((short) 0);
                s7Data.setStartSlot((short) 0);
                s7Data.setEndSlot((short) 0);
                s7Data.setTaskWord(0);
                s7Data.setStartSlot(0);
                s7Data.setEndSlot(0);
                s7SerializerCC.write(s7Data);
//                List<ReadWriteEntity> list = new ArrayList<>();
//                list.add(generateReadWriteEntity("CC.CC.taskWord", 0));
@@ -248,7 +248,7 @@
        }
        S7DataCC s7Data = new S7DataCC();
        s7Data.setConfirmation((short) 1);
        s7Data.setConfirmation(1);
        s7SerializerCC.write(s7Data);
//        List<ReadWriteEntity> list = new ArrayList<>();
//        list.add(generateReadWriteEntity("CC.CC.confirmation", 1));
@@ -500,11 +500,11 @@
                    if (null == twoLoadStation) {
                        //按照尺寸生成二号位上片任务信息
//                        LoadGlassDeviceTask loadTask = loadGlassDeviceTaskService.queryTaskMessage(tableName);
                        S7DataSP loadTask=new S7DataSP();
                        if(stationCell == 5){
                            loadTask=s7SerializerSPOne.read(S7DataSP.class);
                        }else{
                            loadTask=s7SerializerSPTwo.read(S7DataSP.class);
                        S7DataSP loadTask = new S7DataSP();
                        if (stationCell == 5) {
                            loadTask = s7SerializerSPOne.read(S7DataSP.class);
                        } else {
                            loadTask = s7SerializerSPTwo.read(S7DataSP.class);
                        }
                        RawGlassStorageDetails rawDetails = null;
                        if (oneLoadStation.getRemainQuantity() > (loadTask.getTotalCount() + loadTask.getDamageCount())) {
@@ -532,11 +532,11 @@
                        //todo:当二号为的尺寸大于0时,是否执行调度任务,更换当前原片的尺寸,等待下一次任务的直接执行;还是继续等待,当尺寸不一样,等待一号工位的进出库调度任务。
                        if (twoLoadStation.getRemainQuantity() > 0) {
//                            LoadGlassDeviceTask loadTask = loadGlassDeviceTaskService.queryTaskMessage(tableName);
                            S7DataSP loadTask=new S7DataSP();
                            if(stationCell == 5){
                                loadTask=s7SerializerSPOne.read(S7DataSP.class);
                            }else{
                                loadTask=s7SerializerSPTwo.read(S7DataSP.class);
                            S7DataSP loadTask = new S7DataSP();
                            if (stationCell == 5) {
                                loadTask = s7SerializerSPOne.read(S7DataSP.class);
                            } else {
                                loadTask = s7SerializerSPTwo.read(S7DataSP.class);
                            }
                            if (oneLoadStation.getRemainQuantity() > (loadTask.getTotalCount() + loadTask.getDamageCount())) {
                                usageVOS = upListMap.get("2");
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataCC.java
@@ -13,77 +13,77 @@
public class S7DataCC {
//    @S7Variable(address = "DB1.0", type = EDataType.INT16)
//    private Short request;
//    @S7Variable(address = "DB1.0", type = EDataType.UINT16)
//    private Integer request;
//
//    @S7Variable(address = "DB1.2", type = EDataType.INT16)
//    private Short requestId;
//    @S7Variable(address = "DB1.2", type = EDataType.UINT16)
//    private Integer requestId;
//
//    @S7Variable(address = "DB1.4", type = EDataType.INT16)
//    private Short reportWord;
//    @S7Variable(address = "DB1.4", type = EDataType.UINT16)
//    private Integer reportWord;
//
//    @S7Variable(address = "DB1.6", type = EDataType.INT16)
//    private Short reportId;
//    @S7Variable(address = "DB1.6", type = EDataType.UINT16)
//    private Integer reportId;
//
//    @S7Variable(address = "DB1.8", type = EDataType.INT16)
//    private Short inCar;
//    @S7Variable(address = "DB1.8", type = EDataType.UINT16)
//    private Integer inCar;
//
//    @S7Variable(address = "DB1.10", type = EDataType.INT16)
//    private Short taskWord;
//    @S7Variable(address = "DB1.10", type = EDataType.UINT16)
//    private Integer taskWord;
//
//    @S7Variable(address = "DB1.12", type = EDataType.INT16)
//    private Short taskId;
//    @S7Variable(address = "DB1.12", type = EDataType.UINT16)
//    private Integer taskId;
//
//    @S7Variable(address = "DB1.14", type = EDataType.INT16)
//    private Short startSlot;
//    @S7Variable(address = "DB1.14", type = EDataType.UINT16)
//    private Integer startSlot;
//
//    @S7Variable(address = "DB1.16", type = EDataType.INT16)
//    private Short endSlot;
//    @S7Variable(address = "DB1.16", type = EDataType.UINT16)
//    private Integer endSlot;
//
//    @S7Variable(address = "DB1.18", type = EDataType.INT16)
//    private Short taskSending;
//    @S7Variable(address = "DB1.18", type = EDataType.UINT16)
//    private Integer taskSending;
//
//    @S7Variable(address = "DB1.20", type = EDataType.INT16)
//    private Short confirmation;
//    @S7Variable(address = "DB1.20", type = EDataType.UINT16)
//    private Integer confirmation;
//
//    @S7Variable(address = "DB1.22", type = EDataType.INT16)
//    private Short confirmationId;
//    @S7Variable(address = "DB1.22", type = EDataType.UINT16)
//    private Integer confirmationId;
    @S7Variable(address = "DB38.0", type = EDataType.INT16)
    private Short request;
    @S7Variable(address = "DB38.0", type = EDataType.UINT16)
    private Integer request;
    @S7Variable(address = "DB38.2", type = EDataType.INT16)
    private Short requestId;
    @S7Variable(address = "DB38.2", type = EDataType.UINT16)
    private Integer requestId;
    @S7Variable(address = "DB38.10", type = EDataType.INT16)
    private Short reportWord;
    @S7Variable(address = "DB38.10", type = EDataType.UINT16)
    private Integer reportWord;
    @S7Variable(address = "DB38.12", type = EDataType.INT16)
    private Short reportId;
    @S7Variable(address = "DB38.12", type = EDataType.UINT16)
    private Integer reportId;
    @S7Variable(address = "DB38.18", type = EDataType.INT16)
    private Short inCar;
    @S7Variable(address = "DB38.18", type = EDataType.UINT16)
    private Integer inCar;
    @S7Variable(address = "DB38.20", type = EDataType.INT16)
    private Short taskWord;
    @S7Variable(address = "DB38.20", type = EDataType.UINT16)
    private Integer taskWord;
    @S7Variable(address = "DB38.22", type = EDataType.INT16)
    private Short taskId;
    @S7Variable(address = "DB38.22", type = EDataType.UINT16)
    private Integer taskId;
    @S7Variable(address = "DB38.24", type = EDataType.INT16)
    private Short startSlot;
    @S7Variable(address = "DB38.24", type = EDataType.UINT16)
    private Integer startSlot;
    @S7Variable(address = "DB38.26", type = EDataType.INT16)
    private Short endSlot;
    @S7Variable(address = "DB38.26", type = EDataType.UINT16)
    private Integer endSlot;
    @S7Variable(address = "DB38.28", type = EDataType.INT16)
    private Short taskSending;
    @S7Variable(address = "DB38.28", type = EDataType.UINT16)
    private Integer taskSending;
    @S7Variable(address = "DB38.40", type = EDataType.INT16)
    private Short confirmation;
    @S7Variable(address = "DB38.40", type = EDataType.UINT16)
    private Integer confirmation;
    @S7Variable(address = "DB38.42", type = EDataType.INT16)
    private Short confirmationId;
    @S7Variable(address = "DB38.42", type = EDataType.UINT16)
    private Integer confirmationId;
}
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/s7/entity/S7DataSP.java
@@ -13,32 +13,32 @@
public class S7DataSP {
    @S7Variable(address = "DB19.14", type = EDataType.INT16)
    private Short taskState;
    @S7Variable(address = "DB19.14", type = EDataType.UINT16)
    private Integer taskState;
    @S7Variable(address = "DB19.18", type = EDataType.INT16)
    private Short damageCount;
    @S7Variable(address = "DB19.18", type = EDataType.UINT16)
    private Integer damageCount;
    @S7Variable(address = "DB19.20", type = EDataType.INT16)
    private Short rawGlassWidth;
    @S7Variable(address = "DB19.20", type = EDataType.UINT16)
    private Integer rawGlassWidth;
    @S7Variable(address = "DB19.22", type = EDataType.INT16)
    private Short rawGlassHeight;
    @S7Variable(address = "DB19.22", type = EDataType.UINT16)
    private Integer rawGlassHeight;
    @S7Variable(address = "DB19.24", type = EDataType.INT16)
    private Short slot;
    @S7Variable(address = "DB19.24", type = EDataType.UINT16)
    private Integer slot;
    @S7Variable(address = "DB19.26", type = EDataType.INT16)
    private Short totalCount;
    @S7Variable(address = "DB19.26", type = EDataType.UINT16)
    private Integer totalCount;
    @S7Variable(address = "DB19.28", type = EDataType.INT16)
    private Short finishCount;
    @S7Variable(address = "DB19.28", type = EDataType.UINT16)
    private Integer finishCount;
    @S7Variable(address = "DB19.16.0", type = EDataType.BOOL)
    private Boolean taskRunning;
    @S7Variable(address = "DB19.30", type = EDataType.INT16)
    private Short inkageState;
    @S7Variable(address = "DB19.30", type = EDataType.UINT16)
    private Integer inkageState;
}
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -15,13 +15,15 @@
public class S7Config {
    @Bean(name = "s7SerializerSPOne")
    public S7Serializer s7SerializerSPOne() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.15");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.15");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }
    @Bean(name = "s7SerializerSPTwo")
    public S7Serializer s7SerializerSPTwo() {
        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.21");
//        S7PLC s7PLC = new S7PLC(EPlcType.S1200, "192.168.10.21");
        S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191");
        return S7Serializer.newInstance(s7PLC);
    }