Skip to content
CAI
Software that uses CAICheck a score

crane-soft/csModbus

45.1

Weak · 21 September 2026

4.3k

lines of production code

C#

with VB.NET

4

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 watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 47 → 45 (-2.0)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 98 → 84 (-14.0)
  • Architecture 98 → 98 (+0.4)
  • Maturity 39 → 39 (+0.0)
  • Readiness 23 → 23 (+0.0)
  • Security 100 → 100 (+0.0)

Resolved (10)

  • Build status unknown
  • Different interfaces/classes use different names for the same or similar functionality regarding the end of a frame. 'EndOfFrame' vs 'EndOffFrameLenthth'.
  • Inconsistent naming for setting endianness. One uses 'setLongEndianess' (specific to 32-bit/long) while the other uses the more generic 'setEndianess'.
  • Inconsistent naming for the same logical concept: checking or processing the end of a frame. One method is named 'Check_EndOfFrame' while the other is 'EndOffFrameLenthth' (which also contains a typo 'Lenthth' and likely 'Off' instead of 'Of').
  • LLM evaluation failed
  • Monorepo: only 1 of 2 solutions was scored
  • No exposed public API
  • XML-doc coverage: csModMaster (DemoApps/VB.NET/csModMaster/csModMaster.vbproj)
  • XML-doc coverage: csModSlave (DemoApps/VB.NET/csModSlave/csModSlave.vbproj)
  • single-maintainer — knowledge-concentration (bus factor) risk

New (7)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Inconsistent casing in 'UpDateModbusCells'. The word 'Update' is misspelled as 'UpDate' (camelCase inside the word). Other similar methods like 'GetValue' are correctly PascalCase. This is a spelling/casing inconsistency.
  • Inconsistent casing style for method names. Some methods use PascalCase (InitModbusType, InitGridView, AdjustSize), while 'setBrowsableProperty' uses camelCase for the setter-like method name, which is inconsistent with the rest of the codebase's PascalCase convention for public/protected methods. Additionally, 'UpDateModbusCells' uses camelCase in the middle of the word.
  • Inconsistent naming and spelling for End-Of-Frame concepts. One method is named 'Check_EndOfFrame' (checking the frame boundary), while the other is 'EndOffFrameLenthth' (which appears to be a misspelled 'EndOfFrameLength' or similar). The prefix 'EndOf' vs 'EndOff' and the suffix 'Frame' vs 'FrameLenthth' indicate a lack of consistent vocabulary for frame boundary/length operations.
  • Inconsistent spelling of 'Endianness'. The method 'setLongEndianess' and 'setEndianess' use 'Endianess' (one 'n' in the middle, or rather 'Endianness' is often spelled with two 'n's, but here it is 'Endianess'). However, the property/parameter names in other parts of the system might differ. More importantly, 'setLongEndianess' is a setter, while 'setEndianess' is also a setter. The inconsistency is minor (spelling of Endianness), but 'Endianess' is a non-standard spelling (standard is 'Endianness'). If the codebase uses 'Endianess' consistently, it's a style choice. However, 'setLongEndianess' vs 'setEndianess' suggests a potential confusion between setting the endianness of a long vs a generic endianness setting.
  • Inconsistent spelling of the verb 'Scan'. The codebase uses 'Scann' (double 'n') in multiple places ('ScannAll', 'ScannAll4Reading', 'ScannAll4Writing'). While this is a consistent misspelling within the sample, it is a distinct inconsistency from standard English spelling conventions if the project aims for correctness. However, strictly within the codebase, 'Scann' is used consistently. A more critical inconsistency is the mix of 'ScannAll' (generic) vs specific variants, but the spelling 'Scann' itself is the primary orthographic issue. If 'Scann' is the chosen convention, it is internally consistent. However, 'EndOff' vs 'EndOf' is a clear inconsistency.

Written by watchdog.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 21 September 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.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.