SerialPort hard lock

R

RFOG

Hello all.

I'm developing a mixed Windows CE 5 and PC system APP that uses a serial
port component to comunicate with other devices.

App works fine under Windows CE device, but it locks in PC. If it is under
debugger, locks Visual Studio too, and if it running alone, it gives the
exception

AppName: buttonpanelpc.exe AppVer: 1.0.0.0 AppStamp:450fbf8a
ModName: mscorwks.dll ModVer: 2.0.50727.42 ModStamp:4333c83c
fDebug: 0 Offset: 000000000016d3cd

While in exception, app locks Explorer too. When app closes, all continue
working.

Program uses a Windows Forms Timer that polls external devices via serial
port. Then, when I need to directly comunicate with other devices, I stop
timer and start to send/receive data via UI buttons click. All stuff is like
this:

StopTimer();
SendCommand();
WaitResponse();
StartTimer();
UpgradeGUI();

I've selected a Windows Forms Timer in order not to do Invokes and some
other multithreading stuff. And SerialPort component does not launches
events. I only use Write and Read method wihr 50 ms of timeout. I don't get
any execption.

Timer callback communicates with UI at startup, when scanning what devices
are present. Then it starts a no UI communication poll (and program locks
when doing no UI poll):

if(Initialized)
{
SendPoll();
WaitAck();
}

SendCommand and SendPoll composes a message and send it via Write() Serial
Port method.

WaitResponse and WaitAck, receives serial port stuff via Read() method.

What am I doing wrong?




--
Visita mi blog: http://rfog.blogsome.com
Libros, ciencia ficción y programación
========================================
Si alguien se vuelve para mirar tu traje, es que no vas bien vestido.
-- George Bryan Brummel. (1778-1840).
 
R

RFOG

At least most probably reason is a x64 NET with x64 XP bug, because compiled
as x86 NET code (and into a x64 or x86 XP), and into a CE Device, it works
fine.

Sigh!

--
Visita mi blog: http://rfog.blogsome.com
Libros, ciencia ficción y programación
========================================
Si un experimento tiene éxito, algo ha salido mal.
-- Primera Ley de Finagle.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top