Modbus RTU Master
Modbus RTU Master
Modbus RTU Master
Modbus RTU Master
Modbus RTU Master
Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master
Modbus RTU Master Modbus RTU Master
Modbus RTU Master
Go Back  Xtreme Visual Basic Talk > > > Modbus RTU Master


Reply
 
Thread Tools Display Modes
  #1  
Old 07-11-2010, 07:02 AM
maan2k maan2k is offline
Newcomer
 
Join Date: Jul 2010
Posts: 1
Unhappy Modbus RTU Master


Hi there ....

I am new in VB and I want to develop Modbus RTU Master program ..

I am expert in Modbus communication and I have designed the Modbus pre-programmed remote controls ,, Now I want to interface some Modbus RTU slave devices to my own developed application ... and looking for kind guidance ..

I am much familiar with the Modbus RTU syntax and I've tried following to initiate the the master query but I am getting initial 3 bytes ok ,, rest of them are changing the values on COM port so slave is not responding to my command ..

******************************
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

Dim BYTE1 As Byte = 1
Dim BYTE2 As Byte = 6
Dim BYTE3 As Byte = 95
Dim BYTE4 As Byte = 201
Dim BYTE5 As Byte = 254
Dim BYTE6 As Byte = 1
Dim BYTE7 As Byte = 202
Dim BYTE8 As Byte = 64

SerialPort1.Write(Chr(BYTE1) & Chr(BYTE2) & Chr(BYTE3) & Chr(BYTE4) & Chr(BYTE5) & Chr(BYTE6) & Chr(BYTE7) & Chr(BYTE8))

End Sub
******************************
Plz guide ,,,,


Thanks in advance for the guidance and help


Maan
Reply With Quote
  #2  
Old 07-11-2010, 08:33 AM
PlausiblyDamp's Avatar
PlausiblyDampModbus RTU Master PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Does the RTU protocol expect it's data in a particular format (ascii, unicode etc.)? Under .Net Chr will be returning unicode characters which could be different from the bytes you are trying to feed in.

If you want to transmit the raw bytes then there is an overload of the Write method that takes a byte array rather than a string.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Modbus RTU Master
Modbus RTU Master
Modbus RTU Master Modbus RTU Master
Modbus RTU Master
Modbus RTU Master
Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master Modbus RTU Master
Modbus RTU Master
Modbus RTU Master
 
Modbus RTU Master
Modbus RTU Master
 
-->