Bloom.Communication
1.0.0
dotnet add package Bloom.Communication --version 1.0.0
NuGet\Install-Package Bloom.Communication -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bloom.Communication" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bloom.Communication" Version="1.0.0" />
<PackageReference Include="Bloom.Communication" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bloom.Communication --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bloom.Communication, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bloom.Communication@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bloom.Communication&version=1.0.0
#tool nuget:?package=Bloom.Communication&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Bloom.Communication
A .NET library for industrial communication protocols with support for Modbus TCP, Modbus RTU, and Modbus ASCII. Provides serial port (RS-232/RS-485) and Ethernet communication components for PLC and industrial device integration.
Features
- ✅ Modbus TCP — Ethernet-based Modbus communication with synchronous and asynchronous read/write
- ✅ Modbus RTU — Serial port Modbus communication with CRC16 verification
- ✅ Modbus ASCII — Serial port Modbus communication with LRC verification
- ✅ Serial Communication — Configurable port name, baud rate, data bits, parity, and stop bits
- ✅ Ethernet Communication — TCP socket communication with connect/reconnect handling
- ✅ Endian Conversion — Big-Endian / Little-Endian byte order conversion (ABCD, BADC, CDAB, DCBA)
- ✅ CRC16 / LRC — Cyclic Redundancy Check and Longitudinal Redundancy Check utilities
- ✅ Generic Result Pattern — Unified
Result<T>return type with success status and error messages
Supported Modbus Function Codes
| Function Code | Description |
|---|---|
| 0x01 | Read Coils |
| 0x02 | Read Discrete Inputs |
| 0x03 | Read Holding Registers |
| 0x04 | Read Input Registers |
| 0x05 | Write Single Coil |
| 0x06 | Write Single Register |
| 0x0F | Write Multiple Coils |
| 0x10 | Write Multiple Registers |
Installation
dotnet add package Bloom.Communication
Quick Start
Modbus TCP
using Bloom.Communication.Modbus;
// Connect to a Modbus TCP device
using var modbusTcp = new ModbusTcp("192.168.1.100", 502);
// Read holding registers (address 40001-40010)
var result = modbusTcp.ReadRegisters<ushort>(1, "40001", 10);
if (result.IsSuccess)
{
foreach (var value in result.Value)
{
Console.WriteLine($"Register value: {value}");
}
}
// Write to a holding register
var writeResult = modbusTcp.WriteRegisters<ushort>(1, 0, new List<ushort> { 1234 });
Modbus RTU
using Bloom.Communication.Modbus;
using System.IO.Ports;
// Connect via RS-485/RS-232
using var modbusRtu = new ModbusRtu("COM1", 9600, 8, Parity.None, StopBits.One);
// Read coils
var coilResult = modbusRtu.ReadCoils(1, "00001", 8);
if (coilResult.IsSuccess)
{
for (int i = 0; i < coilResult.Value.Count; i++)
{
Console.WriteLine($"Coil {i}: {coilResult.Value[i]}");
}
}
Modbus ASCII
using Bloom.Communication.Modbus;
using System.IO.Ports;
using var modbusAscii = new ModbusAscii("COM1", 9600, 8, Parity.Even, StopBits.One);
// Read input registers
var result = modbusAscii.ReadRegisters<ushort>(1, "30001", 5);
Architecture
Bloom.Communication
├── Component/ # Communication base components
│ ├── ICommunicationUnit # Communication interface
│ ├── Serial # Serial port (RS-232/RS-485)
│ └── Ethernet # TCP socket communication
├── Modbus/ # Modbus protocol implementations
│ ├── ModbusBase # Abstract base class
│ ├── ModbusTcp # Modbus TCP protocol
│ ├── ModbusRtu # Modbus RTU protocol
│ └── ModbusAscii # Modbus ASCII protocol
├── Common/ # Utility classes
│ ├── CRC # CRC16 calculation & verification
│ ├── LRC # LRC calculation & verification
│ └── EndianConversion # Byte order conversion
├── Enums/
│ └── FuncType # Modbus function code enum
├── Result.cs # Generic result pattern
├── EndianFormat.cs # Endian format enum
└── EndianType.cs # Endian type enum
Build & Pack
# Build the project
dotnet build
# Create NuGet package
dotnet pack -c Release
# The .nupkg file will be generated at:
# Bloom.Communication/bin/Release/Bloom.Communication.1.0.0.nupkg
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- System.IO.Ports (>= 6.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 |
|---|---|---|
| 1.0.0 | 134 | 6/6/2026 |