严智鑫
2025-06-13 d14cdaf28222bfef468185e34de7c823f1436b19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.mes.connect.IndustrialInterface;
 
import java.io.IOException;
 
/**
 * 工业通信统一接口 - 客户端模式
 */
public interface IndustrialClient extends AutoCloseable {
    void connect() throws IOException;
    void disconnect();
    boolean isConnected();
    
    // 数据读写方法
    boolean readBit(String address) throws IOException;
    void writeBit(String address, boolean value) throws IOException;
    int readRegister(String address) throws IOException;
    void writeRegister(String address, int value) throws IOException;
    int[] readRegisters(String address, int quantity) throws IOException;
    void writeRegisters(String address, int[] values) throws IOException;
    float readFloat(String address) throws IOException;
    void writeFloat(String address, float value) throws IOException;
    String readString(String address, int length) throws IOException;
    void writeString(String address, String value) throws IOException;
    
    @Override
    void close() throws IOException;
}