1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| package com.ruoyi.fuzhou.utils.rtu;
|
| import com.serotonin.modbus4j.ProcessImageListener;
|
| /**
| * @author zhangyy
| * @date 2025/3/8
| */
| public class MyProcessImageListener implements ProcessImageListener {
|
| @Override
| public void coilWrite(int offset, boolean oldValue, boolean newValue) {
| System.out.println("线圈状态地址=" + offset + ",旧值=" + oldValue + ",新值=" + newValue);
| }
|
| @Override
| public void holdingRegisterWrite(int offset, short oldValue, short newValue) {
| System.out.println("保持寄存器地址=" + offset + ",旧值=" + oldValue + ",新值=" + newValue);
| }
| }
|
|