From 7f85ca5468e097f1749ab1ed812046cb8eb979b7 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期日, 27 四月 2025 17:58:48 +0800 Subject: [PATCH] 表阀一体机与测控一体阀协议中的阀门状态不兼容,做兼容处理。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/ProtocolConstantV206V202404.java | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/ProtocolConstantV206V202404.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/ProtocolConstantV206V202404.java new file mode 100644 index 0000000..5d409b6 --- /dev/null +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/ProtocolConstantV206V202404.java @@ -0,0 +1,74 @@ +package com.dy.common.mw.protocol.p206V202404; + +public class ProtocolConstantV206V202404 { + + /** + * 娉ㄨВ鐩稿叧 + */ + public static final String protocolName = "p206V202404" ; + public static final short protocolVer = 201 ; + public static final int priority = 1 ;//浼樺厛绾� + /** + * RTU涓婄嚎鏁版嵁锛堜笂绾垮悗绗竴鍖呮暟鎹級鏈�灏忛暱搴︼紝璁剧疆璇ュ睘鎬т互澶囪繘琛屽畬鏁存�ф鏌ワ紝 + * 鍗虫柇鍖呮鏌ワ紝浣垮敖鍙兘鏀跺叏涓婄嚎鏁版嵁锛堝彇鍊艰寖鍥�1-100锛� + */ + public static final int onLineDataMinLength = 13 ;//閲囩敤蹇冭烦涓婅鏁版嵁闀垮害 + + /** + * RTU涓婃姤鏁版嵁鐨勫ご閮ㄦ渶灏忛暱搴︼紝涓婃姤鏁版嵁涓紝鍙栬繖涓渶灏忛暱搴︾殑閮ㄥ垎鏁版嵁涓紝 + * 瑕佷竴瀹氬寘鍚暟鎹抚闀垮害锛屼互澶囧彇鍑烘暟鎹抚闀垮害鏉ワ紝杩涜瀹屾暣鎬ф鏌ワ紝 + * 鍗虫柇鍖呬笌绮樺寘妫�鏌�(鍙栧�艰寖鍥�0-100锛屽叾涓彇鍊间负0鏃讹紝琛ㄧずheadMinLength鏁版嵁鏃犱綔鐢紝鐢卞崗璁疄鐜版潵鎺у埗) + */ + public static final int headMinLength = 3 ; + + //甯ц捣濮� + public static final byte P_Head_Byte = (byte)0x69 ; + public static final byte P_Tail_Byte = (byte)0x16 ; + + //00H鏃堕仴娴嬬粓绔湪鍏煎宸ヤ綔鐘舵�侊紱01H鏃堕仴娴嬬粓绔湪鑷姤宸ヤ綔鐘舵�侊紱02H鏃堕仴娴嬬粓绔湪鏌ヨ/搴旂瓟宸ヤ綔鐘舵�侊紱03H鏃堕仴娴嬬粓绔湪璋冭瘯/缁翠慨鐘舵�併�� + public static final byte P_Default_mode = (byte)0x00 ;//榛樿宸ヤ綔妯″紡 + + public static final String P_Head_Hex = "69" ; + public static final String P_Tail_Hex = "16" ; + + public static final byte lenHead2ctrl = 3 ; //浠庡ご鍒版帶鍒跺煙锛堜笉鍖呮嫭锛夊瓧鑺傛暟缁勯暱搴� + public static final byte lenHead2Code = 13 ; //浠庡ご鍒板姛鑳界爜锛堝寘鎷級瀛楄妭鏁扮粍闀垮害 + public static final byte lenTail = 2 ; //甯у熬閮ㄥ瓧鑺傛暟缁勯暱搴� + /** + * 鎵�鍦ㄥ瓧鑺傛暟缁勭殑浣嶇疆锛堜笅鏍囷級 + */ + public static final int dataLenIndex = 1 ;//甯ч暱搴︽墍鍦� 瀛楄妭鏁扮粍涓嬫爣 + public static final int ctrlIndex = 3 ;//鎺у埗鍩熸墍鍦ㄥ瓧鑺傛暟缁勪笅鏍� + public static final int rtuAddr1Index_start = 4 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍寮�濮嬩笅鏍� + public static final int rtuAddr1Index_end = 9 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍寮�濮嬩笅鏍� + public static final int rtuAddr2Index_start = 10 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍鎴涓嬫爣 + public static final int rtuAddr2Index_end = 11 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍鎴涓嬫爣 + public static final int codeIndex = 12 ;//鍔熻兘鐮佸瓧鑺傛暟缁勪笅鏍� + public static final int dataIndex = 13 ;//鍏蜂綋鏁版嵁瀛楄妭鏁扮粍涓嬫爣 + + public static final String vsCardAddr = "00000000";//鏈郴缁熷簲鐢ㄧ殑铏氭嫙鍗★紝鍗$墿鐞嗗湴鍧�閲囩敤8涓�0浣滀负妯℃嫙 + + //////////////////////////////////////////////// + // + //杩滅▼鍗囩骇鐩稿叧 + // + //////////////////////////////////////////////// + public static final byte UG_P_Head_Byte = (byte)0xAA ; + public static final byte UG_P_Tail_Byte = (byte)0x16 ; + public static final int UG_codeIndex = 4 ;//鍔熻兘鐮佸瓧鑺傛暟缁勪笅鏍� + public static final int UG_dataIndex = 12 ;//鍏蜂綋鏁版嵁瀛楄妭鏁扮粍涓嬫爣 + + public static final int UG_dataLenIndex_start = 1 ;//甯ч暱搴﹀紑濮嬫墍鍦� 瀛楄妭鏁扮粍璧峰涓嬫爣 + public static final int UG_dataLenIndex_end = 2 ;//甯ч暱搴︾粨鏉熸墍鍦� 瀛楄妭鏁扮粍璧峰涓嬫爣 + + public static final int UG_rtuAddrIndex_start = 6 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍寮�濮嬩笅鏍� + public static final int UG_rtuAddrIndex_end = 11 ;//鎺у埗鍣ㄥ湴鍧� 瀛楄妭鏁扮粍寮�濮嬩笅鏍� + + public static final byte UG_lenCmd = 2 ; //鍔熻兘鐮佸瓧鑺傛暟缁勯暱搴� + public static final byte UG_lenRtuAddr = 6 ; //鍔熻兘鐮佸瓧鑺傛暟缁勯暱搴� + public static final byte UG_lenHead2Cmd = 4 ; //浠庡ご鍒板姛鑳界爜锛堜笉鍖呮嫭锛夊瓧鑺傛暟缁勯暱搴� + public static final byte UG_lenTail = 3 ; //甯у熬閮ㄥ瓧鑺傛暟缁勯暱搴� + public static final byte UG_lenHead2RtuAddr = 12 ; //浠庡ご鍒癛TU鍦板潃锛堝寘鎷級瀛楄妭鏁扮粍闀垮害 + + +} \ No newline at end of file -- Gitblit v1.8.0