Hello,
Is there any way to get a full modbus frame (RTU) received from slave? I can't find any solution in codesamples or in the forum.
Anyone can share their code?
Thanks a lot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Is there any way to get a full modbus frame (RTU) received from slave? I can't find any solution in codesamples or in the forum.
Anyone can share their code?
Thanks a lot.
I am looking for a solution to get full modbus package (not just a value received from the remote device). The best would be to store each byte from the package in the array.
For now I found a C code in SRE EasyModbusAdvancedClient and converted to the VB.net.
Seems sendData and receiveData are the arrays w with Modbus packages, but I can't get the value of the specific index.
For now I change the package to string (as in original code) and use Substring to get exact "byte", but this is not a nice solution:
Dim s As String = BitConverter.ToString(modbusClient.sendData).Substring(3, 2)
txtByte.Text = s
Good morning,
I am looking for a solution to get full modbus package (not just a value received from the remote device). The best would be to store each byte from the package in the array.
For now I found a C code in SRE EasyModbusAdvancedClient and converted to the VB.net.
Seems sendData and receiveData are the arrays w with Modbus packages, but I can't get the value of the specific index.
For now I change the package to string (as in original code) and use Substring to get exact "byte", but this is not a nice solution:
Dim s As String = BitConverter.ToString(modbusClient.sendData).Substring(3, 2)
txtByte.Text = s
Any better ideas?
modbusClient = New ModbusClient(cboCOMPort.Text)
AddHandler modbusClient.ReceiveDataChanged, New EasyModbus.ModbusClient.ReceiveDataChangedHandler(AddressOf UpdateReceiveData)
AddHandler modbusClient.SendDataChanged, New EasyModbus.ModbusClient.SendDataChangedHandler(AddressOf UpdateSendData)
Delegate Sub UpdateReceiveDataCallback()
Private Sub UpdateReceiveData(ByVal sender As [Object])
receiveData = "Rx: " & BitConverter.ToString(modbusClient.receiveData).Replace("-", " ") & System.Environment.NewLine
Dim thread As New Thread(AddressOf updateReceiveTextBox)
thread.Start()
End Sub
Private Sub updateReceiveTextBox()
If TextBox1.InvokeRequired Then
Dim d As New UpdateReceiveDataCallback(AddressOf updateReceiveTextBox)
Me.Invoke(d, New Object {})
Else
TextBox1.AppendText(receiveData)
End If
End Sub
Private Sub UpdateSendData(ByVal sender As [Object])
'sendData = "Tx: " & BitConverter.ToString(modbusClient.sendData).Replace("-", " ") & System.Environment.NewLine
sendData = BitConverter.ToString(modbusClient.sendData)
Dim thread As New Thread(AddressOf updateSendTextBox)
thread.Start()
End Sub
Private Sub updateSendTextBox()
If TextBox1.InvokeRequired Then
Dim d As New UpdateReceiveDataCallback(AddressOf updateSendTextBox)
Me.Invoke(d, New Object {})
Else
TextBox1.AppendText(sendData)
End If
End Sub
Hello,
Is there any way to get a full modbus frame (RTU) received from slave? I can't find any solution in codesamples or in the forum.
Anyone can share their code?
Thanks a lot.
Good morning!
Please have a look at: https://control.com/forums/threads/homebrewed-software-to-communicate-with-measuring-device-via-modbus-tcp.49152/page-2
The matters you’re interrogating right over there.
N. Qv.
Good morning,
I am looking for a solution to get full modbus package (not just a value received from the remote device). The best would be to store each byte from the package in the array.
For now I found a C code in SRE EasyModbusAdvancedClient and converted to the VB.net.
Seems sendData and receiveData are the arrays w with Modbus packages, but I can't get the value of the specific index.
For now I change the package to string (as in original code) and use Substring to get exact "byte", but this is not a nice solution:
Dim s As String = BitConverter.ToString(modbusClient.sendData).Substring(3, 2)
txtByte.Text = s
Any better ideas?
Good morning!
Please have a look at: https://control.com/forums/threads/homebrewed-software-to-communicate-with-measuring-device-via-modbus-tcp.49152/page-2
The matters you’re interrogating right over there.
N. Qv.