S7ProSimClass ps = new S7ProSimClass(); ps.ConnectionError += new IS7ProSimEvents_ConnectionErrorEventHandler(S7ProSim_ConnectionError);