473,734 Members | 2,375 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 2140
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
7092
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
3146
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
4736
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
2871
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
11200
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
11227
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
9659
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
7902
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
6672
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
9449
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
9310
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...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
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.