473,407 Members | 2,676 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,407 software developers and data experts.

serial communication makes windows application too slow

366 256MB
Hi friends ,

after a long busy work happy to back to forums,

i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external device(energy meter in my case) and have to get data from the that device . approximately the time to read complete data frfom meter is 10 minutes(may be more also up to one hour in some cases) ,during this time my application is not allowing the user to do other jobs ,some times my mouse pointer is not visible ,what i think is all the system resources are being utilized by this application .

is there any other solution so that even my application is running ,the user should be able to do other jobs .

i observed that all application which i have developed specially for serial communication has the same problem . Even i am unable to display a label (for indicating status ) for user indicating that process is in running .


Any one there for any suggestion.

Thanks
nmsreddi
Jun 3 '08 #1
4 2110
r035198x
13,262 8TB
Hi friends ,

after a long busy work happy to back to forums,

i have developed a windows application(C#2,0) for serial communication. the aim of my application is to connect to external device(energy meter in my case) and have to get data from the that device . approximately the time to read complete data frfom meter is 10 minutes(may be more also up to one hour in some cases) ,during this time my application is not allowing the user to do other jobs ,some times my mouse pointer is not visible ,what i think is all the system resources are being utilized by this application .

is there any other solution so that even my application is running ,the user should be able to do other jobs .

i observed that all application which i have developed specially for serial communication has the same problem . Even i am unable to display a label (for indicating status ) for user indicating that process is in running .


Any one there for any suggestion.

Thanks
nmsreddi
Are you using a separate thread for the connection?
Jun 3 '08 #2
Plater
7,872 Expert 4TB
I would guess that you have a loop performing I/O.
I/O calls get a pretty good priority, so if you're performing them in a loop (like checking to see if there is data available on the serial port) then you are effective locking down the system since you are demanding high priority actions continuously.
Jun 3 '08 #3
nmsreddi
366 256MB
I would guess that you have a loop performing I/O.
I/O calls get a pretty good priority, so if you're performing them in a loop (like checking to see if there is data available on the serial port) then you are effective locking down the system since you are demanding high priority actions continuously.
Hi friends,
thanks to all for your reply ,

what you expected is correct ,i am performing a loop operation to check for the incomming data .i am not using any separate threads for that in my application .

can you suggest any best way to overcome the situation.

is threading the only solution for this? or is there any other best way other than threading. because some times threading makes application too complex and unhandled situations may arise.

Any suggestions Please

Thanks
nmsreddi
Jun 6 '08 #4
Plater
7,872 Expert 4TB
Well you can have your loop thread sleep for a short amount of time inside the loop, to give time to other applications.
You could also use a System.Threading.Timer to only call the check for data available every X amount of time (X is configurable in the Timer object). Those happen on a seperate thread as well.
Jun 9 '08 #5

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

Similar topics

11
by: sarah | last post by:
hI, I have a project. I need to realise serial communication between PC and Altera FPGA in c or c++. The function of FPGA is working well. it can send data to uart. Does anybody know how to...
3
by: carmen | last post by:
I'm working in an aplication for a Smart Device that need to "talk" with a printer continuosly through the serial port. I'm trying to use the John Hint's sample code "Use P/Invoke to develop a .NET...
4
by: Vidya Bhagwath | last post by:
Hello Experts, I am porting the C++ code into the Visual C#.NET. My C++ code is mainly based on the serial communication. So I am using the windows structure such as DCB.. etc and the windows...
6
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
19
by: ... | last post by:
Hi I need to send a chr(255) to a serial port. When I send it, through comm.write (chr(255)) it sends a chr(63) ... in Hex, I write chr(&FF) and it actually sends chr(&3F) ... why does this...
38
by: shussai2 | last post by:
Hi, I am trying to access Serial Port in XP. I am using Dev-C++ IDE that uses Mingw as a compiler. I just want to know how I can open up serial port on COM1 and write some data. I have searched...
5
by: Mo | last post by:
Hi, I have an application where I read a serial port data from a barcode and set the labels on a form. I also have a textbox and button where you can enter the data and here is the problem. if I...
4
by: =?Utf-8?B?RG91ZyBE?= | last post by:
Hey all- I am pretty new to serial communication, but from what I am experiencing it is a little slow in VB.net (2.0). Using other tools I can communicate with my hardware extreamly fast without...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.