From 7f983b53f3a8c40678f1a7cb1efaeeb3a32f5377 Mon Sep 17 00:00:00 2001 From: DELL <1525436766@qq.com> Date: 星期四, 10 四月 2025 11:58:57 +0800 Subject: [PATCH] 智能电子锁 V1.107 edit by lijun 2025-04-10 1.基本完成智能电子锁遥信,遥测,遥调,遥控基本功能 --- Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java b/Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java index eb33053..e432556 100644 --- a/Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java +++ b/Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java @@ -9,6 +9,7 @@ public static final int BYTE_LEN = 5; public static final short CMD_TYPE_READ = 0x03; //读 + public static final short CMD_TYPE_READ_INPUT = 0x04; //读输入寄存器 public static final short CMD_TYPE_WRITE_YC = 0x05; public static final short CMD_TYPE_WRITE_STD = 0x06; //单点写入 @@ -70,7 +71,9 @@ if(CMD_TYPE_READ == this.Cmd) { this.data_count = tmpbuf.get()&0xFF; - }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){ + }else if(CMD_TYPE_READ_INPUT == this.Cmd){ + this.data_count = tmpbuf.get()&0xFF; + }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_YC == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){ this.reg_addr = tmpbuf.getShort()&0xFFFF; //寄存器地址 this.result = tmpbuf.getShort()&0xFFFF; -- Gitblit v1.9.1