-> Hier kostenlos registrieren
Code:
Public Class Form1
Public fds As libnodave.daveOSserialType
Public di As libnodave.daveInterface
Public dc As libnodave.daveConnection
Public res As Integer
Public memoryRes As Byte
Public buf(10) As Byte
Public localMPI As Integer
Public rack As Integer
Public slot As Integer
Public plcMPI As Integer
Public Connection As Boolean = False
Public IP As String
Public Bit As Byte
Private Sub ConnectPLC()
rack = 0
slot = 2
IP = "10.130.140.2"
fds.rfd = libnodave.openSocket(102, IP)
fds.wfd = fds.rfd
If fds.rfd > 0 Then
di = New libnodave.daveInterface(fds, "IF2", 0, libnodave.daveProtoISOTCP, libnodave.daveSpeed187k)
di.setTimeout(1000000)
res = di.initAdapter
If res = 0 Then
dc = New libnodave.daveConnection(di, 0, rack, slot)
res = dc.connectPLC()
If res = 0 Then
Status_Maschine.Text = "verbunden"
End If
End If
End If
End Sub
Ich versuche im VisualStudio eine Verbindung zur S7 aufzubauen.
Die Typen fds.rfd und fds.wfd werden nicht unterstützt......
Warum?
Beide sind teil von daveOSserialType............