Solved

still reading from the printer

Posted on 1998-02-09
2
208 Views
Last Modified: 2010-04-10
I asked a question earlier about how to axcess the parrallel port of the computer when programing in Visual C++.  The answer I got back was to use it as I would a normal data file.  The problem I am having is that I am not sure how to treat the data I will be getting from the parallel port.  I am going to be connecting an encoder to the port.  This is going to give me either a high or low signal on the pins of the parallel port.  When I try to read this in how is it going to be represented?  Cam I axcess this information bit by bit from the port?  Would each bit be corrisponding to a particular pin?  Can I read off of some of the pins and write to others?  I am having a hard time understanding the big picture here so any help with a general overview would be helpful, but a detailed answer with examples would be perfered.
0
Comment
Question by:jcoleman012698
2 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1181622
I believe

If you acces the port as a file, you can read bytes (characters) from the file.  Each character represents the 8 data lines put together.  You cannot access the control lines in this way.

If there is no data to read, the read operation indicates that you've reached the end of file.
0
 
LVL 3

Accepted Solution

by:
q2guo earned 100 total points
ID: 1181623
Go to my homepage at http://www.csclub.uwaterloo.ca/u/q2guo/parallel.txt
for a mini faq on accessing the parallel port.  The faq helped
me a lot.  It contains some C source codes.


0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now