| Author |
Message |
vkixer
Joined: 26 Jun 2008 Posts: 2 Location: india
|
26 Jun 2008 12:05 parallel port c++ xp |
|
|
|
|
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: 413 Helped: 23
|
26 Jun 2008 22:30 parallel port interfacing 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 |
|
 |
Google AdSense

|
26 Jun 2008 22:30 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
the_risk_master
Joined: 12 Aug 2005 Posts: 688 Helped: 59 Location: UE+MIT, Philippines, (14°N , 120°E )
|
27 Jun 2008 1:56 parallel port 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
|
27 Jun 2008 6:07 turbo c++ parallel port |
|
|
|
|
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: 413 Helped: 23
|
|
| Back to top |
|
 |
mezo
Joined: 16 Jul 2007 Posts: 82 Helped: 4 Location: Egypt
|
18 Aug 2008 15:09 parallel port programming in 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: 413 Helped: 23
|
19 Aug 2008 12:40 parallel port programming in 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: 82 Helped: 4 Location: Egypt
|
20 Aug 2008 22:44 parallel port turbo c win xp |
|
|
|
|
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: 413 Helped: 23
|
21 Aug 2008 10:50 parallel port in 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 |
|
 |
genious_us
Joined: 13 Oct 2009 Posts: 1 Location: pakistan
|
13 Oct 2009 16:13 Re: parallel port interfacing with Turbo C++ |
|
|
|
|
| Can u send me code in visual C++ for parallal port interfacing in Win Xp.....
|
|
| Back to top |
|
 |
trushar_mechatronics
Joined: 07 Jun 2008 Posts: 2
|
21 Oct 2009 18:43 Re: parallel port interfacing with Turbo C++ |
|
|
|
|
Dear Mezo,
I have tested your code. It works. But there are some problems. I want your help to solve these problems.
For any value, I am turining on Seven segment LED. I am getting correct results bt it is displayed after completion of program and mostly I need to run the program twice.
Other problem I am facing is I have made soft counnter using your hint bt it is not working.
Can you send me the solution?? I will be very thankful to you.
I also request you to send your personal email id so that I can send you d code for second problem.
I have uploaded image of first program.
Thank you.
Trushar Shah
|
|
| Back to top |
|
 |