FluentModbus.Secure
5.2.0-preview
dotnet add package FluentModbus.Secure --version 5.2.0-preview
NuGet\Install-Package FluentModbus.Secure -Version 5.2.0-preview
<PackageReference Include="FluentModbus.Secure" Version="5.2.0-preview" />
<PackageVersion Include="FluentModbus.Secure" Version="5.2.0-preview" />
<PackageReference Include="FluentModbus.Secure" />
paket add FluentModbus.Secure --version 5.2.0-preview
#r "nuget: FluentModbus.Secure, 5.2.0-preview"
#:package FluentModbus.Secure@5.2.0-preview
#addin nuget:?package=FluentModbus.Secure&version=5.2.0-preview&prerelease
#tool nuget:?package=FluentModbus.Secure&version=5.2.0-preview&prerelease
FluentModbus
FluentModbus is a .NET Standard library (2.0 and 2.1) that provides Modbus TCP/RTU server and client implementations for easy process data exchange. Both, the server and the client, implement class 0, class 1 and class 2 (partially) functions of the specification. Namely, these are:
Class 0:
- FC03: ReadHoldingRegisters
- FC16: WriteMultipleRegisters
Class 1:
- FC01: ReadCoils
- FC02: ReadDiscreteInputs
- FC04: ReadInputRegisters
- FC05: WriteSingleCoil
- FC06: WriteSingleRegister
Class 2:
- FC15: WriteMultipleCoils
- FC23: ReadWriteMultipleRegisters
Modbus/TCP Security (mbaps)
⚠️ Development project — not production-tested. This feature is a work in progress. It has unit tests and a working sample, but it has not been tested or audited for production use. Nutzung auf eigenes Risiko / use at your own risk.
This fork adds support for Modbus/TCP Security — TLS-secured Modbus TCP with mutual X.509
certificate authentication and certificate-role-based authorization, as defined by the Modbus
Organization (default port 802, TLS 1.2+). It is available on netstandard2.1 and net8.0.
A short bilingual (English/German) usage guide is in doc/secure-modbus-guide.md.
// server
using var server = new ModbusTcpServer();
server.StartSecure(new IPEndPoint(IPAddress.Any, 802), new ModbusTcpServerSecurityOptions
{
Certificate = serverCertificate, // incl. private key
TrustedRootCertificates = new X509Certificate2Collection { rootCa }, // trusted client CA(s)
Authorize = ctx => ctx.Role == "operator" || IsReadFunction(ctx.FunctionCode)
});
// client
using var client = new ModbusTcpClient();
client.Connect("192.168.0.1:802", new ModbusTcpClientSecurityOptions
{
Certificate = clientCertificate, // carries the role extension
TrustedRootCertificates = new X509Certificate2Collection { rootCa }
});
The client's authorization role is carried in an X.509 certificate extension (OID
1.3.6.1.4.1.50316.802.1); use ModbusRoleCertificate.CreateRoleExtension(role) when issuing client
certificates. See sample/SampleServerClientTcpSecure for a complete runnable example.
Please see the introduction to get a more detailed description on how to use this library!
Below is a screenshot of the sample console output using a Modbus TCP server and client:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- System.IO.Ports (>= 5.0.0)
- System.Memory (>= 4.5.4)
-
.NETStandard 2.1
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- System.IO.Ports (>= 5.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 5.0.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.IO.Ports (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.2.0-preview | 68 | 7/19/2026 |