Skip to main content

ModbusTcpListener Class

Namespace: GHIElectronics.TinyCLR.Devices.Modbus.Interface · Assembly: GHIElectronics.TinyCLR.Devices.Modbus

Listener for Mdbus TCP devices

public class ModbusTcpListener : IDisposable

Constructors

ModbusTcpListener(ModbusDevice device, int port, int maxConnections, short maxDataLength)

public ModbusTcpListener(ModbusDevice device, int port, int maxConnections, short maxDataLength)

Creates a new Modbus TCP listener. This will start a TCP server listening to the given port.

ParameterTypeDescription
deviceModbusDeviceDevice to add the listeners to.
portintPort to listen. The Modbus TCP default port is 502.
maxConnectionsintMaximum number of allowed connections. The default is 5.
maxDataLengthshortMaximum allowed length of function code specific data.

Methods

Dispose()

public void Dispose()

Disposes the listener and releases all resources