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.

parallel port interfacing with Turbo C++

Status
Not open for further replies.

vkixer

Newbie level 2
Joined
Jun 26, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,302
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++?
 

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:

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

Cheers
F.F. a.k.a. Powermos
 

    vkixer

    Points: 2
    Helpful Answer Positive Rating
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
 

    vkixer

    Points: 2
    Helpful Answer Positive Rating
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++.
 

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 .
 

parallel port programming in c++

mezo said:
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
 

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 ?
 

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
 

Can u send me code in visual C++ for parallal port interfacing in Win Xp.....
 

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
 

i use this code & it's run
bt it's always high all LEDs r high
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top