Opening Serial Port more than two times this error occures “The Port ‘COMx:’ does not exist”

 Hi all!

This is my first post here, but I am really baffled by this issue, so here goes, I hope someone can help.
The hardware this is running on is an Axim X50 with WM 5.0. I am using a CF+ Serial Card as a com port. I have access to CompactFlash cards from Quatech as well as from Socket and Ratoc and have this problem with all of them.
This program runs fine twice then when I start it a third time I get the error “Port ‘COM4:’ does not exist”. The com port exist in the list returned by GetPortNames. 

The code that I used to test this problem in a console application follows:

Sub Main()
        Dim netCommPort As New Ports.SerialPort()
        Dim encodingASCII As New System.Text.ASCIIEncoding
        Dim sr As New StreamReader("test01.txt", System.Text.Encoding.Default)
        For Each portName As String In SerialPort.GetPortNames
            MsgBox(portName)
        Next portName 
        With netCommPort
            .BaudRate = 600
            .DataBits = 7
            .Encoding = encodingASCII
            .Handshake = Handshake.RequestToSend
            .Parity = Parity.Even
            .PortName = "COM4:"
            .StopBits = StopBits.One
            .Open()
        End With
        netCommPort.Write(sr.ReadToEnd)
        sr.Close()
        netCommPort.Close()
    End Sub
 

I also tried opening and closing the com port in the application 3 times and get the same error. The error stack looks something like this: 
System.IO.IOException was unhandled
  Message="The port 'COM4:' does not exist."
  StackTrace:
    at System.IO.Ports.SerialStream.WinIOError()
    at System.IO.Ports.SerialStream..ctor()
    at System.IO.Ports.SerialPort.Open()
    at ConsoleApplication1.Module1.Main() 

The only way I can get the Software to work again is by resetting the device or by removing the adaptor card and them reinserting it.

All help would be very much appreciated.



Answer this question

Opening Serial Port more than two times this error occures “The Port ‘COMx:’ does not exist”

  • Chinpokomon

    Thank you very much for the answer. I tried to use your code but the problem pressist. I created a project added a button and used your code example. My terminal recieved the test string twice and the third time I treid I got the same error again.

    Maybe the Problem is with the OEM Windows Mobile version for the Axim X50.

    I also noticed, on my RS-232 mini tester, that the CF Card powers the signal lines constantly as long as the PPC is turned on and cuts the power only when the PPC is turnd off. With Windows Mobile 2003 the CF Card would power the signal lines only when the serial port was open and save power otherwise.
    Also on WM 5.0 after opening the port once the CF Card will not cut the power to the signal lines any more, even when the PPC is turned off.

    I guess the main problem to solve is to really be able to close the port properly. The close methode obviously dosen't seem to do this. Does anyone have any ideas
    Someone please try this on some other WM 5.0 device so that I can know if its the Axim or really a problem with WM 5.0. I appreciate every comment.

    CU
    Thomas

  • om corp mangere

    thats exactly what we had to do, but we do have a few X51's here that I would love to have working. But they are just sitting on the shelf for now.

  • lfox

    Thank you Anthony -

    I shall experiment with your sample. I will getting a replacement PDA ( am considering HP, but I believe they use the Widcomm stack and frankly, I do not know whether that will be an issue as well ).

    Is there another Dell product that is not subject to this problem

    Thanks

    David



  • kevin mcaleer

    Christopher -

    I am in a similar boat as you with my customer. They were kind enough to replace the Dell Axim x51 with an HP iPaq hx2190.

    I am still having the same issue with sending data, and not receiving.

    ARGH !!! If anyone has other suggestions, they are certained welcomed ideas and appreciated.

    Thanks.
    D



  • lozinski

    I have heard from the manufacturer of the UART chip used in the CF+ cards mentioned (QuadTech, Socket) that there is a bus timing issue with the Dell Axim X51 that will need to be resolved by Dell.

    I have since purchased an HP hx2490 PDA and have not seen the same CF card problems. This is obviously not the ideal solution but until either Microsoft or Dell takes responsibility for fixing the timing issues this is the most reliable solution.


  • mallamahesh

    I have been seeing the same issues with Dell Axim X51 and Mobile 5.0. Dell has been promising a patch for awhile but they are on A06 and the problem still persists.

    ETH


  • MikeyG99

    We are also having similar problems, and our client is getting antsy because these issues are preventing good demonstrations for a product that is shipping in at most a couple of weeks. Does anyone have any further information on this issue or access to any kind of a statement from Dell regarding the problem


  • Bruno Nogueira

    I still havn't heard back form Dell after asking about this issue. We are lucky enough that we got ourselfs 15 Axim X50 with WM 2003 still installed wich we can deliever to our customers at the moment.

  • Pharvana

    Hi Eric

    You wrote earlier that Dell is on release A06 I can't find that. Dell has an update for the X51 to A05 on their website with release date 01/03/2006. Have you installed this Update and tried to run your software with it
    I can't get an update for our German installed Axim with more than a A02 release number... I wonder how long it will take for the German release to be updated

    Regards Thomas

  • connect2sandeep

    CompactFlash Bus Timing

    We make a CompactFlash card and our UART chip supplier has performed tests with an HP and Dell PDA and sees problems which occur only under Windows Mobile 5 o/s.

    Their investigations show the cause of these problems to be the ROM image in the PDA.  (Supplied by HP and Dell).  The BIOS in the ROM has to set up the processor (XSCALE) IO bus timings.  The CF/PCMCIA standard states that the IO read strobe should be 165ns.  When running WM5, the HP (PXA270 416MHz) read strobe is only 125ns wide  They have shown the same problem on the Dell, but only when running WM5.

    This issue effects a number of CF card manufacturers and because of the nature of the fault, some cards and some operations will work, but under some special conditions the problem becomes apparent and the card stops working.

    Dell and HP of the problem and requests for a ROM update have been made in December of 2005.   

    Here is a post in the Dell Support Forum

    http://forums.us.dell.com/supportforums/board/message board.id=dellpda&message.id=34276#M34276

     

     



  • longhiphop

    I have continued testing this problem and found out that running this code on a Axim X50 with WM 2003 still installed does not produce the error. This seems to be a problem that comes form using WM 5.0. I was, of course, using the Compact Framwork 2.0 on both devices.

    I am starting to think this is a bug in WM5.0 or a compatibility issue with the CF+ cards I am using. WM5.0 and/or the adaptor card will probably need to be updated before this really starts to work.

    If anyone else can test this on a WM 5.0 device, please let me know if you run into the same issues.

  • beginer_max

    Hi,

    The issue may be caused by the application not being actually closed because the write operation hasn't finished, since it is using the RTS handshake. Can you try introducing a write timeout to the serial port so that a timeout would occur and introduce a global try-catch block to properly handle the exception that may get thrown (cf my post on unhandled exception with serial port)

    You may use the following code as a reference:

    SerialPort sp = null;

    try

    {

    sp = new SerialPort("com4");

    sp.BaudRate = 600;

    sp.DataBits = 7;

    sp.Encoding = new System.Text.ASCIIEncoding();

    sp.Handshake = Handshake.RequestToSend;

    sp.Parity = Parity.Even;

    sp.StopBits = StopBits.One;

    sp.WriteTimeout = 20000;

    sp.Open();

    MessageBox.Show("opened");

    sp.Write("testtesttesttesttesttest");

    MessageBox.Show("written");

    }

    catch (Exception ex)

    {

    MessageBox.Show("ex: " + ex.ToString());

    }

    finally

    {

    if (sp != null)

    sp.Close();

    MessageBox.Show("done");

    }

    Cheers,

    Anthony Wong [MSFT]


  • RMarar

    Thank you very much for the answer. As the Dell Axim X51 is just a X50 with WM 5.0 preinstalled this pretty much covers my device. I will see if I can contact Dell with this problem.

    In my last message I wrote:
    >> Also on WM 5.0 after opening the port once the CF Card will not cut the power to the signal lines any more, even when the PPC is turned off.

    I now noticed this actually has to do with having the Axim hooked up to the PC via the USB Cradle and ActiveSync. Shortly after the USB plug is disconnected, the power on the signal lines of the serial port is cut, when the device is turned off.

    Regards
    Thomas

  • Telesto

    I am hving the "Opening Serial Port more than two times this error occures “The Port ‘COMx:’ does not exist” problem with my Quatech CF serial card and my Axim X51 as well.

    has anyone found a resolution to this problem that does not require me purchasing a new PDA

  • Opening Serial Port more than two times this error occures “The Port ‘COMx:’ does not exist”