Hello
i need to read sensor data and send this value to a server socket (.net
application).
on event sensor change send the value
Sub Sensor_SensorChanged (Values() As Float)
lblLuz.Text = NumberFormat2(Values(0),4,0,0,False) & " " & unit
send_data(NumberFormat2(Values(0),4,0,0,False))
End Sub
Sub send_data(data As String)
If as1.IsInitialized = True AND isConnected Then
Dim buffer(4) As Byte
If data="" Then data="0"
data=data
buffer = data.GetBytes("UTF8")
as1.Write2(buffer,0,buffer.Length-1)
End If
End Sub
In this case, the connection still stablished because the .net server application work as gateway between tcp and modbus tcp plc.
Now the application its working fine, because input string data is formatted to 0000 (4 byte) , but tcp server does not receive fluid information, its slow.
if i simulate a sensor on a .net client it's work fine (with same server)
plase sorry for my english!
best regards,
Ing. Nicolás Battaglia
i need to read sensor data and send this value to a server socket (.net
application).
on event sensor change send the value
Sub Sensor_SensorChanged (Values() As Float)
lblLuz.Text = NumberFormat2(Values(0),4,0,0,False) & " " & unit
send_data(NumberFormat2(Values(0),4,0,0,False))
End Sub
Sub send_data(data As String)
If as1.IsInitialized = True AND isConnected Then
Dim buffer(4) As Byte
If data="" Then data="0"
data=data
buffer = data.GetBytes("UTF8")
as1.Write2(buffer,0,buffer.Length-1)
End If
End Sub
In this case, the connection still stablished because the .net server application work as gateway between tcp and modbus tcp plc.
Now the application its working fine, because input string data is formatted to 0000 (4 byte) , but tcp server does not receive fluid information, its slow.
if i simulate a sensor on a .net client it's work fine (with same server)
plase sorry for my english!
best regards,
Ing. Nicolás Battaglia