Hi,
I'm trying/playing with the LibNoDave library.
I've installed Visual Studio 2013 and Simatic on a VM with IP 192.168.3.100.
I've installed WinLC on a VM with IP 192.168.3.207.
Both can ping each other and I can manipulate with a VAT DB1.DBX0.0 as a test.
So it's clear that there is acces to a softCPU from the VM where Visual Studiois running.
So I imported the Class and I tried to make a connection, but I get:
DllNotFoundException was unhandled.
This was my code behind the button:
Anyone who has some experience with the LibNoDave Class ?
Thanks,
Regards,
Combo
I'm trying/playing with the LibNoDave library.
I've installed Visual Studio 2013 and Simatic on a VM with IP 192.168.3.100.
I've installed WinLC on a VM with IP 192.168.3.207.
Both can ping each other and I can manipulate with a VAT DB1.DBX0.0 as a test.
So it's clear that there is acces to a softCPU from the VM where Visual Studiois running.
So I imported the Class and I tried to make a connection, but I get:
DllNotFoundException was unhandled.
This was my code behind the button:
Code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim fds As libnodave.daveOSserialType
Dim di As libnodave.daveInterface
Dim dc As libnodave.daveConnection
Dim res As Integer
Dim buf(100) As Byte
Dim localMPI As Integer = 0
Dim rack As Integer = 0
Dim slot As Integer = 2
Dim plcMPI As Integer = 2
Dim Connection As Boolean = False
Dim IP As String = "192.168.3.207"
'ConnectPLC.....
fds.rfd = libnodave.openSocket(102, IP)
fds.wfd = fds.rfd
If fds.rfd > 0 Then ' if step 1 is ok
di = New libnodave.daveInterface(fds, "IF1",
0, libnodave.daveProtoISOTCP,
libnodave.daveSpeed187k)
di.setTimeout(1000000)
res = di.initAdapter
If res = 0 Then ' init Adapter is ok
' rack amd slot don't matter in case of MPI
dc = New libnodave.daveConnection(di, 0,
rack, slot)
res = dc.connectPLC()
If res = 0 Then
Connection = True
ToolStrip1.Text = "Connected " + IP
End If
End If
End If
End Sub
Anyone who has some experience with the LibNoDave Class ?
Thanks,
Regards,
Combo
Last edited: