From 7559ffe69fdbf3a0224c5abaa867af92d567fc51 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 02 十二月 2024 10:25:42 +0800 Subject: [PATCH] 1、完善代码; 2、补全RTU状态采集(阀门状态)。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_1602_Down.java | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_1602_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_1602_Down.java index 153f46b..941a836 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_1602_Down.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_1602_Down.java @@ -32,7 +32,7 @@ midRs.downCodeName = CodeV2.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�; midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁 midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.hasResponse = true ;//鏄惁鏈夊簲绛� + midRs.hasResponse = false ;//鏄惁鏈夊簲绛� midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆 midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue @@ -70,8 +70,16 @@ index += 2 ; GlCreate.createRtuAddr4PUg(para.rtuAddr, preBytes, index); + if(para.param == null){ + throw new Exception("鍙傛暟涓虹┖") ; + } + Integer ramAddr = (Integer)para.param ; - byte[] bytes = ByteUtil.bytesMerge(preBytes, (byte[])para.attachment) ; + byte[] bs = new byte[4] ; + ByteUtil.int2Bytes_BE(bs, ramAddr, 0); + byte[] bytes = ByteUtil.bytesMerge(preBytes, bs) ; + + bytes = ByteUtil.bytesMerge(bytes, (byte[])para.attachment) ; byte[] bsTail = GlCreate.createCrcTail4Ug(bytes) ;//CRC鍜屽熬鍙犲姞瀛楄妭鏁扮粍涓� -- Gitblit v1.8.0