Rules | Recent posts | topic RSS | Search | Register  | Log in

parallel port interfacing with Turbo C++

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Author Message
vkixer



Joined: 26 Jun 2008
Posts: 2
Location: india


Post26 Jun 2008 12:05   parallel port interfacing with Turbo C++

Hi
I want to use the parallel port of my computer to make external electronics work. I am using Turbo C++ in Windows XP. I heard that you have to include inpout32 to make the programme work. Is just placing inpout32.dll in the sytems directory sufficient? If not, how do I call inpout32 from Turbo C++?
Back to top
TekUT



Joined: 17 Jun 2008
Posts: 322
Helped: 22


Post26 Jun 2008 22:30   Re: parallel port interfacing with Turbo C++

inpout32.dll is a dll, to use the methods exposed from this dll you've to load it and then call the desired functions.
Take also a look at this link:

http://www.codeproject.com/KB/vb/Inpout32_read.aspx

Cheers
F.F. a.k.a. Powermos
Back to top
the_risk_master



Joined: 12 Aug 2005
Posts: 671
Helped: 59
Location: UE+MIT, Philippines, (14°N , 120°E )


Post27 Jun 2008 1:56   Re: parallel port interfacing with Turbo C++

Yes vkixer, placing inpout32.dll in the systems directory should be fine (if you did)

You said that your machine runs on winXP, you can also download and install portTalk or UserPort in the software downloads section in this board so can have access to your parallel and serial ports
Back to top
vkixer



Joined: 26 Jun 2008
Posts: 2
Location: india


Post27 Jun 2008 6:07   Re: parallel port interfacing with Turbo C++

thanks
but the link shows programming in VB.
I have added the inpout32.dll to my systems directory
I want to know how to call the requred funtions of inpout32 in turbo C++.
Back to top
TekUT



Joined: 17 Jun 2008
Posts: 322
Helped: 22


Post27 Jun 2008 10:02   Re: parallel port interfacing with Turbo C++

Take a look also to this site.

http://www.hytherion.com/beattidp/comput/pport.htm

Cheers
Pow
Back to top
mezo



Joined: 16 Jul 2007
Posts: 60
Helped: 2
Location: Egypt


Post18 Aug 2008 15:09   Re: parallel port interfacing with Turbo C++

No you don't need any file . i did without the file inpout32.dll.

you just use the functions :inp, outp . knowing the port number .

Here is the code :

#include<stdio.h>
#include<conio.h>

int main(void) {
unsigned port = 0x378 // first pin in parallel port 0x378-0x37f
int value ;
value = outp(port,'c') // c is the number you'll send to LPT
printf("value %c sent to port %d\n", value, port);
return 0 }


send me if you need anything .
Back to top
TekUT



Joined: 17 Jun 2008
Posts: 322
Helped: 22


Post19 Aug 2008 12:40   Re: parallel port interfacing with Turbo C++

mezo wrote:

No you don't need any file . i did without the file inpout32.dll.

you just use the functions :inp, outp . knowing the port number .

Here is the code :

#include<stdio.h>
#include<conio.h>

int main(void) {
unsigned port = 0x378 // first pin in parallel port 0x378-0x37f
int value ;
value = outp(port,'c') // c is the number you'll send to LPT
printf("value %c sent to port %d\n", value, port);
return 0 }


send me if you need anything .


Have tested this code also in WinXP OS?

Thanks
Pow
Back to top
mezo



Joined: 16 Jul 2007
Posts: 60
Helped: 2
Location: Egypt


Post20 Aug 2008 22:44   Re: parallel port interfacing with Turbo C++


Yes , i have tested this code in WinXP Enviroment and it works .
why don't you check it out to be sure ?
Back to top
TekUT



Joined: 17 Jun 2008
Posts: 322
Helped: 22


Post21 Aug 2008 10:50   Re: parallel port interfacing with Turbo C++

@mezo

Thank for reply, I can't test it now simply bcz I've to install the TC++ environment, I've used TC++ some year ago (at my college with DOS based release, I can remember usage of some library extension to code program with windows), now I'm using VC++, but what I need to know is just to be sure about pratical use of the in and out in WinXP environment.

Thank again.

Bye
Pow
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap