#
luxiaotao1123
2022-09-08 e9cdecd287c7ab88ae4b4ad28a9f9343ed9ae23f
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -106,9 +106,9 @@
     * 读取状态 ====> 整块plc
     */
    private void read() throws InterruptedException {
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) 166);
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) 50);
        if (result.IsSuccess) {
            for (int i = 0; i < 83; i++) {
            for (int i = 0; i < 25; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -120,9 +120,9 @@
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 166);
        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 50);
        if (result0.IsSuccess) {
            for (int i = 0; i < 83; i++) {
            for (int i = 0; i < 25; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
@@ -134,9 +134,9 @@
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.0", (short) 166);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.0", (short) 50);
        if (result1.IsSuccess) {
            for (int i = 0; i < 83; i++) {
            for (int i = 0; i < 25; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i*2, 1);
                StaProtocol staProtocol = station.get(siteId);
@@ -238,16 +238,16 @@
    }
    public static void main(String[] args) {
        System.out.println(staNos.indexOf(129));
//        System.out.println(staNos.indexOf(129));
        System.out.println(staNos.size());
        for (int i = 0; i<staNos.size(); i++) {
//            System.out.println(i*2);
//            System.out.println(i*2 + 200);
//            System.out.println(i);
        }
        int index = staNos.indexOf(128);
        System.out.println(index*2);
        System.out.println(index*2 + 200);
//        int index = staNos.indexOf(128);
//        System.out.println(index*2);
//        System.out.println(index*2 + 200);
    }
//    public static void main(String[] args) throws Exception {