自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-08-14 81ac3e075484e2594d14aefa5848e9dbd2d87c1e
#
3个文件已修改
20 ■■■■■ 已修改文件
src/main/java/com/zy/core/thread/BarcodeThread.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/DevpThread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/BarcodeThread.java
@@ -38,7 +38,9 @@
            try {
                write("T".getBytes(), "T".length());
                byte[] read = read(11, 1000);
                barcode = new String(read);
                if (null != read) {
                    barcode = new String(read);
                }
                Thread.sleep(1000);
            } catch (Exception e) {
                e.printStackTrace();
@@ -85,13 +87,17 @@
    }
    public void write(byte[] msg, int len) throws IOException {
        log.trace("dataOutputStream.write");
        dataOutputStream.write(msg, 0, len);
        log.trace("dataOutputStream.flush");
        dataOutputStream.flush();
        if (null != dataInputStream)
        {
            dataOutputStream.write(msg, 0, len);
            dataOutputStream.flush();
        }
    }
    public byte[] read(int bufferSize, int timeOut) throws IOException {
        if (socket == null) {
            return null;
        }
        socket.setSoTimeout(timeOut * 1000);
        byte[] bytes = new byte[bufferSize];
        log.trace("dataInputStream.read");
src/main/java/com/zy/core/thread/DevpThread.java
@@ -75,7 +75,7 @@
            result = true;
            log.info("输送线plc连接成功 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
        } else {
            log.info("输送线plc连接失败!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
            log.error("输送线plc连接失败!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
        }
        siemensS7Net.ConnectClose();
        return result;
src/main/resources/application.yml
@@ -59,7 +59,7 @@
  # 输送线
  devp[0]:
    id: 1
    ip: 192.168.1.125
    ip: 192.168.2.125
    port: 102
    rack: 0
    slot: 1