473,772 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.e xe AppVer: 1.0.0.0 AppStamp:450fbf 8a
ModName: mscorwks.dll ModVer: 2.0.50727.42 ModStamp:4333c8 3c
fDebug: 0 Offset: 000000000016d3c d

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 4038
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******** *****@TK2MSFTNG P05.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.e xe AppVer: 1.0.0.0 AppStamp:450fbf 8a
ModName: mscorwks.dll ModVer: 2.0.50727.42 ModStamp:4333c8 3c
fDebug: 0 Offset: 000000000016d3c d

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
13423
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 do this from inside my C# program. Anyone can write down a very small (or tell how to do it myself) application containing methods like WriteToSerialPort(string what) and ReadFromSerialPort(what).
0
8495
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?). Also, do I need to set the handshaking? Below is the old and attempted new (that continually gets a timeout error on read. I upped the read timeout, but it's way too long NOT for it to be a handshaking or other issue than the readtimeout...
13
7822
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 component, using the System.Timers.Timer it works fine) tnx in advance Jean Paul
1
13994
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 connection, either when re-opening it (in the same instance or a new instance of my program) I get either an IOException "The Handle is Invalid" exception or an ArgumentException "The portName is invalid. Now, I get the port name by doing this: String...
0
385
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 SerialPort ("COM1"); if(serialPort.IsOpen)
3
1776
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 using SerialPort component in .NET 2.0. It works wonderful with a desktop PC. When I installed the program to the laptop it fails, though the original DOS app works in the same configuration. Somehow, the data is
3
31283
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, 0xE3, 0xFF, 0xFF. That's the configuration:
6
5421
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 writing: Invalid argument at /usr/lib/perl5/5.8.8/ExtUtils/Command/MM.pm line 132 make: *** Error 22 $ make all Manifying blib/man3/Device::SerialPort.3pm Can't open blib/man3/Device::SerialPort.3pm for writing: Invalid argument
6
4557
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 controlled to prevent the PC sending too much data per second. Here is my attempt at setting the hardware handshake operation: serialPort1->Handshake = System::IO::Ports::Handshake::RequestToSend; serialPort1->RtsEnable = true;
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.