What is the reason System.IO.IOException for the embedded version of Windows XP?

I am running .Net 3.5 application on a new version of Windows XP. This application writes and reads some data through the serial port (COM). The application works fine on my laptop (Windows XP Professional), but not on the built-in Windows XP. I keep getting this error:

System.IO.IOException: An I / O operation was aborted due to a stream or application request.

What could be the reason for this?

Additional info: read, I use ReadExisting , not Readline . Also, before reading, I am sure that the port is also open.

 System.IO.IOException: The I/O operation has been aborted because of either a thread exit or an application request. at System.IO.Ports.SerialStream.EndRead(IAsyncResult asyncResult) at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count, Int32 timeout) at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.Ports.SerialPort.ReadExisting() at ScalesApp.Scales.handleDataReceived(Object sender, SerialDataReceivedEventArgs e) at System.IO.Ports.SerialPort.CatchReceivedEvents(Object src, SerialDataReceivedEventArgs e) at System.IO.Ports.SerialStream.EventLoopRunner.CallReceiveEvents(Object state) at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) 
+4
source share
2 answers

The problem is that fAbortOnError is included in SetCommState DCB, which explains most of the IOExceptions created by the SerialPort object. Some PCs / PDAs have a UART that allows the default to cancel the error flag, so it is necessary that the serial port initialization procedure clears it (which Microsoft did not execute). The SerialPort object was not designed with fAbortOnError in mind.

I recently wrote a long article to explain this in more detail ( see this if you're interested).

+8
source

it greatly depends on your built-in Windows configuration.

you may know that the built-in Windows XP is very scalable, and you can choose one of the 1000 packages that you want to include.

Once in the company we had a problem that audio signals are not sent from the citrix session to the local client. after some trial and error, we found out that we forgot the “sound driver”. yep that exists; o)

Have you tested any other application on your computer using com-port? You may want to check in the device manager whether the driver is correctly recognized by the system.

if you do not have the option available on the control panel, you need to copy Sysdm.cpl from another system 32-computer folder to the folder built into your embedded system.

hope this helps.

considers

0
source

All Articles