-> Hier kostenlos registrieren
Wenn the programm is calling this function, it hangs on the
ph = openSocket(port, Peer$)
Port = 102 (as long)
Peer = 192.168.0.1 (as string)
i use
Microsoft studio 2008
Vista 64 Bits
write in visual basic
Microsoft Visual Studio Solution (.sln)
file included in the *.rar
Thank you.....
'************************************************* ****
' End of interface declarations and helper functions.
'************************************************* ****
PublicFunction initialize(ByRef ph AsLong, ByRef di AsLong, ByRef dc AsLong)
Dim res AsLong
Dim Peer AsString
Dim port AsLong
Dim MpiPpi AsLong
Dim Rack AsLong
Dim Slot AsLong
ph = 0
di = 0
dc = 0
REM uncomment the daveSetDebug... line, save your sheet
REM run excel from dos box with: excel yoursheet >debugout.txt
REM send me the file debugout.txt if you have trouble.
REM call daveSetDebug(daveDebugAll)
initialize = -1
Peer$ = Form1.TextBox1.Text
port = 102
'Form1.Label3.Text = openSocket(port, Peer$)
ph = openSocket(port, Peer$) ' for ISO over TCP
If (ph > 0) Then
di = daveNewInterface(ph, ph, "IF1", 0, daveProtoISOTCP, daveSpeed187k)
res = daveInitAdapter(di)
If res = 0 Then
' with ISO over TCP, set correct values for rack and slot of the CPU
Rack = Form1.TextBox2.Text
Slot = Form1.TextBox3.Text
dc = daveNewConnection(di, MpiPpi, Rack, Slot)
res = daveConnectPLC(dc)
If res = 0 Then
initialize = 0
EndIf
EndIf
EndIf
EndFunction
ph = openSocket(port, Peer$)
Port = 102 (as long)
Peer = 192.168.0.1 (as string)
i use
Microsoft studio 2008
Vista 64 Bits
write in visual basic
Microsoft Visual Studio Solution (.sln)
file included in the *.rar
Thank you.....
'************************************************* ****
' End of interface declarations and helper functions.
'************************************************* ****
PublicFunction initialize(ByRef ph AsLong, ByRef di AsLong, ByRef dc AsLong)
Dim res AsLong
Dim Peer AsString
Dim port AsLong
Dim MpiPpi AsLong
Dim Rack AsLong
Dim Slot AsLong
ph = 0
di = 0
dc = 0
REM uncomment the daveSetDebug... line, save your sheet
REM run excel from dos box with: excel yoursheet >debugout.txt
REM send me the file debugout.txt if you have trouble.
REM call daveSetDebug(daveDebugAll)
initialize = -1
Peer$ = Form1.TextBox1.Text
port = 102
'Form1.Label3.Text = openSocket(port, Peer$)
ph = openSocket(port, Peer$) ' for ISO over TCP
If (ph > 0) Then
di = daveNewInterface(ph, ph, "IF1", 0, daveProtoISOTCP, daveSpeed187k)
res = daveInitAdapter(di)
If res = 0 Then
' with ISO over TCP, set correct values for rack and slot of the CPU
Rack = Form1.TextBox2.Text
Slot = Form1.TextBox3.Text
dc = daveNewConnection(di, MpiPpi, Rack, Slot)
res = daveConnectPLC(dc)
If res = 0 Then
initialize = 0
EndIf
EndIf
EndIf
EndFunction