I works very well, but now I've a new question:
I read from the Slave every 10 sec. I want control if my slave is offline before reading. To do this I call New sub in this manner:
Dim IDEA as TcpClient
Dim Premium as Device.ModbusIpMaster
Public Sub new()
Try
IDEA = New TcpClient("192.168.1.101", 502)
Catch Errore As Exception
MsgBox("Can't connect PLC Socket")
Sleep(10000)
Call NEW()
End Try
.........
Timer1(...)
Call NEW
........
Timer2(...)
Call NEW
My question is: Create several time my TCPClient, Could be wrong?
Thanks a lot..
Stefano
I read from the Slave every 10 sec. I want control if my slave is offline before reading. To do this I call New sub in this manner:
Dim IDEA as TcpClient
Dim Premium as Device.ModbusIpMaster
Public Sub new()
Try
IDEA = New TcpClient("192.168.1.101", 502)
Catch Errore As Exception
MsgBox("Can't connect PLC Socket")
Sleep(10000)
Call NEW()
End Try
.........
Timer1(...)
Call NEW
........
Timer2(...)
Call NEW
My question is: Create several time my TCPClient, Could be wrong?
Thanks a lot..
Stefano