ADS Notification C# und EventHandler delegate

Lexang

Level-1
Beiträge
14
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo Forenuser,
ich erstelle zur Zeit ein Programm in Visual Studio um eine Beckhoff PLC auszulesen. Dabei möchte ich mit einem Event Handler eine PLC-Boolean-Variable überwachen. Wenn diese ihren Wert ändert soll ein Event gefeuert werden. Das klappte auch gut, solange bis ich alles was mit der PLC zu tun hat in eine neue Klasse ausgelagert habe.

Diese Klasse PLC_Class enthält folgendes:
Code:
[FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]//A public event for listeners to subscribe to
P[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]ublic[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]event[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]EventHandler[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] MessungIstFertig;

[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] PLC_Class([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] subsystem_name, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] subsystem_adress)
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] ...
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] tcClient = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]TcAdsClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]();
  tcClient.Connect([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].subsystem_adress, 851);
  hConnect = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][1];
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]
  hConnect[0] = tcClient.AddDeviceNotification(PLC_fertig, dataStream, 0, 1,
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af] AdsTransMode[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].OnChange, 100, 0, bPLC_fertig); [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]
  tcClient.AdsNotification += [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]AdsNotificationEventHandler[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](OnNotification);[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]
 
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] //Fire the event - notifying all subscribers
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] (MessungIstFertig != [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2])
    MessungIstFertig([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]his[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
}

[/SIZE][/FONT][/SIZE][/FONT]private [FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] OnNotification([/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] sender, [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]AdsNotificationEventArgs[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] e)[/COLOR]
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] (e.NotificationHandle == hConnect[0])
  bPLC_fertig = binRead.ReadBoolean();
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af] MessageBox[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].Show(bPLC_fertig.ToString());[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]}
[/SIZE][/FONT][/SIZE][/FONT]


 
In der Form Klasse für die Oberfläche soll dieses Event dann abgefangen und behandelt werden. Bzw je nach Event in der PLC_Class Instanz eine Methode ausgeführt werden
Code:
[SIZE=2][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][FONT=Consolas][FONT=Consolas]private[/FONT][/FONT][/FONT][/COLOR][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af]PLC_Class[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][/FONT][/SIZE][SIZE=2][COLOR=#0000ff][FONT=Consolas][FONT=Consolas] plc_measure_sub;
[/FONT][/FONT][/COLOR][COLOR=#0000ff][FONT=Consolas][FONT=Consolas][FONT=Consolas]public[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] Form_Measure_Sub_vierleiter([/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]string[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] subsystem_name, [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]string[/FONT][/FONT][/FONT][/COLOR][/SIZE][COLOR=#0000ff][SIZE=2][FONT=Consolas][FONT=Consolas] subsystem_adress)
{
  ...
  [/FONT][/FONT][/SIZE][/COLOR][SIZE=2][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000]//PLC Klasse erstellen für Kommunikation mit Beckhoff PLC/ADS
[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][COLOR=#0000ff][FONT=Consolas][FONT=Consolas]plc_measure_sub = [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]new[/FONT][/FONT][/FONT][/COLOR][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af]PLC_Class[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][COLOR=#0000ff][FONT=Consolas][FONT=Consolas]([/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]this[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas].subsystem_name, [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]this[/FONT][/FONT][/FONT][/COLOR][/SIZE][FONT=Consolas][FONT=Consolas][SIZE=2][COLOR=#0000ff].subsystem_adress);
[/COLOR][/SIZE][/FONT][/FONT][FONT=Consolas][COLOR=#008000][FONT=Consolas][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]//Notification der PLC in dieser Klasse abfangen
[/COLOR][/SIZE][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][FONT=Consolas][SIZE=2][COLOR=#0000ff]plc_measure_sub.MessungIstFertig += MessungIstFertigHandler;
[/COLOR][/SIZE][/FONT][/FONT][SIZE=2][COLOR=#0000ff][FONT=Consolas][FONT=Consolas]}

[/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]public[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]void[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] MessungIstFertigHandler([/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]object[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] sender, [/FONT][/FONT][/COLOR][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af]EventArgs[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][/SIZE][SIZE=2][FONT=Consolas][FONT=Consolas][COLOR=#0000ff] e)
{
[/COLOR][/FONT][/FONT][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af]MessageBox[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][FONT=Consolas][COLOR=#0000ff].Show([/COLOR][/FONT][/FONT][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515][FONT=Consolas][COLOR=#a31515]"TEST"[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][/SIZE][COLOR=#0000ff][FONT=Consolas][FONT=Consolas][SIZE=2]);
}
[/SIZE][/FONT][/FONT]
[/COLOR]
Leider erscheint keine MessageBox bei Änderung der PLC-Variable. Habt ihr eine Rat? Ich dachte man könnte den AdsNotificationEventHandler in der PLC_Class abfangen und einen neues Event starten, sodass die Formklassen Instanz nichts mit ADS zu tun hat?

Grüße Lex


 
Zuletzt bearbeitet:
Zuviel Werbung?
-> Hier kostenlos registrieren
Du versuchst den Event "MessungIstFertig" im Konstruktor deiner PLC_Class zu feuern. Da sollte es noch keinen Abonenten des Ereignisses geben weil du es ja erst nach dem Aufruf des Konstruktors abonierst.

Wenn du das OnNotification Ereigniss abfangen willst musst du MessungIstFertig auch aus dieser Methode heraus feuern, oder bin ich da auf dem Holzweg?
 
Hey MasterOhh,
auch wenn ich den Teil
Code:
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] MessungIstFertig([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
[/SIZE][/FONT][/SIZE][/FONT]
in die OnNotification Methode der PLC-Class schreibe erscheint nichts. Die OnNotification Methode in der PLC_Class wird gar nicht aufgerufen. iIch verstehe nicht warum. Der gleiche Quellcode in den Konstruktor der From-Klasse und die OnNotification als Methode der Form-Klasse funktioniert wunderbar.
 
Hallo,
ich bin jetzt nicht so fit mit der C#-Syntax ... aber sollte nicht der Event IN der Klasse, die ihn "feuert" deklariert sein - und nicht außerhalb davon ?

Gruß
Larry
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Wenn ich das richtig verstehe ist dies auch der Fall. Der Event MessungIstFertig ist ein öffentliches Attribut der Klasse.
Code:
[FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
class [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PLC_Class
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]event [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]EventHandler[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] MessungIstFertig;
[FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] PLC_Class([/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] subsystem_name, [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] subsystem_adress)[/COLOR]
{ 
  //Konstruktor
}
[FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]
private [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] OnNotification[FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][SIZE=2][FONT=Consolas]([FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff][FONT=Consolas][COLOR=#0000ff]object[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][FONT=Consolas][FONT=Consolas][COLOR=#000000] sender, [/COLOR][/FONT][/FONT][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af][FONT=Consolas][COLOR=#2b91af]AdsNotificationEventArgs[/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT][/FONT][/SIZE][FONT=Consolas][FONT=Consolas][SIZE=2][COLOR=#000000] e)[/COLOR]
{  
[/SIZE][/FONT][/FONT] if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000] (MessungIstFertig != [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000])[/COLOR]
  MessungIstFertig([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
  ...
}
}
[/SIZE][/FONT][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
 
Zuletzt bearbeitet:
... dann mußt du vielleicht doch mit etwas mehr Code und etwas mehr Zusammenhang (wie ist das aufgebaut) kommen.
Aus den aktuellen Codeschnipseln sehe ich nicht so schrecklich viel.

Gruß
Larry
 
Hey Leute,
danke für eure Hilfe, ich habe den Fehler gefunden. Habe vergessen in der Klasse den DataStream (AdsStream) Konstruktor "dataStream = new AdsStream(4)" aufzurufen. Es gab dann auch keine Fehlermeldung weil die Variable dataStream ja schon deklariert war.

Grüße danke für die Tipps!
 
Zurück
Oben