Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Ned HELP about Parallel Port Interfacing ....

Status
Not open for further replies.

AEL

Newbie level 4
Newbie level 4
Joined
Jan 15, 2006
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,332
Elo, thanx .. I already have a program in "c++" that can directly write a byte or word into parallel port ... however When i used "Borland C++ Builder 6" the output command is not supported in "Borland C++ Builder 6" ..... do you know how to interfacing i only want to write a byte directly into the paralle port .... using "Borland C++ Builder 6" and an O.S Windows XP !!! Hope u will HELP me ....
 

Hi

You can use IO.DLL, Inpout.dll, or any dll that uses the PC drivers indirectly to access the LPT. I think that IO.DLL is the best here.
 

I have many IO.dll but there are very dificult to understand ... and also there are errors with it especially the unresolved external errors ... do you have the best DLL that can be easily understood and functional ... well i try these link **broken link removed** but its dificult sob ....help

Added after 1 minutes:

I have many IO.dll but there are very dificult to understand ... and also there are errors with it especially the unresolved external errors ... do you have the best DLL that can be easily understood and functional ... well i try these link **broken link removed** the TVicPort but its dificult sob ....help
 

Hi

Go to www.geekhideout.com/iodll.shtml and download IO.DLL, it worked for me using both VB6 and C++, I just wanted to see if it really works or not, and it did.

www.geekhideout.com/downloads/io.zip

C/C++ Prototypes
void WINAPI PortOut(short int Port, char Data);
void WINAPI PortWordOut(short int Port, short int Data);
void WINAPI PortDWordOut(short int Port, int Data);
char WINAPI PortIn(short int Port);
short int WINAPI PortWordIn(short int Port);
int WINAPI PortDWordIn(short int Port);
void WINAPI SetPortBit(short int Port, char Bit);
void WINAPI ClrPortBit(short int Port, char Bit);
void WINAPI NotPortBit(short int Port, char Bit);
short int WINAPI GetPortBit(short int Port, char Bit);
short int WINAPI RightPortShift(short int Port, short int Val);
short int WINAPI LeftPortShift(short int Port, short int Val);
short int WINAPI IsDriverInstalled();

To use IO.DLL with Visual C++/ Borland C++, etc, you'll need to use LoadLibrary and GetProcAddress. Yes, it's more of a pain than using a .lib file, but because of name mangling, it's the only reliable way of calling the functions in IO.DLL. I've gone ahead and done the dirty work for you:

www.geekhideout.com/downloads/io.cpp
www.geekhideout.com/downloads/io.h

Just save these two files and include them in your project. For a Visual C++, you may need to add #include "StdAfx.h" at the top of io.cpp otherwise the compiler will whine at you.

These two files take care of calling LoadLibrary and all the neccessary calls to GetProcAddress, making your life happy once again.

The only step you are required to do is call LoadIODLL somewhere at the beginning of your program. Make sure you do this or you will find yourself faced with all sorts of interesting crashes.

Good Luck
 

Elo

Can you give me a simple code in borland c++ builder 6 ..... just setting the palallel port into 0x01. Is this correct OutPort(0x378,1); Thanx Again .....
 

Hi

I never used borland C++

But I can suggest you download DLPortIO, when installed, you will find two examples in its folder, one for VB, and the other for MVC++, I was working with both of them this morning in order to test the functionality, and I find them a very good starting point for both VB and C++ lovers.

You can download the setup from here:

www.driverlinx.com/DownLoad/DlPortIO.htm


Good luck
 

A WinNT/2k/XP application cannot write directly to an I/O port unless you first install a kernel mode device driver that performs the I/O, or tweaks a Windows access control bit somewhere that gives you access.

I like PortTalk. It includes an easy-to-use program called allowio that you run from the command line. It auto-installs a driver, and then gives any application temporary access to selected I/O ports. Your ordinary in/out opcodes will work.

Lots of info at "Parallel Port Central", including a link to PortTalk:
**broken link removed**

I don't know much about Borland's compiler, but someone said it doesn't include anything like inp() or outp(), and then suggested these little functions. I haven't tried them myself:

Code:
int inp(int port)
{
  __asm  mov  dx,[port]
  __asm  in   al,dx
  return _AX;
}

void outp(int port, unsigned char data)
{
  __asm  mov  dx,[port]
  __asm  mov  al,[data]
  __asm  out  dx,al
}
Those should work if you use them in a program that you've launched with allowio.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top