Procházet zdrojové kódy

与西门子S-1500对接数据,触发下料和补空托接口

LZH před 1 rokem
rodič
revize
6a3c1bc069

+ 481 - 0
warewms-ams/src/main/java/com/ruoyi/ams/MaGang02/service/PlcCallAgvService.java

@@ -0,0 +1,481 @@
+package com.ruoyi.ams.MaGang02.service;
+
+import com.ruoyi.ams.business.IBusinessService;
+import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
+import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
+import com.ruoyi.ams.config.domain.dto.LotattDTO;
+import com.ruoyi.ams.task.domain.WcsTask;
+import com.ruoyi.ams.task.mapper.WcsTaskMapper;
+import com.ruoyi.base.constant.Constant;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.hard.plc.PlcService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Jwk
+ * @version 1.0
+ * @date 2023/5/30 21:04
+ */
+@Service
+public class PlcCallAgvService {
+    @Autowired
+    PlcService plcService;
+    @Autowired
+    private IBusinessService iBusinessService;
+    @Autowired
+    private WcsTaskMapper wcsTaskMapper;
+
+    /**
+     * 合格品左请求上空托
+     *
+     * @return
+     */
+    public AjaxResult readTheEmptyPalletOnThequalifiedLeft() {
+        boolean b = PlcService.plcDateReading10();
+        if (b) {
+            String locationFrom = "";
+            String locationTo = "100001";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationTo(locationTo);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            LotattDTO lotattDTO = new LotattDTO();
+            agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.ONE.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedProductLeftSky();
+            }
+        }
+        return AjaxResult.success();
+    }
+
+
+    /**
+     * 测试合格品左请求上空托
+     *
+     * @return
+     */
+    public AjaxResult readTheEmptyPalletOnThequalifiedLeftTest() {
+        if (1 == 1) {
+            String locationFrom = "";
+            String locationTo = "100001";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationTo(locationTo);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.ONE.getValue(), agvCallDTO);
+            System.out.println("合格品左正在上空托");
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 测试合格品左请求下料
+     *
+     * @return
+     */
+    public AjaxResult readThepassedProductLowerFeeLeftTest() {
+            String locationFrom = "100001";
+            String locationTo = "";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationFrom(locationFrom);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            //库存列表
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            LotattDTO lotattDTO = new LotattDTO();
+            agvCallItemDTO.setSku("sku001"); // 合格品
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.FIVE.getValue(), agvCallDTO);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 合格品右请求上空托
+     *
+     * @return
+     */
+    public AjaxResult readTheEmptyPalletOnThequalifiedRight() {
+        boolean b = PlcService.plcDateReading11();
+        if (b) {
+            String locationFrom = "";
+            String locationTo = "100003";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationTo(locationTo);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            LotattDTO lotattDTO = new LotattDTO();
+            agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.TWO.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedProductRightSky();
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 不合格品左请求上空托
+     *
+     * @return
+     */
+    public AjaxResult readTheEmptyPalletOnTheNoqualifiedLeft() {
+        boolean b = PlcService.plcDateReading12();
+        if (b) {
+            String locationFrom = "";
+            String locationTo = "100000";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationTo(locationTo);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            LotattDTO lotattDTO = new LotattDTO();
+            agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.THREE.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedNoProductLeftSky();
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 不合格品右请求上空托
+     *
+     * @return
+     */
+    public AjaxResult readTheEmptyPalletOnTheNoqualifiedRight() {
+        boolean b = PlcService.plcDateReading13();
+        if (b) {
+            String locationFrom = "";
+            String locationTo = "100002";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationTo(locationTo);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+            LotattDTO lotattDTO = new LotattDTO();
+            agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
+            agvCallItemDTO.setQty(1.0);
+            agvCallItemDTOList.add(agvCallItemDTO);
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.FOUR.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedNoProductRightSky();
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 合格品左请求下料
+     *
+     * @return
+     */
+    public AjaxResult readThepassedProductLowerFeeLeft() {
+        boolean b = PlcService.plcDateReading14();
+        if (b) {
+            String locationFrom = "100001";
+            String locationTo = "";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationFrom(locationFrom);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            Integer integer = PlcService.plcDateReading18();
+            //库存列表
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            for (int i = 0; i < integer; i++) {
+                //单个库存
+                AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+                LotattDTO lotattDTO = new LotattDTO();
+                agvCallItemDTO.setSku("sku001"); // 合格品
+                agvCallItemDTO.setQty(1.0);
+                Integer integer1 = PlcService.plcDateReading18_1();
+                Integer integer2 = PlcService.plcDateReading18_2();
+                Integer integer3 = PlcService.plcDateReading18_3();
+                Integer integer4 = PlcService.plcDateReading18_4();
+                Integer integer5 = PlcService.plcDateReading18_5();
+                if (i == 0){
+                    lotattDTO.setLotatt01(integer1.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 1){
+                    lotattDTO.setLotatt01(integer2.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 2){
+                    lotattDTO.setLotatt01(integer3.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 3){
+                    lotattDTO.setLotatt01(integer4.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 4){
+                    lotattDTO.setLotatt01(integer5.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                agvCallItemDTOList.add(agvCallItemDTO);
+            }
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.FIVE.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedProductLeftBlanking();
+            }
+        }
+            return AjaxResult.success();
+        }
+
+
+        /**
+         * 合格品右请求下料
+         * @return
+         */
+        public AjaxResult readThepassedProductLowerFeeRight () {
+            boolean b = PlcService.plcDateReading15();
+            if (b) {
+                String locationFrom = "100003";
+                String locationTo = "";
+                WcsTask wcsTask = new WcsTask();
+                wcsTask.setLocationFrom(locationFrom);
+                List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+                if (wcsTasks.size()>0 && wcsTasks!= null){
+                    return AjaxResult.error("已经有正在进行的任务了");
+                }
+                Integer integer = PlcService.plcDateReading19();
+                //库存列表
+                List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+                for (int i = 0; i < integer; i++) {
+                    //单个库存
+                    AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+                    LotattDTO lotattDTO = new LotattDTO();
+                    agvCallItemDTO.setSku("sku001"); // 合格品
+                    agvCallItemDTO.setQty(1.0);
+                    Integer integer1 = PlcService.plcDateReading19_1();
+                    Integer integer2 = PlcService.plcDateReading19_2();
+                    Integer integer3 = PlcService.plcDateReading19_3();
+                    Integer integer4 = PlcService.plcDateReading19_4();
+                    Integer integer5 = PlcService.plcDateReading19_5();
+                    if (i == 0){
+                        lotattDTO.setLotatt01(integer1.toString());
+                        agvCallItemDTO.setLotattDTO(lotattDTO);
+                    }
+                    if (i == 1){
+                        lotattDTO.setLotatt01(integer2.toString());
+                        agvCallItemDTO.setLotattDTO(lotattDTO);
+                    }
+                    if (i == 2){
+                        lotattDTO.setLotatt01(integer3.toString());
+                        agvCallItemDTO.setLotattDTO(lotattDTO);
+                    }
+                    if (i == 3){
+                        lotattDTO.setLotatt01(integer4.toString());
+                        agvCallItemDTO.setLotattDTO(lotattDTO);
+                    }
+                    if (i == 4){
+                        lotattDTO.setLotatt01(integer5.toString());
+                        agvCallItemDTO.setLotattDTO(lotattDTO);
+                    }
+                    agvCallItemDTOList.add(agvCallItemDTO);
+                }
+                AgvCallDTO agvCallDTO = new AgvCallDTO();
+                agvCallDTO.setLocationFrom(locationFrom);
+                agvCallDTO.setLocationTo(locationTo);
+                agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+                AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.SIX.getValue(), agvCallDTO);
+                if (ajaxResult.isSuccess()){
+                    PlcService.plcWritepassedProductRightBlanking();
+                }
+            }
+            return AjaxResult.success();
+        }
+
+    /**
+     * 不合格品左请求下料
+     * @return
+     */
+    public AjaxResult readThepassedNoProductLowerFeeLeft () {
+        boolean b = PlcService.plcDateReading16();
+        if (b) {
+            String locationFrom = "100000";
+            String locationTo = "";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationFrom(locationFrom);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            Integer integer = PlcService.plcDateReading20();
+            //库存列表
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            for (int i = 0; i < integer; i++) {
+                //单个库存
+                AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+                LotattDTO lotattDTO = new LotattDTO();
+                agvCallItemDTO.setSku("sku002"); // 不合格品
+                agvCallItemDTO.setQty(1.0);
+                Integer integer1 = PlcService.plcDateReading20_1();
+                Integer integer2 = PlcService.plcDateReading20_2();
+                Integer integer3 = PlcService.plcDateReading20_3();
+                Integer integer4 = PlcService.plcDateReading20_4();
+                Integer integer5 = PlcService.plcDateReading20_5();
+                if (i == 0){
+                    lotattDTO.setLotatt01(integer1.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 1){
+                    lotattDTO.setLotatt01(integer2.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 2){
+                    lotattDTO.setLotatt01(integer3.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 3){
+                    lotattDTO.setLotatt01(integer4.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 4){
+                    lotattDTO.setLotatt01(integer5.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                agvCallItemDTOList.add(agvCallItemDTO);
+            }
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.SEVEN.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedNoProductLeftBlanking();
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 不合格品右请求下料
+     * @return
+     */
+    public AjaxResult readThepassedNoProductLowerFeeRight () {
+        boolean b = PlcService.plcDateReading17();
+        if (b) {
+            String locationFrom = "100002";
+            String locationTo = "";
+            WcsTask wcsTask = new WcsTask();
+            wcsTask.setLocationFrom(locationFrom);
+            List<WcsTask> wcsTasks = wcsTaskMapper.selectWcsTaskList1(wcsTask);
+            if (wcsTasks.size()>0 && wcsTasks!= null){
+                return AjaxResult.error("已经有正在进行的任务了");
+            }
+            Integer integer = PlcService.plcDateReading21();
+            //库存列表
+            List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+            for (int i = 0; i < integer; i++) {
+                //单个库存
+                AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+                LotattDTO lotattDTO = new LotattDTO();
+                agvCallItemDTO.setSku("sku002"); // 不合格品
+                agvCallItemDTO.setQty(1.0);
+                Integer integer1 = PlcService.plcDateReading21_1();
+                Integer integer2 = PlcService.plcDateReading21_2();
+                Integer integer3 = PlcService.plcDateReading21_3();
+                Integer integer4 = PlcService.plcDateReading21_4();
+                Integer integer5 = PlcService.plcDateReading21_5();
+                if (i == 0){
+                    lotattDTO.setLotatt01(integer1.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 1){
+                    lotattDTO.setLotatt01(integer2.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 2){
+                    lotattDTO.setLotatt01(integer3.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 3){
+                    lotattDTO.setLotatt01(integer4.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                if (i == 4){
+                    lotattDTO.setLotatt01(integer5.toString());
+                    agvCallItemDTO.setLotattDTO(lotattDTO);
+                }
+                agvCallItemDTOList.add(agvCallItemDTO);
+            }
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(locationFrom);
+            agvCallDTO.setLocationTo(locationTo);
+            agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+            AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.EIGHT.getValue(), agvCallDTO);
+            if (ajaxResult.isSuccess()){
+                PlcService.plcWritepassedNoProductRightBlanking();
+            }
+        }
+        return AjaxResult.success();
+    }
+}

+ 25 - 0
warewms-hard/src/main/java/com/ruoyi/hard/plc/PlcDataThread.java

@@ -0,0 +1,25 @@
+package com.ruoyi.hard.plc;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author Jwk
+ * @version 1.0
+ * @date 2023/5/29 15:58
+ */
+@Slf4j
+public class PlcDataThread implements Runnable{
+
+    @Override
+    public void run() {
+        log.info("PLC数据块读取开始--------");
+        while (1 == 1) {
+            try{
+                PlcService.plcDateReading();
+                Thread.sleep(5000);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 789 - 0
warewms-hard/src/main/java/com/ruoyi/hard/plc/PlcService.java

@@ -0,0 +1,789 @@
+package com.ruoyi.hard.plc;
+
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Jwk
+ * @version 1.0
+ * @date 2023/5/29 15:54
+ */
+@Slf4j
+@Service
+public class PlcService {
+
+
+
+    /**
+     * 读心跳
+     * @return
+     */
+    public static boolean plcDateReading(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.0");
+        System.out.println("心跳状态为"+bool);
+        return bool;
+    }
+
+    /**
+     * 读急停
+     * @return
+     */
+    public static boolean plcDateReading1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.1");
+        System.out.println("急停状态为"+bool);
+        return bool;
+    }
+
+    /**
+     * 读系统状态(是否Ready)
+     * @return
+     */
+    public static boolean plcDateReading2(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.2");
+        System.out.println(bool);
+        return bool;
+    }
+
+    /**
+     * 读下料系统故障信号
+     * @return
+     */
+    public static boolean plcDateReading3(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.3");
+        return bool;
+    }
+
+    /**
+     * 读区域安全(合格品移动平台停止位)
+     * @return
+     */
+    public static boolean plcDateReading4(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.4");
+        return bool;
+    }
+
+    /**
+     * 读区域安全(不合格平移动平台停止位)
+     * @return
+     */
+    public static boolean plcDateReading5(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.5");
+        return bool;
+    }
+
+    /**
+     * 读合格品移动左侧围
+     * @return
+     */
+    public static boolean plcDateReading6(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.6");
+        return bool;
+    }
+
+    /**
+     * 读合格品移动右侧位
+     * @return
+     */
+    public static boolean plcDateReading7(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.0.7");
+        return bool;
+    }
+
+    /**
+     * 读不合格品移动左侧位
+     * @return
+     */
+    public static boolean plcDateReading8(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.1.0");
+        return bool;
+    }
+
+    /**
+     * 读不合格品移动右侧位
+     * @return
+     */
+    public static boolean plcDateReading9(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.1.1");
+        return bool;
+    }
+
+    /**
+     * 读合格品左请求上空托
+     * @return
+     */
+    public static boolean plcDateReading10(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.0");
+        return bool;
+    }
+
+    /**
+     * 读合格品右请求上空托
+     * @return
+     */
+    public static boolean plcDateReading11(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.1");
+        return bool;
+    }
+
+    /**
+     * 读不合格品左请求上空托
+     * @return
+     */
+    public static boolean plcDateReading12(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.2");
+        return bool;
+    }
+
+    /**
+     * 读不合格品右请求上空托
+     * @return
+     */
+    public static boolean plcDateReading13(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.3");
+        return bool;
+    }
+
+    /**
+     * 读合格品左请求下料
+     * @return
+     */
+    public static boolean plcDateReading14(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.4");
+        return bool;
+    }
+
+    /**
+     * 读合格品右请求下料
+     * @return
+     */
+    public static boolean plcDateReading15(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.5");
+        return bool;
+    }
+
+    /**
+     * 读不合格品左请求下料
+     * @return
+     */
+    public static boolean plcDateReading16(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.6");
+        return bool;
+    }
+
+    /**
+     * 读不合格品右请求下料
+     * @return
+     */
+    public static boolean plcDateReading17(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean bool = hslTools.getBool("DB11.2.7");
+        return bool;
+    }
+
+    /**
+     * 读合格品左侧车轮数量
+     * @return
+     */
+    public static Integer plcDateReading18(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.4.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品左侧下料车轮1(ID)
+     * @return
+     */
+    public static Integer plcDateReading18_1(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.8.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品左侧下料车轮2(ID)
+     * @return
+     */
+    public static Integer plcDateReading18_2(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.12.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品左侧下料车轮3(ID)
+     * @return
+     */
+    public static Integer plcDateReading18_3(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.16.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品左侧下料车轮4(ID)
+     * @return
+     */
+    public static Integer plcDateReading18_4(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.20.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品左侧下料车轮5(ID)
+     * @return
+     */
+    public static Integer plcDateReading18_5(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.24.0");
+        System.out.println(anInt);
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧车轮数量
+     * @return
+     */
+    public static Integer plcDateReading19(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.28.0");
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧下料车轮1(ID)
+     * @return
+     */
+    public static Integer plcDateReading19_1(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.32.0");
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧下料车轮2(ID)
+     * @return
+     */
+    public static Integer plcDateReading19_2(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.36.0");
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧下料车轮3(ID)
+     * @return
+     */
+    public static Integer plcDateReading19_3(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.40.0");
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧下料车轮4(ID)
+     * @return
+     */
+    public static Integer plcDateReading19_4(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.44.0");
+        return anInt;
+    }
+
+    /**
+     * 读合格品右侧下料车轮5(ID)
+     * @return
+     */
+    public static Integer plcDateReading19_5(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.48.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧车轮数量
+     * @return
+     */
+    public static Integer plcDateReading20(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.52.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧下料车轮1(ID)
+     * @return
+     */
+    public static Integer plcDateReading20_1(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.56.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧下料车轮2(ID)
+     * @return
+     */
+    public static Integer plcDateReading20_2(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.60.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧下料车轮3(ID)
+     * @return
+     */
+    public static Integer plcDateReading20_3(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.64.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧下料车轮4(ID)
+     * @return
+     */
+    public static Integer plcDateReading20_4(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.68.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品左侧下料车轮5(ID)
+     * @return
+     */
+    public static Integer plcDateReading20_5(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.72.0");
+        return anInt;
+    }
+
+
+    /**
+     * 读不合格品右侧车轮数量
+     * @return
+     */
+    public static Integer plcDateReading21(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.76.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品右侧下料车轮1(ID)
+     * @return
+     */
+    public static Integer plcDateReading21_1(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.80.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品右侧下料车轮2(ID)
+     * @return
+     */
+    public static Integer plcDateReading21_2(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.84.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品右侧下料车轮3(ID)
+     * @return
+     */
+    public static Integer plcDateReading21_3(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.88.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品右侧下料车轮4(ID)
+     * @return
+     */
+    public static Integer plcDateReading21_4(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.92.0");
+        return anInt;
+    }
+
+    /**
+     * 读不合格品右侧下料车轮5(ID)
+     * @return
+     */
+    public static Integer plcDateReading21_5(){
+        HslTools hslTools = HslTools.getInstance();
+        int anInt = hslTools.getInt("DB11.96.0");
+        return anInt;
+    }
+
+    /**
+     * 写系统正常
+     * @return
+     */
+    public static boolean plcWriteNormal(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.2", true);
+        return b;
+    }
+
+    /**
+     * 写系统不正常
+     * @return
+     */
+    public static boolean plcWriteNormal1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.2", false);
+        return b;
+    }
+
+    /**
+     * 写合格品左正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftSky(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.3", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品左正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftSky1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.3", false);
+        return b;
+    }
+
+    /**
+     * 写合格品右正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedProductRightSky(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.4", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品右正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedProductRightSky1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.4", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品左正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftSky(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.5", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品左正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftSky1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.5", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品右正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightSky(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.6", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品右正在上空托
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightSky1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.6", false);
+        return b;
+    }
+
+    /**
+     * 写合格品左正在下料
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftBlanking(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.7", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品左正在下料
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftBlanking1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.0.7", false);
+        return b;
+    }
+
+    /**
+     * 写合格品右正在下料
+     * @return
+     */
+    public static boolean plcWritepassedProductRightBlanking(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.0", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品右正在下料
+     * @return
+     */
+    public static boolean plcWritepassedProductRightBlanking1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.0", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品左正在下料
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftBlanking(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.1", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品左正在下料
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftBlanking1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.1", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品右正在下料
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightBlanking(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.2", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品右正在下料
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightBlanking1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.2", false);
+        return b;
+    }
+
+    /**
+     * 写合格品左上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftSkyEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.3", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品左上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftSkyEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.3", false);
+        return b;
+    }
+
+    /**
+     * 写合格品右上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedProductRightSkyEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.4", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品右上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedProductRightSkyEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.4", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品左上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftSkyEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.5", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品左上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftSkyEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.5", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品右上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightSkyEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.6", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品右上空托结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightSkyEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.6", false);
+        return b;
+    }
+
+    /**
+     * 写合格品左下料结束
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftBlankingEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.7", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品左下料结束
+     * @return
+     */
+    public static boolean plcWritepassedProductLeftBlankingEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.1.7", false);
+        return b;
+    }
+
+    /**
+     * 写合格品右下料结束
+     * @return
+     */
+    public static boolean plcWritepassedProductRightBlankingEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.0", true);
+        return b;
+    }
+
+    /**
+     * 取消写合格品右下料结束
+     * @return
+     */
+    public static boolean plcWritepassedProductRightBlankingEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.0", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品左下料结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftBlankingEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.1", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品左下料结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductLeftBlankingEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.1", false);
+        return b;
+    }
+
+    /**
+     * 写不合格品右下料结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightBlankingEnd(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.2", true);
+        return b;
+    }
+
+    /**
+     * 取消写不合格品右下料结束
+     * @return
+     */
+    public static boolean plcWritepassedNoProductRightBlankingEnd1(){
+        HslTools hslTools = HslTools.getInstance();
+        boolean b = hslTools.writeBoolean("DB12.2.2", false);
+        return b;
+    }
+
+}