public interface Modbus
| Modifier and Type | Field and Description |
|---|---|
static int |
COIL_OFF
Defines the byte representation of the coil state pos.
|
static byte[] |
COIL_OFF_BYTES
Defines the word representation of the coil state pos.
|
static int |
COIL_ON
Defines the byte representation of the coil state on.
|
static byte[] |
COIL_ON_BYTES
Defines the word representation of the coil state on.
|
static int |
DEFAULT_PORT
Defines the default port number of Modbus
(=502).
|
static int |
DEFAULT_PROTOCOL_ID
Defines the default protocol identifier (=0).
|
static boolean |
DEFAULT_RECONNECTING
Defines the default reconnecting setting for
transactions (=false).
|
static int |
DEFAULT_RETRIES
Defines the default amount of retires for opening
a connection (=3).
|
static String |
DEFAULT_SERIAL_ENCODING
Defines the default serial encoding (ASCII).
|
static int |
DEFAULT_TIMEOUT
Defines the default setting for I/O operation timeouts
in milliseconds (=3000).
|
static int |
DEFAULT_TRANSACTION_ID
Defines the default transaction identifier (=0).
|
static int |
DEFAULT_TRANSMIT_DELAY
Defines the default number of msec to delay before transmission
Inter-message delays are managed by the SerialTransaction object automatically based on the baud rate. |
static int |
DEFAULT_UNIT_ID
Defines the default unit identifier (=0).
|
static boolean |
DEFAULT_VALIDITYCHECK
Defines the default setting for validity checking
in transactions (=true).
|
static int |
EXCEPTION_OFFSET
Defines the Modbus slave exception offset that is added to the
function code, to flag an exception.
|
static int |
GATEWAY_TARGET_NO_RESPONSE
Defines the Modbus slave exception type Gateway target failed to
respond.
|
static int |
ILLEGAL_ADDRESS_EXCEPTION
Defines the Modbus slave exception type illegal data address.
|
static int |
ILLEGAL_FUNCTION_EXCEPTION
Defines the Modbus slave exception type illegal function.
|
static int |
ILLEGAL_VALUE_EXCEPTION
Defines the Modbus slave exception type illegal data value.
|
static double |
INTER_CHARACTER_GAP
The number of characters delay that is the allowed maximum between characters on
the same serial port (within the same transaction)
|
static double |
INTER_MESSAGE_GAP
The number of characters delay that must be maintained between adjacent requests on
the same serial port (within the same transaction)
|
static int |
MASK_WRITE_REGISTER
mask write register
Update a single register using its current value and an AND
and OR mask.
|
static int |
MAX_BITS
Defines the maximum number of bits in multiple read/write
of input discretes or coils (2000).
|
static int |
MAX_MESSAGE_LENGTH
Defines the maximum message length in bytes
(=256).
|
static int |
MAX_TRANSACTION_ID
Defines the maximum value of the transaction identifier.
|
static int |
MINIMUM_TRANSMIT_DELAY
Defines the default number of msec to delay before transmission if not overridden by DEFAULT_TRANSMIT_DELAY
(=2).
|
static int |
NEGATIVE_ACKNOWLEDGEMENT
Defines the Modbus slave exception type negative acknowledgment.
|
static int |
READ_COILS
Defines the class 1 function code
for read coils.
|
static int |
READ_COMM_EVENT_COUNTER
get comm event counter
Serial devices only.
|
static int |
READ_COMM_EVENT_LOG
get comm event log
Serial devices only.
|
static int |
READ_EXCEPTION_STATUS
read exception status
Serial devices only.
|
static int |
READ_FIFO_QUEUE
read FIFO queue
Read from a FIFO queue.
|
static int |
READ_FILE_RECORD
read file record
|
static int |
READ_HOLDING_REGISTERS
Defines a class 1 function code
for read holding registers
|
static int |
READ_INPUT_DISCRETES
Defines a class 1 function code
for read input discretes.
|
static int |
READ_INPUT_REGISTERS
Defines a class 1 function code
for read input registers.
|
static int |
READ_MEI
Defines the function code for reading
encapsulated data, such as vendor information.
|
static int |
READ_MEI_VENDOR_INFO |
static int |
READ_MULTIPLE_REGISTERS
Defines the class 0 function code
for read multiple registers.
|
static int |
READ_SERIAL_DIAGNOSTICS
get serial diagnostics
Serial devices only.
|
static int |
READ_WRITE_MULTIPLE
read / write multiple registers
Write some number of registers, then read some number of
potentially other registers back.
|
static int |
REPORT_SLAVE_ID
Defines a standard function code
for read slave ID.
|
static int |
RETRY_SLEEP_TIME
Defines the sleep period between transaction retries
in milliseconds (=200).
|
static String |
SERIAL_ENCODING_ASCII
Defines the serial encoding "ASCII".
|
static String |
SERIAL_ENCODING_RTU
Defines the serial encoding "RTU".
|
static int |
SLAVE_BUSY_EXCEPTION
Defines the Modbus slave exception type slave busy.
|
static int |
SLAVE_DEVICE_FAILURE
Defines the Modbus slave exception type slave device failure.
|
static int |
WRITE_COIL
Defines a class 1 function code
for write coil.
|
static int |
WRITE_FILE_RECORD
write file record
|
static int |
WRITE_MULTIPLE_COILS
Defines a standard function code
for write multiple coils.
|
static int |
WRITE_MULTIPLE_REGISTERS
Defines the class 0 function code
for write multiple registers.
|
static int |
WRITE_SINGLE_REGISTER
Defines a class 1 function code
for write single register.
|
static final int READ_COILS
static final int READ_INPUT_DISCRETES
static final int READ_HOLDING_REGISTERS
static final int READ_MULTIPLE_REGISTERS
static final int READ_INPUT_REGISTERS
static final int WRITE_COIL
static final int WRITE_SINGLE_REGISTER
static final int READ_EXCEPTION_STATUS
static final int READ_SERIAL_DIAGNOSTICS
static final int READ_COMM_EVENT_COUNTER
static final int READ_COMM_EVENT_LOG
static final int WRITE_MULTIPLE_COILS
static final int WRITE_MULTIPLE_REGISTERS
static final int REPORT_SLAVE_ID
static final int READ_FILE_RECORD
static final int WRITE_FILE_RECORD
static final int MASK_WRITE_REGISTER
static final int READ_WRITE_MULTIPLE
static final int READ_FIFO_QUEUE
static final int READ_MEI
static final int READ_MEI_VENDOR_INFO
static final int COIL_ON
static final int COIL_OFF
static final byte[] COIL_ON_BYTES
static final byte[] COIL_OFF_BYTES
static final int MAX_BITS
static final int EXCEPTION_OFFSET
static final int ILLEGAL_FUNCTION_EXCEPTION
static final int ILLEGAL_ADDRESS_EXCEPTION
static final int ILLEGAL_VALUE_EXCEPTION
static final int SLAVE_DEVICE_FAILURE
static final int SLAVE_BUSY_EXCEPTION
static final int NEGATIVE_ACKNOWLEDGEMENT
static final int GATEWAY_TARGET_NO_RESPONSE
static final int DEFAULT_PORT
static final int MAX_MESSAGE_LENGTH
static final int DEFAULT_TRANSACTION_ID
static final int DEFAULT_PROTOCOL_ID
static final int DEFAULT_UNIT_ID
static final boolean DEFAULT_VALIDITYCHECK
static final int DEFAULT_TIMEOUT
static final int RETRY_SLEEP_TIME
static final boolean DEFAULT_RECONNECTING
static final int DEFAULT_RETRIES
static final int DEFAULT_TRANSMIT_DELAY
static final int MINIMUM_TRANSMIT_DELAY
static final double INTER_MESSAGE_GAP
static final double INTER_CHARACTER_GAP
static final int MAX_TRANSACTION_ID
Note: The standard requires that the server copy whatever value the client provides. However, the transaction ID is being limited to signed 16-bit integers to prevent problems with servers that might incorrectly assume the value is a signed value.
static final String SERIAL_ENCODING_ASCII
static final String SERIAL_ENCODING_RTU
static final String DEFAULT_SERIAL_ENCODING
Copyright © 2025. All Rights Reserved.