473,385 Members | 1,487 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,385 software developers and data experts.

Serial Port Timeout

I have this code to read from a serial port. I set the timeout to 6.5 seconds. Quite often I have an issue where I don't get a response from the device because system resources are being hogged by something else. Alot of times it takes way longer than 6.5 seconds to throw the timeout exception.

Expand|Select|Wrap|Line Numbers
  1.             _serialPort.ReadTimeout = 6500
  2.             Do
  3.                 i = _serialPort.ReadByte
  4.                 bytes.Add(CByte(i))
  5.             Loop Until i = 3 AndAlso _serialPort.BytesToRead = 1
  6.  
Is there a way to lock down the system resources to only be doing this loop?
Nov 16 '09 #1
2 3181
tlhintoq
3,525 Expert 2GB
Read the serial port on its own thread for starters.
Nov 17 '09 #2
Yeah. As soon I posted this, that came to mind. So I set that up and it worked
Nov 17 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. ...
14
by: McBooCzech | last post by:
Hi I am just trying to analyze (parse) data from the serial port (I have connected GPS receiver to the ttyS0, so I can read ASCII characters in the CSV form on the serial port 1). I am doing this...
1
by: ssc | last post by:
I'm new to C#, but have been doing embedded programming for years. I have an application that talks to an embedded radio on the serial port of my PC. I have most of the application running pretty...
4
by: H J van Rooyen | last post by:
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from...
2
by: evle | last post by:
haw to read data from an Infrared Infrared Remote Control
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
2
by: joaquimfpinto | last post by:
Dear All, I made an app in c# that uses several serial ports. For the serial ports I use a pnp Sunix board, some with 8 serial ports other with 4 or even 2 serial ports. Whenever I use the...
4
by: rowan | last post by:
I'm writing a driver in Python for an old fashioned piece of serial equipment. Currently I'm using the USPP serial module. From what I can see all the serial modules seem to set the timeout when...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
2
by: mmrasheed | last post by:
Hi, I am newbie in python. I am working on Telit GM862 GPS/GPRS module which has python interpreter built in. But it seems this problem is pretty much related to general python structure. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.