public enum FunctionCode extends Enum<FunctionCode>
| Enum Constant and Description |
|---|
FC_01_READ_COILS |
FC_02_READ_DISCRETE_INPUTS |
FC_03_READ_HOLDING_REGISTERS |
FC_04_READ_INPUT_REGISTERS |
FC_05_WRITE_SINGLE_COIL |
FC_06_WRITE_SINGLE_REGISTER |
FC_15_WRITE_MULITPLE_COILS |
FC_16_WRITE_MULTIPLE_REGISTERS |
| Modifier and Type | Method and Description |
|---|---|
static FunctionCode |
fromValue(int value) |
static FunctionCode |
getFunctionCodeFromRegisterType(boolean read,
RegisterType type,
DataType dataType) |
static FunctionCode |
getFunctionCodeFromRegisterType(boolean read,
RegisterType type,
DataType dataType,
int count) |
int |
getValue() |
void |
setValue(int value) |
static FunctionCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FunctionCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FunctionCode FC_01_READ_COILS
public static final FunctionCode FC_02_READ_DISCRETE_INPUTS
public static final FunctionCode FC_03_READ_HOLDING_REGISTERS
public static final FunctionCode FC_04_READ_INPUT_REGISTERS
public static final FunctionCode FC_05_WRITE_SINGLE_COIL
public static final FunctionCode FC_06_WRITE_SINGLE_REGISTER
public static final FunctionCode FC_15_WRITE_MULITPLE_COILS
public static final FunctionCode FC_16_WRITE_MULTIPLE_REGISTERS
public static FunctionCode[] values()
for (FunctionCode c : FunctionCode.values()) System.out.println(c);
public static FunctionCode 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 FunctionCode fromValue(int value) throws EnumConstantNotPresentException
EnumConstantNotPresentExceptionpublic int getValue()
public void setValue(int value)
public static FunctionCode getFunctionCodeFromRegisterType(boolean read, RegisterType type, DataType dataType) throws RuntimeException
RuntimeExceptionpublic static FunctionCode getFunctionCodeFromRegisterType(boolean read, RegisterType type, DataType dataType, int count) throws RuntimeException
read - type - dataType - count - only evaluated if it is required but cannot be derived from the dataType, i.e. for write actions
for String and Bytearray typesRuntimeExceptionCopyright © 2018. All rights reserved.