Sapia
Incorporated Modbus Software Components for Developers |
Any container application that can embed ActiveX controls can use SMRX. At design time, you can access your Modbus device from SMRX's test property page. This makes start-up and troubleshooting a snap, all without writing a single line of code! To further get you going quickly, SMRX also includes extensive online HTML help files with detailed examples for Excel, Visual Basic and Visual C++.
A powerful set of properties and methods are provided for configuring SMRX 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. SMRX 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 the first ten holding registers from slave device 5.
Visual Basic
Dim
iVal As Integer
' place to catch word data
Dim
nHrData(10) As Integer
' holding register data
Dim
e As Integer
' last error number
' Note: SMRX1 below is an instance of the SMRX control placed
' on the form that this code belongs to
' Read first ten holding registers from slave 5
iVal = SMRX1.MbReadHoldingRegs(5, 0, 10, nHrData(0))
e = SMRX1.LastErrorNumber ' get last error code
Visual C++
int
nStatus;
// return status
short
nReg[ 10 ];
// holding register buffer
// Note: m_pSMRXCtrl below points to a SMRX object that has been
created
// and initialized
// Read first ten holding registers from slave 5
nStatus = (SMRX_STATUS_TYPE)m_pSMRXCtrl->MbReadHoldingRegs( 5, 0, 10, &nReg[ 0 ] );
SMRX provides property pages for configuration and testing at design time.
Properties serve as variables for configuring the communications
parameters of your PC’s serial port.
Like most ActiveX controls, SMRX’s properties can be set at
design-time from the Comm Port property page or programmatically set
at run-time by the application program.
The figure below shows the Comm Port property page and the
communications properties that it contains.
SMRX Test Page
Supported Modbus Commands (decimal) | 01 – Read Coil Status (0x references) |
02 – Read Input Status (1x references) | |
03 – Read Holding Register(s) (4x references) | |
04 – Read Input Register(s) (3x references) | |
05 – Force Single Coil (0x references) | |
06 – Preset Single Register (4x references) | |
15 – Force Multiple Coils (0x references) | |
16 – Preset Multiple Registers (4x references) | |
17 – Report Slave ID |
The SMRX Demo is a complete operating ActiveX 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.
Model | Description | Price* |
---|---|---|
SMRX-CD |
Modbus/RTU ActiveX Control, Single Development Site License (on CD-ROM) |
$150 |
SMRX-OL |
Modbus/RTU ActiveX Control, Single Development Site License (on-line delivery) |
$130 |
* 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 SMRX 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. When SMRX is used in a Microsoft Excel, Word, PowerPoint or other non-compiling end-user application program where full development capabilities are always present, a separate license file must be purchased and installed on each computer that the end-user application program is installed and running on. Please see the EULA included with the demo for complete licensing information.