Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serialport
Message
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:
01133257
Vues:
18
>Hi
>thanks for the reply.
>
>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);
>
>        }
>
Which line in OnSerialDataReceived throws an exception? If it is the ReadExisting line then it appears that the only thing that can throw an exception is if the serial port is closed. What does the updateScan scan method do?
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform