• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
FieldTalk Modbus Slave Library for .NET
FieldTalk Modbus Slave Library for .NET
Introduction
What You should know about Modbus
Server Functions common to all Protocol Flavours
Serial Protocols
TCP/IP Protocols
Data Provider
Examples
Design Background
License
Namespaces
Support
Notices
Click or drag to resizeClick or drag to resize

Data Provider

A Data Provider acts as an agent between your Application and the Server Engine.

Modbus Slave classes collaboration diagram

After instantiating a Server Engine class of any protocol flavour, you have to associate it with a Data Provider by calling addDataTable and passing a reference of the Data Provider object.

C#
VB
C++
Copy
MbusRtuSlaveProtocol mbusServer = new MbusRtuSlaveProtocol();
MyDatatable dataTable = new MyDatatable();
mbusServer.addDataTable(1, dataTable);
Dim mbusServer As New MbusRtuSlaveProtocol()
Dim dataTable As New MyDatatable()
mbusServer.addDataTable(1, dataTable)

No code example is currently available or this language may not be supported.

To create an application specific Data Provider derive a new class from MbusDataTableInterface and override the required data access methods.

A minimal Data Provider which realises a Modbus slave with read access to holding registers would be:

C#
VB
C++
Copy
class MyDatatable: MbusDataTableInterface
{
    // Override readHoldingRegistersTable method:
    protected override bool readHoldingRegistersTable(Int32 startRef, Int16[] regArr)
    {
        ... your application specific implementation
    }
}
Class MyDatatable
    Inherits MbusDataTableInterface
    ' Override readHoldingRegistersTable method:
    Protected Overrides Function readHoldingRegistersTable(ByVal startRef As Int32, ByVal regArr() As Int16) As Boolean
        ... your application specific implementation
    End Function
End Class

No code example is currently available or this language may not be supported.

FieldTalk Modbus Slave Library for .NET
Library version 2.11.0
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.