Question Modbus RTU Master Help Needed ...

maan2k

New member
Joined
Jul 11, 2010
Messages
1
Programming Experience
Beginner
Hi there ....

I am new in VB (2008 Express) 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
******************************
Thanks in advance for the guidance and help


Maan
 
Hello,
Well for ease i have declared byte array that is to be sent to slave. This array stores all the info in bytes and then this array is send via serial port to the slave.

I have used serialport1.write(message,0,message.length) .
 
Back
Top