Show / Hide Table of Contents

Class ModbusFactory

Inheritance
System.Object
ModbusFactory
Implements
IModbusFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: NModbus
Assembly: NModbus.dll
Syntax
public class ModbusFactory : IModbusFactory

Constructors

| Improve this Doc View Source

ModbusFactory()

Create a factory which uses the built in standard slave function handlers.

Declaration
public ModbusFactory()
| Improve this Doc View Source

ModbusFactory(IEnumerable<IModbusFunctionService>, Boolean, IModbusLogger)

Create a factory which optionally uses the built in function services and allows custom services to be added.

Declaration
public ModbusFactory(IEnumerable<IModbusFunctionService> functionServices = null, bool includeBuiltIn = true, IModbusLogger logger = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IModbusFunctionService> functionServices

User provided function services.

System.Boolean includeBuiltIn

If true, the built in function services are included. Otherwise, all function services will come from the functionService parameter.

IModbusLogger logger

Logger

Methods

| Improve this Doc View Source

CreateAsciiTransport(IStreamResource)

Declaration
public IModbusAsciiTransport CreateAsciiTransport(IStreamResource streamResource)
Parameters
Type Name Description
IStreamResource streamResource
Returns
Type Description
IModbusAsciiTransport
| Improve this Doc View Source

CreateMaster(IModbusSerialTransport)

Declaration
public IModbusSerialMaster CreateMaster(IModbusSerialTransport transport)
Parameters
Type Name Description
IModbusSerialTransport transport
Returns
Type Description
IModbusSerialMaster
| Improve this Doc View Source

CreateMaster(TcpClient)

Declaration
public IModbusMaster CreateMaster(TcpClient client)
Parameters
Type Name Description
System.Net.Sockets.TcpClient client
Returns
Type Description
IModbusMaster
| Improve this Doc View Source

CreateMaster(UdpClient)

Declaration
public IModbusMaster CreateMaster(UdpClient client)
Parameters
Type Name Description
System.Net.Sockets.UdpClient client
Returns
Type Description
IModbusMaster
| Improve this Doc View Source

CreateRtuTransport(IStreamResource)

Declaration
public IModbusRtuTransport CreateRtuTransport(IStreamResource streamResource)
Parameters
Type Name Description
IStreamResource streamResource
Returns
Type Description
IModbusRtuTransport
| Improve this Doc View Source

CreateSlave(Byte, ISlaveDataStore)

Declaration
public IModbusSlave CreateSlave(byte unitId, ISlaveDataStore dataStore = null)
Parameters
Type Name Description
System.Byte unitId
ISlaveDataStore dataStore
Returns
Type Description
IModbusSlave
| Improve this Doc View Source

CreateSlaveNetwork(IModbusAsciiTransport)

Declaration
public IModbusSlaveNetwork CreateSlaveNetwork(IModbusAsciiTransport transport)
Parameters
Type Name Description
IModbusAsciiTransport transport
Returns
Type Description
IModbusSlaveNetwork
| Improve this Doc View Source

CreateSlaveNetwork(IModbusRtuTransport)

Declaration
public IModbusSlaveNetwork CreateSlaveNetwork(IModbusRtuTransport transport)
Parameters
Type Name Description
IModbusRtuTransport transport
Returns
Type Description
IModbusSlaveNetwork
| Improve this Doc View Source

CreateSlaveNetwork(TcpListener)

Declaration
public IModbusSlaveNetwork CreateSlaveNetwork(TcpListener tcpListener)
Parameters
Type Name Description
System.Net.Sockets.TcpListener tcpListener
Returns
Type Description
IModbusSlaveNetwork
| Improve this Doc View Source

CreateSlaveNetwork(UdpClient)

Declaration
public IModbusSlaveNetwork CreateSlaveNetwork(UdpClient client)
Parameters
Type Name Description
System.Net.Sockets.UdpClient client
Returns
Type Description
IModbusSlaveNetwork
| Improve this Doc View Source

GetAllFunctionServices()

Declaration
public IModbusFunctionService[] GetAllFunctionServices()
Returns
Type Description
IModbusFunctionService[]
| Improve this Doc View Source

GetFunctionService(Byte)

Declaration
public IModbusFunctionService GetFunctionService(byte functionCode)
Parameters
Type Name Description
System.Byte functionCode
Returns
Type Description
IModbusFunctionService

Implements

IModbusFactory

Extension Methods

FactoryExtensions.CreateRtuMaster(IModbusFactory, IStreamResource)
FactoryExtensions.CreateAsciiMaster(IModbusFactory, IStreamResource)
FactoryExtensions.CreateRtuSlaveNetwork(IModbusFactory, IStreamResource)
FactoryExtensions.CreateAsciiSlaveNetwork(IModbusFactory, IStreamResource)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX