473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SerialPort hard lock

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).
Sep 19 '06 #1
1 3970
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.

"RFOG" <ze************@QUITAME.gmail.comwrote in message
news:eq*************@TK2MSFTNGP05.phx.gbl...
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).


Sep 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrea Judge | last post by:
Hi there, I'm developing an application to catch OBD sensors' data from my car. I connect it via a RS232 interface. Now. with HyperTerminal I can connect and send/receive data, but I'd like to...
0
by: Joshua Moore | last post by:
I'm trying to convert from a lot of invoked code to c# 2.0 SerialPort code. I can't find a way to set fOutxCtsFlow to true (maybe CTSEnable?) and fRtsControl = RTS_CONTROL_HANDSHAKE (RtsEnable?). ...
13
by: Jean Paul Mertens | last post by:
Hello, Someone can tell me why I dont get serial port events in a Service, I created a separate Thread to open the port but no events are coming up (the same happens when I use the timer...
1
by: sranger | last post by:
When I try to use a System.IO.Ports.SerialPort object to read from a serial port, half of the time I have no problems. However, after I successfully read from the serial port, then close the...
0
by: ricolee99 | last post by:
Hi Everyone, I'm using the System.IO.Ports.SerialPort component to attempt to kill an existing component opened by another application. I use the following code: SerialPort serialPort = new...
3
by: ndtang | last post by:
Hi, I am trying to convert a legacy rs232 application to vb2005. The legacy app was written in pascal and runs in full DOS. I have successfully rewrote the app to communicate with the device...
3
by: Adriano | last post by:
Hello, I'm developing an application in VB.NET 2005 that communicates with a device through RS232, and need to send the following sequence of hexadecimal data to the device: 0xFF, 0x01, 0xC3,...
6
by: Keith Lee | last post by:
All: I am attempting to compile the perl module Device::SerialPort and get this error during make -- Manifying blib/man3/Device::SerialPort.3pm Can't open blib/man3/Device::SerialPort.3pm for...
6
by: Steve Mowbray | last post by:
Hi I am using SerialPort component to send raw binary files to a remote device with RTS/CTS handshaking - the remote device has a small receive buffer and is slow so needs to be hardware flow...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.