net.sourceforge.jmodbus
Class ModbusTCPSlave

java.lang.Object
  |
  +--net.sourceforge.jmodbus.Modbus
        |
        +--net.sourceforge.jmodbus.ModbusSlave
              |
              +--net.sourceforge.jmodbus.ModbusTCPSlave
All Implemented Interfaces:
java.lang.Runnable

public class ModbusTCPSlave
extends ModbusSlave

Class to implement a Modbus TCP Slave device. This class can run as a standalone thread (for it implements the Runnable interface) or can be used interactivley via get and set methods. This class only defines what type of transport if to be used, all the work in recieveing and processing requests is performed by the methods in the ModbusSlave class.


Fields inherited from class net.sourceforge.jmodbus.Modbus
ADDRESS_MAX, COIL_OFF, COIL_ON, debug, EXCEPTION_MODIFIER, ILLEGAL_DATA_ADDRESS, ILLEGAL_DATA_VALUE, ILLEGAL_FUNCTION, ILLEGAL_RESPONSE_LENGTH, MAX_MESSAGE_LENGTH, READ_COILS, READ_EXCEPTION_STATUS, READ_INPUT_DISCRETES, READ_INPUT_REGISTERS, READ_MULTIPLE_REGISTERS, transport, UINT16_MAX, UINT16_MIN, UINT8_MAX, UINT8_MIN, WRITE_COIL, WRITE_MULTIPLE_REGISTERS, WRITE_SINGLE_REGISTER
 
Constructor Summary
ModbusTCPSlave(int slaveAddress, java.net.Socket socket)
          Constructor that uses the TCP transport created with the supplied socket.
 
Methods inherited from class net.sourceforge.jmodbus.ModbusSlave
processRequest, run, setInputCoils, setInputRegisters, setOutputCoils, setOutputRegisters
 
Methods inherited from class net.sourceforge.jmodbus.Modbus
receiveFrame, sendFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModbusTCPSlave

public ModbusTCPSlave(int slaveAddress,
                      java.net.Socket socket)
Constructor that uses the TCP transport created with the supplied socket. The slave address of this device is also passed to it.
Parameters:
slaveAddress - The slave address of this device.
socket - The TCP socket to be used to communicate by the TCP transport for this slave object.