DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 02 Aug 2007 15:54:12 -0700,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    Bradley Remedios


Excessive Delay with Compact Framework 2.0 and System.IO.Ports.SerialPort   
Hello all,

Under Compact Framework 2.0 (using C#) I use the
System.IO.Ports.SerialPort data that is being read from the serial
port can take up to 6 seconds to read (after its actually received.)
This result is the same regardless of whether I loop the serial port
back on itself or communicate with an external device.

I've tried using SerialPort.ReadByte, SerialPort.Read and the
DataReceived Event.  I really want to be able to use the DataReceived
event as it fits more with the design of the software.  However at
this point, if one of the other ones can be made to work, I'll use it.

I've checked the rx/tx lines with a scope to verify the timing and
setup of the port.  The output on the tx is correct, the input on the
rx looks correct and the input on the rx is confirmed to arrive about
6 seconds before it shows up in software.  All verified with an
Oscilloscope.

The code (with the serial port looped back on itself) works under
Windows XP Pro with the .Net Framework 2.0.  So I figure that the
problem is likely either in the embedded device trying buffering too
much data (and not firing the event until a long long 6 second timeout
elapses) or something else is going wrong.

I've also tried messing with the ReadTimeout property but have not had
any success.

Does anyone have any ideas or has seen this before?  My next step is
to use the Win32 APIs to try and determine where the fault lies
(whether its at the Compact Framework or OS level.)

My Settings:
  SerialPort.BaudRate = 9600;
  SerialPort.ParityReplace = 0xaa;
  SerialPort.DataBits = 8;
  SerialPort.Handshake = Handshake.None
  SerialPort.ReceivedBytesThreshold = 1;    // Originally not set, set
to see if it would help.
  SerialPort.StopBits = StopBits.One
  SerialPort.Parity = Parity.Mark

Thank you for any help you may have.
Date:Thu, 02 Aug 2007 15:54:12 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us