ModbusTools

Menu > Home
> Products

   • Modbus Poll
   • Modbus Slave
   • Modbus TCP/IP .NET
   • Modbus RTU/ASCII .NET
   • Modbus ActiveX
> Download
> Order
> Contact Info.
> Links

> Modbus

WSMBT Quick start guide

 

Add the component to the toolbox

1. In the Tools menu select Choose Toolbox Items.

 

 

2. In the "Choose toolbox Items" dialog box press browse.

 

 

3. Select the wsmbt.dll

 

 

4. Press ok in the "Choose toolbox Items" dialog box.

 

 

5. Now you can find the WSMBT component in the toolbox.

 

 

6. Add the WSMBTControl  to you form like you add a timer.

 

7. Example code how to make a connection

WSMBT.Result Result;
wsmbtControl1.Mode = WSMBS.Mode.TCP_IP;
wsmbtControl1.ResponseTimeout = 1000;
wsmbtControl1.ConnectTimeout = 1000;
Result = wsmbtControl1.Connect("127.0.0.1", 502);
if (Result != WSMBT.Result.SUCCESS)
   MessageBox.Show(wsmbtControl1.GetLastErrorString());

8. Example code to read 10 holding registers.

Int16[] Registers = new Int16[10];
WSMBT.Result Result;
Result = wsmbtControl1.ReadHoldingRegisters(1, 0, 10, Registers);

if (Result != WSMBT.Result.SUCCESS)
   MessageBox.Show(wsmbtControl1.GetLastErrorString());

 

Copyright © 2012 ModbusTools - All rights reserved. Modbus is trademark of Modicon.