Skip to content
CAI
Software that uses CAICheck a score

crane-soft/csModbus

40.3

Weak · 8 November 2026

4.6k

lines of production code

C#

with VB.NET

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET library for implementing Modbus communication protocols, supporting both master and slave roles over TCP, UDP, and serial (RTU/ASCII) transports. It provides core classes for handling Modbus frames, data conversion for 32-bit and floating-point types, and a data server architecture for managing slave state. The repository also includes UI components for data visualization and several demo applications that illustrate usage patterns for both C\# and VB.NET environments.

Features

Add 32-bit and floating-point data type support for Modbus registers

The library now supports reading and writing 32-bit integers (UInt32, Int32) and 32-bit floating-point values (float) in addition to the existing 16-bit types. This is implemented via a new B32Converter class that handles endianness and byte-swapping for multi-register values, and extended generic methods in MbMasterEx to expose these new data types for holding and input registers.

ClassLib/csModbusLib/lib/Modbus · high confidence

Add VB.NET csModSlave demo application

The csModSlave demo application is added, providing a Windows Forms interface for a Modbus slave. The project includes configuration files (App.config, Settings.settings) for connection parameters (COM port, baud rate, protocol type), a main form (frmModSlave) with toolbars and status strips, and resource files for icons. The application supports RTU, ASCII, TCP, and UDP connections and includes an automation feature for testing.

DemoApps/VB.NET/csModSlave · high confidence

Added MasterSimple demo application

A new sample application, MasterSimple, has been added to the DemoApps/Samples directory. It provides a complete, runnable example of a Modbus TCP/RTU master client, demonstrating how to connect to a slave, read/write coils, registers, and float data, and handle errors. The project includes the necessary configuration, entry point, and assembly metadata files.

DemoApps/Samples/MasterSimple · high confidence

Added class diagrams for Modbus library components

New Visual Studio class diagram files have been added to document the architecture of the csModbusLib library. These diagrams visualize the relationships between core classes, including the Modbus frame structures (MbFrame, MBSFrame, MBMFrame), the interface layer (MbInterface, MbEthernet, MbSerial), and the data server components (MbSlaveDataServer, StdDataServer).

ClassLib/csModbusLib/ClassDiagram · high confidence

Added options dialog for configuring Modbus connection settings

Introduced a new options dialog (dOptions) that allows users to configure Modbus communication parameters, including serial port settings (COM port, baud rate), Ethernet settings (hostname, TCP port), and device mode (TCP, UDP, RTU, ASCII). The dialog persists these settings to the application's My.Settings for future sessions.

DemoApps/VB.NET/common · high confidence

New Modbus interface classes for Ethernet (TCP/UDP) and Serial (RTU/ASCII) communication

The library introduces a new set of interface classes to handle Modbus communication over different transport layers. For Ethernet, it adds MbTCPMaster, MbUDPMaster, MbTCPSlave, and MbUDPSlave, enabling clients and servers over TCP and UDP. For serial communication, it adds MbRTU and MbASCII classes, supporting Modbus RTU and ASCII frame formats. These classes encapsulate the specific framing, header handling, and error checking required for each protocol.

ClassLib/csModbusLib/lib/Interface · high confidence

New Modbus slave demo applications added

Added two new sample applications for the Modbus slave: a basic TCP/RTU slave (SlaveSimple) and a version demonstrating data change/read events (SlaveEvents). These demos illustrate how to configure holding registers, coils, and input registers, and how to subscribe to Modbus data events in a .NET environment.

DemoApps/Samples/SlaveSimple · high confidence

New ModbusView grid components and cell types for data visualization

The csModbusView library introduces a new set of UI components for displaying Modbus data in grid views. This includes the base ModbusView panel, MbGridView for data entry, and specialized cells (ModbusGridViewCell) supporting various data types including 16-bit integers, 32-bit integers, hexadecimal, and IEEE 754 floating point. Master and Slave grid views are provided for different Modbus object types (Coils, Registers, etc.), enabling users to visualize and interact with Modbus data in a structured grid format.

ClassLib/csModbusView · high confidence

New VB.NET Modbus Master demo application

A new demo application, csModMaster, has been added to the VB.NET demo apps. It provides a Windows Forms interface for testing Modbus master operations, including serial (RTU/ASCII) and TCP connections. The app features a dynamic grid view for displaying holding registers, coils, and discrete inputs, with status bars for connection state and error tracking. Configuration is managed via user settings for COM port, baud rate, connection type, and slave ID.

DemoApps/VB.NET/csModMaster · high confidence

Behavioural changes

Introduced new Modbus slave data server architecture with 32-bit support

The Modbus library refactors its slave data handling by introducing a new class hierarchy in the SlaveDataServer folder. MbSlaveDataServer now manages slave ID matching and routes standard Modbus function codes (Read/Write Coils, Registers, etc.) to specific handlers. The new MbSlaveData class and its subclasses (ModbusCoilsData, ModbusRegsData, Modbusb32Data) manage the actual data storage and event raising. A key behavioral change is the support for 32-bit data types (UInt32, Int32, float) for input and holding registers, allowing users to store and retrieve 32-bit values directly. Additionally, the server now strictly validates the slave ID before processing frames, ensuring responses are only sent when the ID matches.

ClassLib/csModbusLib/lib/SlaveDataServer · medium confidence

Dependencies

Added .csproj build manifests for the C\# Modbus library, C\# Modbus View, and VB.NET demo applications

The repository now includes MSBuild project files that define the build structure for the core C\# Modbus library (csModbusLib), the C\# Modbus View library (csModbusView), and four demo applications (MasterSimple, SlaveEvents, SlaveSimple, and the VB.NET csModMaster/csModSlave demos). These files establish the project references, target framework (v4.8), and source file inclusions required to compile the Modbus components and their associated examples.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 40 → 40 (+0.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 84 → 84 (+0.0)
  • Architecture 100 → 100 (+0.5)
  • Maturity 32 → 32 (+0.0)
  • Readiness 20 → 20 (+0.0)
  • Security 100 → 100 (+0.0)
  • Performance 70 → 70 (+0.0)

Resolved (12)

  • Documentation: no contributor guidance (README.md)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)
  • Documentation: no usage examples (README.md)
  • Inconsistent casing in compound words. 'UpDate' uses camelCase for the second word in a verb phrase where it should likely be 'Update' (PascalCase for method name) or consistent with other verbs like 'Adjust'. While 'UpDate' is a common typo for 'Update', the inconsistency lies in the casing style of the verb component.
  • Inconsistent spelling of 'EndOfFrame'. One method uses the correct compound 'EndOfFrame', while the other uses the misspelled 'EndOffFrame' (double 'f') and 'Lenthth' (double 'th').
  • Inconsistent spelling of 'Endianness'. The suffix is misspelled as 'Endianess' (with an 'e') in setter methods, while the concept is generally 'Endianness'. Additionally, 'getModbusData' uses a lowercase 'g' for the getter prefix while other getters like 'getUInt32Value' follow standard casing, but the primary issue is the spelling of the domain term.
  • Inconsistent spelling of 'Scan'. The verb 'Scan' is misspelled as 'Scann' in multiple locations.
  • Inconsistent verb usage and spelling. 'CopytValues' contains a typo ('t') and uses 'Copy', while 'PutValues' uses 'Put'. Both appear to perform similar data assignment operations on the frame.
  • Low XML-doc coverage: csModbus (ClassLib/csModbusLib/csModbus.csproj)
  • Low XML-doc coverage: csModbusView (ClassLib/csModbusView/csModbusView.csproj)
  • Low cohesion: MBSFrame (LCOM4 4) (ClassLib/csModbusLib/lib/Modbus/MbFrame.cs)

New (22)

  • doc comments repeat the names (ClassLib/csModbusLib/lib/Modbus/MbBase.cs)
  • doc comments repeat the names (ClassLib/csModbusView/lib/ModbusView.cs)
  • redundant comment (ClassLib/csModbusLib/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusLib/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusLib/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusLib/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusLib/lib/Modbus/MbFrame.cs)
  • redundant comment (ClassLib/csModbusView/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusView/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusView/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusView/Properties/AssemblyInfo.cs)
  • redundant comment (ClassLib/csModbusView/lib/ModbusView.cs)
  • redundant comment (ClassLib/csModbusView/lib/ModbusView.cs)
  • redundant comment (DemoApps/VB.NET/common/dOptions.vb)
  • redundant comment (DemoApps/VB.NET/csModMaster/My Project/AssemblyInfo.vb)
  • redundant comment (DemoApps/VB.NET/csModMaster/My Project/AssemblyInfo.vb)
  • redundant comment (DemoApps/VB.NET/csModMaster/My Project/AssemblyInfo.vb)
  • redundant comment (DemoApps/VB.NET/csModMaster/My Project/AssemblyInfo.vb)
  • redundant comment (DemoApps/VB.NET/csModSlave/My Project/AssemblyInfo.vb)
  • redundant comment (DemoApps/VB.NET/csModSlave/My Project/AssemblyInfo.vb)
  • …and 2 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

crane-soft/csModbus was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 3dc36145b4131243c792b9e97834f29ded364a5d — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.