drfunfrock
Level-1
- Beiträge
- 934
- Reaktionspunkte
- 72
-> Hier kostenlos registrieren
Ich habe hier einen Python client am laufen, aber das .Net Teil will nicht laufen. Fehlermeldung ist "Ads-Error 0x748"Das heisst der Port ist nicht offen: Der Code:
Die SPS ist eine CX8050 und dieUmgebung ist Visual Studio 2017.
Der Python Client hier läuft wie er soll. Ich habe das Projekt https://github.com/counsyl/counsyl-pyads
nach Python3 convertiert und dann noch die Symbolinterpolation geschrieben, damit ich die Symbolliste inkl. der Strukturen bekomme. Jetzt muss der Kram noch nach .Net portiert werden.
Code:
Imports TwinCAT.Ads
Imports System.IO
Imports System.Windows.Forms
Module Module1
Sub Main()
Dim adsClient As TcAdsClient
Try
adsClient = New TcAdsClient()
adsClient.Connect("5.44.181.238.1.1", 801)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Console.ReadLine()
End Sub
End Module
Die SPS ist eine CX8050 und dieUmgebung ist Visual Studio 2017.
Der Python Client hier läuft wie er soll. Ich habe das Projekt https://github.com/counsyl/counsyl-pyads
nach Python3 convertiert und dann noch die Symbolinterpolation geschrieben, damit ich die Symbolliste inkl. der Strukturen bekomme. Jetzt muss der Kram noch nach .Net portiert werden.
Code:
[COLOR=#000080][B]def [/B][/COLOR]main():
[COLOR=#808080][I]# *********************************************************************
[/I][/COLOR] ads_conn = AdsConnection(
[COLOR=#660099]target_ams[/COLOR]=[COLOR=#008080][B]'5.44.181.238.1.1:801'[/B][/COLOR],
[COLOR=#660099]target_ip[/COLOR]=[COLOR=#008080][B]'10.0.0.154'[/B][/COLOR],
[COLOR=#660099]target_port[/COLOR]=[COLOR=#0000ff]801[/COLOR],
[COLOR=#660099]source_ams[/COLOR]=[COLOR=#008080][B]'10.33.0.1.1.1:32733'[/B][/COLOR],
)
[COLOR=#000080][B]with [/B][/COLOR]AdsClient(ads_conn, [COLOR=#660099]debug[/COLOR]=[COLOR=#000080][B]False[/B][/COLOR]) [COLOR=#000080][B]as [/B][/COLOR]device:
[COLOR=#000080]print[/COLOR]([COLOR=#008080][B]""[/B][/COLOR])
[COLOR=#000080]print[/COLOR]([COLOR=#008080][B]"DEVICE INFO"[/B][/COLOR])
[COLOR=#000080]print[/COLOR]([COLOR=#008080][B]""[/B][/COLOR])
pprint.pprint(device.read_device_info().[COLOR=#b200b2]__dict__[/COLOR])