Sapia Large Logo Sapia Incorporated                       
Modbus Software Components for Developers

Microsoft .NET Logo Image   SMRN Modbus/RTU Master Control

Compatible With

  • Visual Studio 2005, 2008, 2010, 2013 and later
  • Windows XP, Vista, 7, 8 and 10
  • x32 and x64 platforms
  • Assemblies provided for .NET Framework 2.0, 3.5 and 4.0

Supports Standard Modbus Functions

  • 01 - Read Coil Status (0x references)
  • 02 - Read Input Status (1x references)
  • 03 - Read Holding Registers (4x references)
  • 04 - Read Input Registers (3x references)
  • 05 - Force Single Coil (0x references)
  • 06 - Preset Single Registers (4x references)
  • 07 - Read Exception Status
  • 15 - Force Multiple Coils (0x references)
  • 16 - Preset Multiple Registers (4x references)
  • 17 - Report Slave ID

Additional Features

  • Send Custom User Request - provides unlimited Modbus functionality
  • Access Raw Request/Response Frames - helpful for troubleshooting
  • Built-in IEEE Single Precision Floating Point Support
  • Visual Indication of Communications - Comm. LED
  • Visual Connection Status
  • Built-in Test Panel - powerful troubleshooting aide
  • Can be used on a form (Visual Programming) or without a form
  • Low-level serial I/O primitives for non-Modbus reading and writing

 

SMRN is an easy to use Modbus/RTU Master Windows Forms control that provides a fast, convenient way to communicate with Modbus/RTU slave devices connected to your PC's serial port. Within minutes, your VB.NET, C# or Managed C++ application can be talking Modbus/RTU. Talking to a Modbus/RTU slave is as simple as calling a function with the necessary arguments. SMRN automatically builds and sends the request over the network, and receives and validates the response. Your application just operates on simple 16-bit data values representing Modbus registers, coils and discretes.

SMRN can be used on a form as shown below, or optionally without a form.   At design time, you can access your Modbus device from SMRN's built-in Test Panel. This makes start-up and troubleshooting a snap, all without writing a single line of code!  To further get you going quickly, SMRN also includes an extensive HTML help file and example projects for VB.NET, C#.NET and C++.NET.

 

SMRN on a form

SMRN on a form

A powerful set of properties and methods are provided for configuring SMRN and for talking to slave devices at run-time.  The example fragments below show just how easy it is to read holding registers from a Modbus/RTU slave.

For Modbus devices that use floating point data, SMRN provides RegsToFloat( ) and FloatToRegs( ) conversion methods to handle the job.  These two methods convert two consecutive Input Registers or Holding Registers into a 32-bit, IEEE single precision floating point number, and vice-versa respectively.

SMRN is a real Windows Forms Control that inherits form System.Windows.Forms.UserControl and therefore has all of the usual user control properties and methods in addition to the Modbus specific ones of its own.


 

Example

The following example demonstrates how to read the values of the first seven holding registers of slave device 2.

Visual Basic

Dim RegData(7) As UShort ' array for receiving holding register values
Dim Status As SMRN.SMRNControl.MB_STATUS  ' variable for receiving return status
Status = SmrnControl1.MbReadHoldingRegs(2, 0, 7, RegData)
If (Status = SMRN.SMRNControl.MB_STATUS.MB_NO_ERROR) Then
   ' MbReadHoldingRegs succeeded.  Process the holding register data.
   ' ....
End If

C#

UInt16[] RegData = new UInt16[7]; // array for receiving holding register values
SMRN.SMRNControl.MB_STATUS Status; // variable for receiving return status
Status = smrnControl1.MbReadHoldingRegs(2, 0, 7, ref RegData); // read HR's
if( Status == SMRN.SMRNControl.MB_STATUS.MB_NO_ERROR )
{
    // MbReadHoldingRegs succeeded.  Process the holding register data.
    // ....
}
 

C++

array<UInt16>^ RegData = gcnew array<UInt16>(7); // array for receiving holding register values
SMRN::SMRNControl::MB_STATUS Status; // variable for receiving return status
Status = smrnControl1->MbReadHoldingRegs(2, 0, 7, RegData);
if( Status == SMRN::SMRNControl::MB_STATUS::MB_NO_ERROR )
{
    // MbReadHoldingRegs succeeded.  Process the holding register data.
    // ....
}


SMRN provides a built-in Test Panel for configuration and testing on the development computer or optionally on the run-time computer.  The Test Panel contains five tab pages:  the Properties page, Test page, User Request page,Raw Frames page and Serial I/O page.  The figure below shows the Properties page and the communications properties that it contains.

SMRN Properties Page

SMRN Properties Page

 

The Test page provides access to the Modbus network and slave devices on the development computer or optionally on the run-time computer. This is convenient for testing out your network and slave devices before writing any code.  All of the communications methods can be exercised from the Test page. 

SMRN Test Page

SMRN Test Page

 

The User Request page provides a way to enter a custom user request and to send it to the slave and observe the response.

SMRN User Request Page

SMRN User Request Page

 

The Raw Frames page displays the request and response raw frames in bytes for the last Modbus/RTU message sent to the slave device.  Viewing the raw frames is very beneficial when troubleshooting communications problems with your slave device or for just understanding how Modbus/RTU messages are constructed.

SMRN Raw Frames Page

SMRN Raw Frames Page

 

The Serial I/O tab contains controls for exercising the low-level serial I/O primitives available for non-Modbus communications.

SMRN Serial I/O Page

SMRN Serial I/O Page


Download SMRN Demo here

The SMRN Demo is a complete operating control that has a 60-minute time limit.  After 60 minutes, communication functions will be disabled.  Re-starting the application will initiate another 60-minute demonstration period.

View SMRN Revision History


Pricing

Model Description Price*
SMRN-CD

Modbus/RTU Windows Forms Control for Visual Studio 2005/2008/2010, Single Development Site License (on CD-ROM)

$170
SMRN-OL

Modbus/RTU Windows Forms Control for Visual Studio 2005/2008/2010, Single Development Site License (on-line delivery)

$150

* Quantity 1 (US$).  For larger quantities, contact Sapia.   Michigan residents please add 6% sales tax.

By purchasing a single development site license you may install SMRN and develop your  application with it on a single PC and distribute it with your compiled application program royalty free an unlimited number of times.  Please see the EULA included with the demo for complete licensing information.