?
Solved

Serial Port Timer

Posted on 1997-11-30
2
Medium Priority
?
239 Views
Last Modified: 2010-04-04
I need to test for closure between two pins on Com2 and set a timer between the 'clicks'.  The timer is easy enough, but I don't know how to test for input from the serial port. I am currently using an old DOS program to do this with pins 2 and 5.
0
Comment
Question by:emcdaniel
[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 8

Expert Comment

by:ZifNab
ID: 1352436
Input from commport or only from pin 2 and 5?

Like always, a lot of compenents are already on the net for input from a commport. And a lot are good ones. The one I use and I find it very good, calls TCommPortDriver. You can find it on Torry's delphi pages. It's freeware.

Have fun,
c.u. ZifNab;
0
 
LVL 3

Accepted Solution

by:
altena earned 200 total points
ID: 1352437
Look up the "WaitCommEvent" functio in the Win32 API.

You should span 1 thread to monitor the Comm port.
Waitcommevent will allow you to time anything you want to time.

Good Luck.
0

Featured Post

Independent Software Vendors: 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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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