libnodave VisualStudio - Der Typ des Felds "rfd" / "wfd" wird nicht unterstützt

dirknico

Level-2
Beiträge
236
Reaktionspunkte
14
Zuviel Werbung?
-> 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............
 
Willst du eine Anwendung für 64 Bit erstellen? Dann brauchst du eine für 64 Bit kompilierte Version von Libnodave
Hier ein Excel-Beispiel, das sowohl unter Excel (64-Bit) als auch Excel (32-Bit) funktioniert.
(...)
Eine für 64-Bit kompilierte Version der libnodave.dll findet man hier:
https://github.com/dotnetprojects/DotNetSiemensPLCToolBoxLibrary /externalDlls/ libnodave_jfkmod64.dll
siehe auch https://www.sps-forum.de/hochsprachen-opc/61647-libnodave-64-bit.html
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Die Typen fds.rfd und fds.wfd werden nicht unterstützt......

Warum?
Beide sind teil von daveOSserialType............

Mit der Forumssuche nach "daveOSserialType" findet man Beiträge, die meistens mit "64 Bit" zu tun haben.
Eventuell hilft auch dieser Hinweis:
In Excel-VBA können Struct ("benutzerdefinierter Typ") nicht als Wert (ByVal) übergeben werden. (...)

Zum Glück bietet Libnodave die Funktion daveNewInterface(..) auch als Variante mit Übergabe des Struct als Referenz: davePascalNewInterface(..) Damit funktioniert auch Excel 64-Bit. :D

Der blaue Code führt zum Erfolg:
(...)
 
Zurück
Oben