|
Sapia Incorporated
Modbus Software Components for Developers SMRN |
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 Properties and Test pages. This makes start-up and troubleshooting a snap, all
without writing a single line of code!
SMRN Appearance on a form A powerful set of properties and methods are provided for configuring SMRN and for talking to slave devices at run-time. Talking to a Modbus/RTU slave is as simple as calling a function with the necessary arguments. SMRN automatically builds the command, appends a CRC, sends the command out the serial port, and receives and validates the response. Your program just reads and writes simple 16-bit data values. 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. Written in Managed C++ and some unmanaged C++ to interface to the Windows OS, 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[Visual Basic, C#, C++] The following example demonstrates how to read the values of the first six holding registers of slave device 20.
[Visual Basic] Dim RegData(6) As Short ' holding register data buffer Dim Err As Short ' return error Err = Me.SmrnControl1.MbReadHoldingRegs(20, 0, 6, RegData)
[C#] short[] RegData = new short[ 6 ]; short Err = smrnControl1.MbReadHoldingRegs(20, 0, 6, RegData);
[C++] short RegData __gc [] = new short __gc [ 6 ]; short Err = smrnControl1->MbReadHoldingRegs(20, 0, 6, RegData); SMRN provides built-in Property and Test pages for configuration and testing
on the development computer or optionally on the run-time computer. Properties
serve as variables for configuring the communications parameters of your PC’s
serial port.
The figure below shows the Properties page and the communications
properties that it contains. 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 serial port, network hardware and slave devices before writing any code. All of the communications methods can be exercised from the Test page.
SMRN Test Page
New Version 1.3 The SMRN Demo is a complete operating control that has a 90-minute time limit. After 90 minutes, communication functions will be disabled. Re-starting the application will initiate another 90-minute demonstration period. Pricing
* Quantity 1 (US$). For larger quantities, contact Sapia. 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.
|
Send mail to
webmaster@sapia-inc.com with
questions or comments about this web site.
|