Solved

Handling COM port under NT service

Posted on 1998-03-23
2
166 Views
Last Modified: 2010-04-06
Hi All,

I've got a big problem. I wrote a service under WINNT which      
asks the SERIAL Port, and put the characters into a file.
The problem is, I don't know when is data in the input buffer. My program contains a loop which never ends and the CP usage is nearly 100%. As far as I know, the sender sends a signal which indicates that the data is valid. How can I mask it?
Is there any solution?

Thanks in advance

ANdrew
0
Comment
Question by:bandi081497
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Expert Comment

by:altena
ID: 1360726
Remove the loop, check out the "WaitCommEvent" function
in the Win32 Help/documentation.

You can have the OS "wake your progam" whenever something
interesting happens at the COMM port.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1360727
Hi bandi,

Well, maybe this helps, it is a freeware component! So if you want to write it on your own, be my guest, but then I can't help you. I use this component already a long time and it works perfectly!!! Really I don't think it's nessecarry to put all your time in writing such a component on your own. It's even with source so..... I let it up to you to decide if you want to use this component are not. If not just reject my answer... but really, have first a glimp at it before you do!!!

author : M. Cocco.
E-mail: d3k@mdnet.it
URL   : http://www.mdlive.com/d3k/
--------------------------------------

Regards, Zif.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question