473,881 Members | 1,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

serial communication makes windows application too slow

366 Contributor
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 2144
r035198x
13,262 MVP
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 Recognized Expert Expert
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 Contributor
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 Recognized Expert Expert
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.Threadin g.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
7099
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 realise it in c or c++? Thanks
3
3149
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 Base Class Library for Serial Device Communication" but I'm new with VC# and need some basic rules because I have a lot of compilation errors. Where should I create my inherited class? Thank you
4
4744
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 functions frequently in my C++ code. I came to know how to import the windows functions into Visual C#.NET. But what is the method to import windows structure into Visual C#.NET? It will be very helpful for me if anybody can give me the WebID that...
6
2883
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 the first seconds the communication is ok, later i receive read/write error. I?ve been in MSDN site and there i discover that the read/write error is a INVALID_HANDLE problem. But why??? I just create the serial communication file and use it....
4
11214
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. What I would like to do is make the serial port accessible via a web service. The web service and the legacy application would be running on the same machine. The mobile application would access the web service via a network connection. It...
19
11254
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 happen, and how can I send it right ? I'm using vb.net 2005 express with framework 2.0 Thanks for an answear ...
38
9681
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 quite a bit over the web and could not find anything useful. I don't want to use Visual C++ or Cygwin, linux, etc. If any of you guys have some little tid bit of code that would be great to look at.
5
7906
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 use the textbox and submit using thebutton everything works fine. If I use the SerialDataReceivedEventHandler method of the serial port, the application crahes. It seens like that when the serial port triggers and I call the same routines it is...
4
6683
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 any problems. With VB, I have to insert a Sleep(200) to receive all of the data back from my orignal request. Any way to speed this up a bit? The return message is very small. Dim myport As SerialPort = New SerialPort myport.PortName =...
0
9929
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9776
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,...
0
11102
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10719
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10818
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
10403
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
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3225
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.