c# serial port modal form on top stops receiving.

Posted on 2012-08-31
Last Modified: 2012-09-03
Im using VS 2005 C# WinCE6, I am using the serial port component to take in data.

It seems that when another modal form goes on top of the first the serial port stops receiving data and then when the modal form goes the port either stops working or suddenly all the data appears.

The worst is when it stops receiving data. The received event stops firing.

What is a way around this ? An example would be good.

Do I run the serial port in another thread or stop it when the modal windows is shown.
Question by:qicblue

    Expert Comment

    if you use timer ?

    if Yes:

    use event on SerialPort1_DataReceived

    if No:

    Use Timer 100msec SerialPort1.ReadLine
    LVL 55

    Accepted Solution

    You definitively need to put the listener function in a separated thread, because if you stay to much in the modal window, a timeout will occur.
    Be aware that you may need to use a cross-thread UI technique to avoid an exception when updating your UI from the secondary thread.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    This is about my first experience with programming Arduino.
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now