• matthew@hierthinking.com

Forum

Please or Register to create posts and topics.

Visual Basic Error when connecting

Hi all

My goal is to send a  programm to the cnc Fanuc Controlle out of Siemens NX.  I'm not a programmer but i made already a working programm for a Heidenhain controller.

My programm is written in vb.net. I made the same steps like in the youtube-tutorial but i failed.

1.Put the .dll's in the "C:\Windows\System32\" folder

2.Created the project and added the "fwlib32.vb"

3. Added some code

Public Function GetConnection()

 

Dim ip As String = "172.18.136.1" ' IP-Adresse der Fanuc-Steuerung
Dim port As Integer = 8126 ' Portnummer der Fanuc-Steuerung
Dim timeout As Integer = 10 ' Timeout-Wert in Sekunden
Dim handle As UShort ' Verbindungshandle

' Verbindung zur Fanuc-Steuerung herstellen
Dim result As Short = Focas1.cnc_allclibhndl3(ip, port, timeout, handle)

If result = 0 Then
' Verbindung erfolgreich hergestellt
Console.WriteLine("Verbindung erfolgreich hergestellt.")
Else
' Verbindung fehlgeschlagen
Console.WriteLine("Verbindung fehlgeschlagen. Fehlercode: " & result)
End If

End Function

 

Now i get an error (Picture1)

 

Has someone made a vb.net project?

Does i have to set the target CPU to x86?

 

Thank you all for your assistence

Bernhard

 

Uploaded files:
  • You need to login to have access to uploads.