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 programming, help needed!

Status
Not open for further replies.

gvanto

Member level 1
Joined
Aug 17, 2004
Messages
41
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,286
Activity points
442
dev c++ parallel port programming

I am trying to use the following code (which I found from a dataloggin article, https://www.phanderson.com/printer/ltc1392/ltc1392.html) to output a simple byte onto my parallel port. I am using Dev-Cpp under WinXP. The compiler gives an error saying "outportb undeclared function" - I thought I had included the right header files...

I am trying to build a simple function generator / audio output device based on the article by this finnish guy:

**broken link removed**

he has supplied the hardware for it but the software i would like to write myself in Dev-Cpp if possible (should be I would have thought)...now, how to access that parallel port...

any help very appreciated...
- - - - - - - - - - - - - -

#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <dos.h>

#define DATA 0x0378

using namespace std;
typedef unsigned char byte;

byte data = 0x00; /* note that data is global */

int main(int argc, char *argv[])
{
data = 0x04;
outportb(DATA, data);

system("PAUSE");
return EXIT_SUCCESS;
}
 

devcpp parallel port example

Google finds a discussion on a mailing list about this problem.

**broken link removed**

And please read the thousands of previous discussions about parallel port access when you find that by default windows XP won't let you acccess the port.
 

parallel port in windows xp+dev c++

Hi:
I am from Cuba so my inglish is not very good.

This program is fine for Win9x, but for NT, 2000 or XP it will not work. The function "outportb" is now obsolete.

To access to the parallel port I have used Windriver, it is very easy to use and it's librarys can be combined with any C or C++ compiler.
 

    gvanto

    Points: 2
    Helpful Answer Positive Rating
parallel port programming for dev c++

Ronny,

Thanks for your help. MAy I ask where you got hold of this Windriver (have googled it but cant seem to find anything on it)?

do you perhaps have an example of C/C++ code which writes to the parrallel port?

Many thanks,
frustrated-gvanto
 

dev cpp parallel port

I do C and don't know much of C++.
you'll get that error message if you do not include the relevant header files... I see your iostream and cstdlib don't have the .h extension?
probably that's the problem...
 

thanks but no that wasnt the problem...(says it cant locate header file when i include .h extension)

May I ask: HAve you ever programmed a par. port in C++ in Win-Xp? If so how did you do it? I just cant find anywhere which explains how to do it in XP because of some security issues...

regards,
gvanto
 

I have never come across a detailed method of parallel port programming in xp myself, hope someone in this forum does...
I plan to do an interface project and i'll be using win 98.
 

throwaway18's answer looks good. It links to this important point:
For Dev-C++, the functions are "_outp()" and "_inp()".

Of course, those functions will be blocked by the operating system unless you circumvent the protection by using something like AllowIO, or by using a kernel-mode port-access device driver such as PortTalk. The example at the end of porttalk.pdf looks helpful and easy, although I haven't tried it. (I wrote my own port access device driver and helper DLL.)
 

Hi:

You can get a free download of windriver 7.0 in the site

**broken link removed**

this is a demo version but a can get yo a proffessiona one of windriver 6.0.

A will send you the next tuesday a program sample that access to the parallel port. With this tool you can make program to access to PCI, USB, and mani oders interfaces.

good luck...
 

Hi there:

I am sending you a sample code a the ready to run program and driver, I hope it helps you on your research. Form a better understanding you must read the file readme.txt on the .rar file that I am attaching you in this message. If you decide to work with Windriver I can attach the 6.03 full version to (almost 10MB).

Salutations,

Ronny

PD: Will be easier to me if we talk by email. ronny@icid.cu
 

    gvanto

    Points: 2
    Helpful Answer Positive Rating
Here is a little program that bypasses win xp and win 2000 hal and lets you talk to any port you like.
You can use it to control the parallel port.
 

thanks ronny_gm for your support. please see my new question (new thread, same subject title)

regards,
gvanto
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top