Solved

still reading from the printer

Posted on 1998-02-09
2
240 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
[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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

726 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