ZengTao
2024-01-23 3d1b968fdd97ac107d98404ec37d693b964cda07
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -122,36 +122,38 @@
            // List<Short> listd17 = S7control.getinstance().ReadWord("DB17.0",10);
            // String id=spianService.queGlassid("DB17.10", 14).toString();
            //
            // // 铝框线交互
            // try {
            // if (CurrentFrame != null) {
            // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
            // }
            // List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
            // for (Short framerequest : framerequests) {
            // if (framerequest == 1) {
            // // 铝框id
            // String franmeno = spianService.queGlassid("DB17.10", 14).toString();
            // String position;
            // try {
            // position = dbserve.SelectPositionByFrameBarcode(franmeno);
            // } catch (SQLException e) {
            // // TODO Auto-generated catch block
            // position = "0";
            // e.printStackTrace();
            // }
            // Short send;
            // if (position == "0") {
            // send = 0;
            // } else {
            // send = 1;
            // }
            // S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
            // }
            // }
            // } catch (Exception e) {
            // // TODO: handle exception
            // }
            // 铝框线交互
            try {
                if (CurrentFrame != null) {
                    spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
                }
                List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
                for (Short framerequest : framerequests) {
                    if (framerequest == 1) {
                        // 铝框id
                        String franmeno = spianService.queGlassid("DB17.10", 14).toString();
                        String position;
                        try {
                            position = dbserve.SelectPositionByFrameBarcode(franmeno);
                        } catch (SQLException e) {
                            // TODO Auto-generated catch block
                            position = "0";
                            e.printStackTrace();
                        }
                        Short send;
                        if (position == "0") {
                            send = 0;
                        } else {
                            send = 1;
                        }
                        S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
                    }
                }
            } catch (Exception e) {
                // TODO: handle exception
            }
            if (S7control.getinstance().CheckConnected() == true) {
                // 获取当前扫码方式