Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serialport
Message
De
30/06/2006 12:38:23
 
 
À
30/06/2006 02:28:20
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Divers
Thread ID:
01129986
Message ID:
01133115
Vues:
19
Stuart,

Are you getting a threading exception thrown? If so, see this for the reason, and this for a solution.

>the code below (I have stripped out some lines )shows what I am trying to do. It crashes with any code in OnSerialDataReceived even if its just updating a text box. I can see the data if i step through the code in OnSerialDataReceived so that part works.
>
>sorry for the long delay I have had one of those weeks :)
>any help gratefully received
>thanks
>Stuart
>
>
>      public SerialPort ComPort;
>       public scan1 oScan;
>
>             oScan = new scan1();
>
>              ComPort = new SerialPort(port, baud);
>
>                ComPort.Parity = Parity.None;
>                ComPort.StopBits = StopBits.One;
>                ComPort.DataBits = 8;
>                ComPort.Handshake = Handshake.None;
>                ComPort.DataReceived += OnSerialDataReceived;
>
>        public void OnSerialDataReceived(object sender, SerialDataReceivedEventArgs args)
>        {
>
>            string data = this.ComPort.ReadExisting();
>
>            oScan.updateScan(data);
>
>        }
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform