Libnodave auf 64Bit kompilieren???

lso im Config-Fenster kommt Verbindung erfolgreich. Aber im Progromm ist ja auch der Verbindungsaufbau erfolgreich. (openSocket und daveConnection) . ers bei ConnectPLC kommt ein Fehlercode zurück.
Also ich mach jetzt Feierabend villeicht hast Du morgen Lust weiter zu machen.

Mike
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Wenn du in meinem Config SCreen auf Test klickst, wird auch ConnectPLC() aufgerufen, und geprüft ob der Connect funktioniert hat! Also scheints nicht an der DLL zu liegen wenn der Connect so geht!

Vielleicht kannst du deinen Code zum Verbindungsaufbau ja mal reinstellen...
 
Hier mal mein Code.
Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] fds [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] libnodave.daveOSserialType[/SIZE]
[SIZE=2][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] di [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] libnodave.daveInterface[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dc [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] libnodave.daveConnection[/SIZE]
[SIZE=2][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] res [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][/SIZE]
 
[SIZE=2][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Structure[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveOSserialType[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] Public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] rfd [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] Public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] wfd [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Structure[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff] 
[/COLOR][/SIZE]
[/SIZE][/SIZE][SIZE=2]fds.rfd = libnodave.openSocket(102, myIPAddress) [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Portstatus - lesen[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]fds.wfd = fds.rfd [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'Portstatus schreiben = Portstatus - lesen[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]di = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] libnodave.daveInterface(fds, [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Palettenbahnhof"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], localMPI, libnodave.daveProtoISOTCP, libnodave.daveSpeed187k)[/SIZE]
 
[SIZE=2]di.setTimeout(1000000)[/SIZE]
[SIZE=2]res = di.initAdapter[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] res = 0 [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'initAdapter OK[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]' Rack und Slot spielen keine Rolle bei diesem Protokoll[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]dc = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] libnodave.daveConnection(di, plcMPI, 0, 2)[/SIZE]
[SIZE=2]res = dc.connectPLC()[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[/COLOR][/SIZE]

Hier noch die Deklarationen der Lib-Aufrufe.

Der Text scheint zu lang zu sein, deshalb der Rest in der nächsten Antwort.
 
Zuletzt bearbeitet:
Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Declare [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] openSocket [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Lib[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"libnodave.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] port [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], <MarshalAs(UnmanagedType.LPStr)> [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] portName [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr [/SIZE]
 
 
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Declare [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveNewInterface [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Lib[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"libnodave.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] fd [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveOSserialType, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] name [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] localMPI [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] useProto [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] speed [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] fd [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveOSserialType, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] name [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] localMPI [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] useProto [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] speed [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]pointer = daveNewInterface(fd, name, localMPI, useProto, speed)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Protected [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Declare [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveNewConnection [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Lib[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"libnodave.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] di [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] MPI [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] rack [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] slot [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] di [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveInterface, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] MPI [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] rack [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] slot [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]pointer = daveNewConnection(di.pointer, MPI, rack, slot)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][/COLOR][/SIZE]
 
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Protected [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Declare [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveConnectPLC [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Lib[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"libnodave.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dc [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] IntPtr) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] connectPLC() [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] daveConnectPLC(pointer)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE]
[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]

Ich hoffe ja immer noch, das ich irgendeine Variable als Integer statt als Pointer deklariert habe. Vielen Dank für Deine Bemühungen.

Mike
 
Zuletzt bearbeitet:
Es geht um eine 300er CPU. Der Text stammt aus der Vorlage. Ich kann nur sagen, wenn ich das Programm mit 32 Bit laufen lasse, gibt es kein Problem.

Mike
 
Und wie hast dus gemacht? Meine dll in libnodave.dll umbenannt? Vielleicht liegt irgendwo noch ne falsche Version der libnodave.dll die genutzt wird? Start dein prg mal ohne dll im verzeichnis, obs dann nen fehler gibt!
 
Das ist auf jeden Fall deine Lib. Die Dll umbenennen war einfacher aus die ganzen Deklarationen der Aufrufe abzuändern.

Mike
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hmmmm.... Seh halt keinen Fehler, und da es mit meiner Wrapper Dll funzt. Vielleicht kannst du mir ja deinen Quellcode zuschicken, dann probier Ich es auf meinem 64Bit Pc, oder du nutzt halt meine ConnectionLib.
 
Hallo,

ich habe mal die entsprechenden Code-Teile in ein Projekt kopiert. Das Project ist in VB.Net. Vielleicht findes Du jetzt etwas.

Mike
 

Anhänge

  • Libnodave_Test.zip
    219,2 KB · Aufrufe: 44
Hmm mal schaun wo Ich das jetzt testen kann, mein Kollege hat seinen Laptop platt gemacht und Win7 32 Bit installiert, aber Ich finde schon was... Dauert halt noch 1,2 Tage...

Mfg.
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Bekomms im Moment nicht zum laufen, auch mit meinem Programm nicht.

Aber es hatte auf meinem Kollegen seinen 64 Bit Laptop schon funktioniert!

Nun ist das Problem, das send() in libnodave von Winsock funktioniert noch (die Daten werden auch gesendet) aber das select() von Winsock liefert danach den Fehler "WSAGetLastError: 10038" d.h. das Socket ist nun ungültig... Komm aber im Moment nicht dahinter was da falsch läuft...
 
Hallo zusammen!

Ich habe die Diskussion hier nun komplett durchgelesen und mir ist nicht ganz klar, ob es nun eine funktionierende 64bit Version gibt, oder nicht...

Ich habe jedenfalls mit libnodave_jjfkmod64.dll aus dem neuesten siemensplctoolboxlib-77369.zip bisher keinen Erfolg gehabt. Bis zum daveConnectPLC funktioniert alles, aber dann gibt es den -1 Return Code...

Vielleicht zur Information: ich nutze einen jna Java Wrapper um die DLL, um sie aus Java heraus nutzen zu können. Mit der 32bit DLL funktioniert mein Programm aus einer 32bit JRE einwandfrei. Aus der 64bit JRE mit der 64bit DLL leider nicht. Gibt es irgendwas, was ich machen könnte, um weitere Ursachenforschung zu betreiben?

Schöne Grüße, Frank
 
Also... hier ist, was ich mit Hilfe von Wireshark herausbekommen habe:

Wenn ich die 32bit Version mit rack=1 und slot=2 aufrufe, ergibt das einen Destination TSAP von 0202.

Bei der 64bit Version kommt mit den gleichen Werten eine Destination TSAP von 0122 heraus und die funktioniert ganz sicher nicht, also Return Code -1: connection refused.

Jetzt werde ich mir mal den Code anschauen und versuchen herauszubekommen, wie die unterschiedlichen TSAPs zustande kommen könnten.
 
Also... hier ist, was ich mit Hilfe von Wireshark herausbekommen habe:

Wenn ich die 32bit Version mit rack=1 und slot=2 aufrufe, ergibt das einen Destination TSAP von 0202.

Bei der 64bit Version kommt mit den gleichen Werten eine Destination TSAP von 0122 heraus und die funktioniert ganz sicher nicht, also Return Code -1: connection refused.

Jetzt werde ich mir mal den Code anschauen und versuchen herauszubekommen, wie die unterschiedlichen TSAPs zustande kommen könnten.

Die TSAPs werden in libnodave meiner Meinung nach eh falsch zusammengebaut. Was aber bei der normalen Anwendung mit libnodave nicht weiter auffällt, weil man nur aus einer CPU Daten auslesen kann und diese immer im Rack 0 sitzt.

Bei IsoOnTcp findest du die Rack/Slot angaben in nodave.c in Zeilen 4025/4026.
Code:
	    dc->msgOut[17]=dc->rack+1;
	    dc->msgOut[18]=dc->slot;
Und das ist falsch. In Zeile 4000 steht wie es richtig aussieht:
Rack (Bit 7-5) and Slot (Bit 4-0)

Eine von 0 abweichende Rack-Nummer hat man nur wenn man einen CP in einem anderen Rack sitzen hat.

Korrekte Destination-TSAP wären z.B.:
0x010f -> Rack 0, Slot 15 (z.B. CPU)
0x012a -> Rack 1, Slot 10 (CP)
0x014a -> Rack 2, Slot 10 (CP)
 
Zurück
Oben