Solved

Communication with devices connected to serial com or parallel ports

Posted on 1998-09-01
4
202 Views
Last Modified: 2013-11-20
How can I communicte with devices connected to my PC serial
or pralllel ports when developing my application using MFC

Thanks and regards,
Neo
0
Comment
Question by:essneo
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1321587
A process uses the CreateFile function to open a handle to a communications resource. For example, specifying COM1 opens a handle to a serial port, and LPT1 opens a handle to a parallel port.

There is full documentation in the Platform SDK.
Platform SDK\Windows Base Services\Files and I/O\Communications.
0
 

Author Comment

by:essneo
ID: 1321588
Thanks for your answer.

But where can I find the full documentation.

Best regards,
Neo
0
 
LVL 23

Expert Comment

by:chensu
ID: 1321589
It should come with Visual C++. You may search for BuildCommDCB function first and click the Communications Overview link. If you want the latest one, you may install the Platform SDK Jan 1998 on the MSDN CDs. Or you can access the online documentation at http://msdn.microsoft.com/developer/, you need to register first.
0
 
LVL 2

Expert Comment

by:warmcat
ID: 1321590
Ess-oh,

Communication with the serial ports is chensu suggests, and for output using centronics protocol, parallel ports can also be driven by CreateFile() as he says.

For docs on CreateFile, etc, see the help system that comes with Visual C++, or subscribe to MSDN for more data (see http://msdn.microsoft.com/developer/default.htm)

If your peripheral is using any other protocol than centronics nSTB -> nACK/BUSY or using the status lines to read back data, then you must take control of the parallel port yourself.  See http://warmcat.com/parallel for more information.

Regards,

-Andy
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

776 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