Exemplo n.º 1
0
            public _intForm(int ConnectionHandle, int fdrlen, S7OnlineInterface Interface)
            {
                _connectionHandle = ConnectionHandle;
                this.fdrlen       = fdrlen;

                this.Interface = Interface;
            }
        private void cmdStart_Click(object sender, EventArgs e)
        {
            myS7OnlineInterface = new S7OnlineInterface("S7ONLINE");

            myConnection = myS7OnlineInterface.ConnectPlc(new ConnectionConfig(2, 0, 2));
            myConnection.PDURecieved += new Connection.PDURecievedDelegate(myConnection_PDURecieved);

            myTCPServer = new TCPServerTPKT(SynchronizationContext.Current, 102);
            myTCPServer.ConnectionEstablished += new TCPServerTPKT.ConnectionEstablishedEventHandler(MyTcpServerConnectionEstablished);
            myTCPServer.ConnectionClosed += new TCPServerTPKT.ConnectionClosedEventHandler(MyTcpServerConnectionClosed);
            myTCPServer.TelegrammRecieved += new TCPServerTPKT.TelegramRecievedEventHandler(myTCPServer_TelegrammRecieved);
            myTCPServer.Start();
        }
            public _intForm(int ConnectionHandle, int fdrlen, S7OnlineInterface Interface)
            {
                _connectionHandle = ConnectionHandle;
                this.fdrlen = fdrlen;

                this.Interface = Interface;
            }