public enum ModbusFunctionCode extends Enum<ModbusFunctionCode>
01 (0x01) Read Coils 02 (0x02) Read Discrete Inputs 03 (0x03) Read Holding Registers 04 (0x04) Read Input Registers 05 (0x05) Write Single Coil 06 (0x06) Write Single Register 07 (0x07) Read Exception Status (Serial Line only) 08 (0x08) Diagnostics (Serial Line only) 11 (0x0B) Get Comm Event Counter (Serial Line only) 12 (0x0C) Get Comm Event Log (Serial Line only) 15 (0x0F) Write Multiple Coils 16 (0x10) Write Multiple registers 17 (0x11) Report Slave ID (Serial Line only) 20 (0x14) Read File Record 21 (0x15) Write File Record 22 (0x16) Mask Write Register 23 (0x17) Read/Write Multiple registers 24 (0x18) Read FIFO Queue 43 ( 0x2B) Encapsulated Interface Transport 43 / 13 (0x2B / 0x0D) CAN open General Reference Request and Response PDU 43 / 14 (0x2B / 0x0E) Read Device Identification
| Enum Constant and Description |
|---|
DIAGNOSTICS |
ENCAPSULATED_INTERFACE_TRANSPORT |
GET_COMM_EVENT_COUNTER |
GET_COMM_EVENT_LOG |
MASK_WRITE_REGISTER |
READ_COILS |
READ_DISCRETE_INPUTS |
READ_EXCEPTION_STATUS |
READ_FIFO_QUEUE |
READ_FILE_RECORD |
READ_HOLDING_REGISTERS |
READ_INPUT_REGISTERS |
READ_WRITE_MULTIPLE_REGISTERS |
REPORT_SLAVE_ID |
UNKNOWN
this function code is not presented in the modbus protocol specification.
|
WRITE_FILE_RECORD |
WRITE_MULTIPLE_COILS |
WRITE_MULTIPLE_REGISTERS |
WRITE_SINGLE_COIL |
WRITE_SINGLE_REGISTER |
| Modifier and Type | Method and Description |
|---|---|
static ModbusFunctionCode |
get(int value) |
static int |
getExceptionValue(int functionCode) |
static boolean |
isException(int value) |
int |
toInt() |
String |
toString() |
static ModbusFunctionCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ModbusFunctionCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ModbusFunctionCode READ_COILS
public static final ModbusFunctionCode READ_DISCRETE_INPUTS
public static final ModbusFunctionCode READ_HOLDING_REGISTERS
public static final ModbusFunctionCode READ_INPUT_REGISTERS
public static final ModbusFunctionCode WRITE_SINGLE_COIL
public static final ModbusFunctionCode WRITE_SINGLE_REGISTER
public static final ModbusFunctionCode READ_EXCEPTION_STATUS
public static final ModbusFunctionCode DIAGNOSTICS
public static final ModbusFunctionCode GET_COMM_EVENT_COUNTER
public static final ModbusFunctionCode GET_COMM_EVENT_LOG
public static final ModbusFunctionCode WRITE_MULTIPLE_COILS
public static final ModbusFunctionCode WRITE_MULTIPLE_REGISTERS
public static final ModbusFunctionCode REPORT_SLAVE_ID
public static final ModbusFunctionCode READ_FILE_RECORD
public static final ModbusFunctionCode WRITE_FILE_RECORD
public static final ModbusFunctionCode MASK_WRITE_REGISTER
public static final ModbusFunctionCode READ_WRITE_MULTIPLE_REGISTERS
public static final ModbusFunctionCode READ_FIFO_QUEUE
public static final ModbusFunctionCode ENCAPSULATED_INTERFACE_TRANSPORT
public static final ModbusFunctionCode UNKNOWN
ModbusFunctionCode.get(int value) returns UNKNOWN
if value is not listed in ModbusFunctionCode.public static ModbusFunctionCode[] values()
for (ModbusFunctionCode c : ModbusFunctionCode.values()) System.out.println(c);
public static ModbusFunctionCode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ModbusFunctionCode get(int value)
public static boolean isException(int value)
public static int getExceptionValue(int functionCode)
public int toInt()
public String toString()
toString in class Enum<ModbusFunctionCode>Copyright © 2018. All rights reserved.