野心家
2025-03-20 95cc083ea58c4db51d0b89184c58ad67bc4f3b12
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -48,12 +48,7 @@
    private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
    private short heartBeatVal = 1;
    public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
        add(100);add(101);add(102);add(103);add(104);
        add(105);add(106);add(107);add(108);add(109);
        add(110);add(111);add(112);add(113);add(114);
        add(115);add(116);add(117);add(118);add(119);
        add(120);add(121);add(122);add(123);add(124);
        add(125);add(1001);add(1002);add(1003);add(1004);
        add(100);add(200);
    }};
    /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
        add(200);add(201);add(202);add(203);
@@ -209,7 +204,7 @@
//        updateIoMode();
        ArrayList<Integer> staNos = getStaNo();
        int staNoSize = staNos.size();
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (staNoSize*8));
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB1000.0", (short) (staNoSize*8));
        if (result.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                Integer siteId = staNos.get(i); // 站点编号
@@ -241,9 +236,9 @@
        if (slave.getId() == 1) {
            //条码
            //Thread.sleep(200);
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.848.0", (short) 8);
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB1000.100.0", (short) 16);
            if (result2.IsSuccess) {
                for (int i = 0; i < 1; i++) {
                for (int i = 0; i < 2; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 8, 8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                    if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {