Urgent!! How to read data from the parallel port and time the reading.

Posted on 2003-03-10
Medium Priority
Last Modified: 2010-04-07
I have no experience with VB so any details would be very appreciated. My question is how to read a signal from the parallel port and use a PRECISE timer that starts when a certain signal is read and stops when that signal is read again. When I say precise I mean that I would like the precision on the timer to be up to 1/100th of a second. Please, this is urgent. Thank you
Question by:ztheonly
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

Accepted Solution

yeeeooowww earned 750 total points
ID: 8104166
you should be doing this in vc++...
however ... you can use the timer control... it has a resolution of 55 ms ..

and to read from the parallel port... use the follwing...

Download the following file..

and use the funcation vbOut and vbInp to write data to the parallel port...
this shoudl be pretty straight forward...

if you require more give me until the weekend... I did a project in college on this and I give you the exact code to write bits to the parallel port and read from it too... :)
LVL 22

Expert Comment

ID: 8104207
Open "LPT1:" for input as #1
strPortData = input(1, #1)

Timer1.Enabled = true

You can open the parallel port using #1 above to get a character.  (I don't recall if you need this in a loop-until-data-found or if it hangs until data is received.)

The timer control has resolution in the milliseconds (1/1000.) However, unless this has changed, I think it only went down to 57/1000.  If you want more resolution you can user the Timer API call.

After setting the timer, close your port and continue.  Are you then going to loop back?  Or are you simply going to read one more?  For the first, you probably need to set some flags or a counter so you can track the previous values.

Expert Comment

ID: 8900390
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

766 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