1
Administrator
3 天以前 2c9f8abab223d5aa163cae1d733f5ad7957a7b77
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -109,7 +109,7 @@
        byte[] content = result.Content;
        for (int i = 0; i < staNoSize; i++) {
            StaProtocol staProtocol = station.get(staNos.get(staNoSize));
            StaProtocol staProtocol = station.get(staNos.get(i));
            parseStationStatus(content, i, staProtocol);
        }
@@ -134,7 +134,7 @@
     */
    private void parseStationStatus(byte[] content, int index, StaProtocol staProtocol) {
        int offset = index * StationStatusField.ALL.getByteLength();
        staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt32(content, offset));
        staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt32(content, offset + StationStatusField.TASK_NUMBER.getOffset()));
        staProtocol.setStaNo((int) siemensS7Net.getByteTransform().TransInt16(
                content, offset + StationStatusField.FINAL_TARGET.getOffset()));
@@ -244,10 +244,15 @@
                log.warn("站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNosError.get(i));
                continue;
            }
            short i1 = siemensS7Net.getByteTransform().TransInt16(
                    content, 0);
            boolean[] status = siemensS7Net.getByteTransform().TransBool(
                    content, i * DeviceField.DIMENSION_WORD.getByteLength(),
                    DeviceField.DIMENSION_WORD.getByteLength());
                    content, 2+i * DeviceField.DIMENSION_WORD.getByteLength(),
                    1);
            boolean[] status1 = siemensS7Net.getByteTransform().TransBool(
                    content, 2+i * DeviceField.DIMENSION_WORD.getByteLength()+1,
                    1);
            staProtocol.setFrontErr(status[0]);
            staProtocol.setBackErr(status[1]);