Java ModbusServer – Methods

Class: ModbusServer

void Listen() throws IOException

Method opens port and starts listening for incomming requests from client.

void StopListening()

Stops Server

void setPort(int port)

Sets Server Port

void setFunctionCode1Disabled(boolean functionCode1Disabled)

Disables Function Code 1 (Read Coils)

void setFunctionCode2Disabled(boolean functionCode2Disabled)

Disables Function Code 2 (Read Discrete Inputs)

void setFunctionCode3Disabled(boolean functionCode3Disabled)

Disables Function Code 3 (Read Holding Registers)

void setFunctionCode4Disabled(boolean functionCode4Disabled)

Disables Function Code 4 (Read Input Registers)

void setFunctionCode5Disabled(boolean functionCode5Disabled)

Disables Function Code 5 (Write Single Coil)

void setFunctionCode6Disabled(boolean functionCode6Disabled)

Disables Function Code 6 (Write Single Register)

void setFunctionCode15Disabled(boolean functionCode15Disabled)

Disables Function Code 15 (Write MultipleCoils)

void setFunctionCode16Disabled(boolean functionCode16Disabled)

Disables Function Code 16 (Write Multiple Registers)

int getPort()

Gets Server Port

boolean getFunctionCode1Disabled()

Returns Function Code 1 disabled (Read Coils)

boolean getFunctionCode2Disabled()

Returns Function Code 2 disabled (Read Discrete Inputs)

boolean getFunctionCode3Disabled()

Returns Function Code 3 disabled (Read Holding Registers)

boolean getFunctionCode4Disabled()

Returns Function Code 4 disabled (Read Input Registers)

boolean getFunctionCode5Disabled()

Returns Function Code 5 disabled (Write single cois)

boolean getFunctionCode6Disabled()

Returns Function Code 6 disabled (Write single Register)

boolean getFunctionCode15Disabled()

Returns Function Code 15 disabled (Write Multiple Coils)

boolean getFunctionCode16Disabled()

Returns Function Code 16 disabled (Write Multiple Registers)

int getNumberOfConnectedClients()

Returns Number of connected Clients to Server

boolean getServerRunning()

Returns if the Server is active

ModbusProtocoll[] getLogData()

Returns Log Data (Only for Advanced Operation)

void setNotifyCoilsChanged(ICoilsChangedDelegator value)

Gets notified if Coils has changed

void setNotifyHoldingRegistersChanged(IHoldingRegistersChangedDelegator value)

Gets notified if Holding Registers has changed

void setNotifyNumberOfConnectedClientsChanged(INumberOfConnectedClientsChangedDelegator value)

Gets notifies if Number of connected clients has been changed

void setNotifyLogDataChanged(ILogDataChangedDelegator value)

Gets notofied if Log data has been changed