|
Sapia Incorporated
Modbus Software Components for Developers SMRX |
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! 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 Comm Port Property Page
The Test page provides access to slave devices at design time. 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. SMRX Test Property Page
New Version 1.2 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. Pricing
* Quantity 1 (US$). For larger quantities, contact Sapia. 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.
|
Send mail to
webmaster@sapia-inc.com with
questions or comments about this web site.
|