shakreeelmi
Member
Hello,
I'm currently trying to connect my vb.net application with my Twincat PLC. This is what I have so far (i call it from a sub):
Now whenever I try to connect to the PLC, it says "Port not open". Weird is, I'm able to control my PLC through the Twincat PLC software using the same port. Please advise me on this matter. Thank you.
I'm currently trying to connect my vb.net application with my Twincat PLC. This is what I have so far (i call it from a sub):
Code:
Dim ads As TcAdsClient = New TcAdsClient
ads.Connect(netID, Int32.Parse(port)) 'default port of Twincat 3 is 851 / Twincat 2 is 801
If ads.IsConnected = True Then
WriteLine("Connection ok" & vbCrLf)
Else
WriteLine("Connection error")
End If
Now whenever I try to connect to the PLC, it says "Port not open". Weird is, I'm able to control my PLC through the Twincat PLC software using the same port. Please advise me on this matter. Thank you.