public final class Modbus extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Modbus.LogLevel
logging.Level wrapper.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ASCII_CODE_COLON |
static int |
ASCII_CODE_CR |
static int |
ASCII_CODE_LF |
static int |
BROADCAST_ID |
static int |
COIL_VALUE_OFF |
static int |
COIL_VALUE_ON |
static int |
DEFAULT_READ_TIMEOUT |
static int |
MAX_CONNECTION_TIMEOUT |
static int |
MAX_FIFO_COUNT |
static int |
MAX_PDU_LENGTH |
static int |
MAX_READ_COIL_COUNT |
static int |
MAX_READ_REGISTER_COUNT |
static int |
MAX_REGISTER_VALUE |
static int |
MAX_RESPONSE_TIMEOUT |
static int |
MAX_RTU_ADU_LENGTH |
static int |
MAX_SERVER_ADDRESS |
static int |
MAX_START_ADDRESS |
static int |
MAX_WRITE_COIL_COUNT |
static int |
MAX_WRITE_REGISTER_COUNT |
static int |
MIN_PDU_LENGTH |
static int |
MIN_SERVER_ADDRESS |
static int |
MIN_START_ADDRESS |
static int |
PROTOCOL_ID |
static int |
TCP_DEFAULT_ID |
static int |
TCP_PORT |
static int |
TRANSACTION_ID_MAX_VALUE |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkEndAddress(int value)
validates end address for read/write
end address = start address + quantity
|
static boolean |
checkReadCoilCount(int value)
validates number of coils for read
|
static boolean |
checkReadRegisterCount(int value)
validates number of registers for read
|
static boolean |
checkRegisterValue(int value)
validates register value
|
static boolean |
checkServerAddress(int serverAddress)
validates address of server
|
static boolean |
checkStartAddress(int value)
validates start address for read/write
|
static boolean |
checkWriteCoilCount(int value)
validates number of coils for write
|
static boolean |
checkWriteRegisterCount(int value)
validates number of registers for write
|
static int |
fromCoil(boolean c)
converts boolean to ON/OFF value
|
static int |
getAsciiMsgDelimiter() |
static Modbus.LogLevel |
getLogLevel()
getter for log level
|
static String |
getVersion()
getter for the version of the library.
|
static boolean |
isAutoIncrementTransactionId()
returns autoIncrementTransactionId variable
|
static boolean |
isLoggingEnabled() |
static Logger |
log()
getter for default logger
|
static void |
setAsciiInputDelimiter(int asciiMsgDelimiter) |
static void |
setAutoIncrementTransactionId(boolean autoIncrementTransactionId)
activates auto increment of TransactionId field. if you do not use ModbusTCP, invocation has no effect.
|
static void |
setLogLevel(Modbus.LogLevel level)
changes the log level for all loggers used
|
static boolean |
toCoil(int s)
converts ON/OFF value to boolean
|
public static final int MAX_CONNECTION_TIMEOUT
public static final int MAX_RESPONSE_TIMEOUT
public static final int MAX_PDU_LENGTH
public static final int MIN_PDU_LENGTH
public static final int MAX_RTU_ADU_LENGTH
public static final int MAX_REGISTER_VALUE
public static final int MIN_START_ADDRESS
public static final int MAX_START_ADDRESS
public static final int MAX_READ_COIL_COUNT
public static final int MAX_WRITE_COIL_COUNT
public static final int MAX_READ_REGISTER_COUNT
public static final int MAX_WRITE_REGISTER_COUNT
public static final int MAX_FIFO_COUNT
public static final int MIN_SERVER_ADDRESS
public static final int MAX_SERVER_ADDRESS
public static final int TCP_PORT
public static final int PROTOCOL_ID
public static final int TCP_DEFAULT_ID
public static final int BROADCAST_ID
public static final int ASCII_CODE_CR
public static final int ASCII_CODE_LF
public static final int ASCII_CODE_COLON
public static final int COIL_VALUE_ON
public static final int COIL_VALUE_OFF
public static final int TRANSACTION_ID_MAX_VALUE
public static final int DEFAULT_READ_TIMEOUT
public static String getVersion()
public static void setAsciiInputDelimiter(int asciiMsgDelimiter)
public static int getAsciiMsgDelimiter()
public static Modbus.LogLevel getLogLevel()
public static void setLogLevel(Modbus.LogLevel level)
level - - LogLevel instanceModbus.LogLevelpublic static boolean isLoggingEnabled()
public static Logger log()
public static boolean toCoil(int s)
s - 0xFF00 of 0x0000public static int fromCoil(boolean c)
c - a coil valuepublic static boolean checkServerAddress(int serverAddress)
serverAddress - - The modbus server addresspublic static boolean checkReadRegisterCount(int value)
value - - register countpublic static boolean checkWriteRegisterCount(int value)
value - - register countpublic static boolean checkReadCoilCount(int value)
value - - coil countpublic static boolean checkWriteCoilCount(int value)
value - - coil countpublic static boolean checkStartAddress(int value)
value - - start addresspublic static boolean checkEndAddress(int value)
value - - end addresspublic static boolean checkRegisterValue(int value)
value - - value of registerpublic static boolean isAutoIncrementTransactionId()
public static void setAutoIncrementTransactionId(boolean autoIncrementTransactionId)
autoIncrementTransactionId - - new value of the autoIncrementTransactionId variableCopyright © 2018. All rights reserved.