Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-27-2008, 03:13 AM   #1
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 220

Rep: Reputation: 32
Send data using parallel port...


I have some doubts about how to use parallel port to send data.

I have a program with easy code that I download.

#define base 0x378

// Access parallel port
if (ioperm(base,5,1)){
fprintf(stderr, "Error open parallel port\n");

valor = 0;
outb(valor, direccion);
s_strobe = 1;
outb(s_strobe, direccion+2);
s_strobe = 0;
outb(s_strobe, direccion+2);

Well, with this easy code I can to send data using parallel port, but strobe signal does not change when I send data, so I use two more instruction to generate strobe impulse.

But, I am interesting in send data using parallel port and strobe signal change state automaticly. is there any mode that parallel port send data and strobe signal change state when I send data??

best regards
Old 06-27-2008, 07:23 AM   #2
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
What do you mean 'send data' - if you mean like TCP/IP packets, run a 'PLIP' daemon (parallel port IP).

If you mean you want to change the state of all the port's pins as you please, have a look at the kernel's parallel port code and the supported IOCTLs. Sending data is easy; you can do something as simple as: echo "blah" > /dev/lp0
If you want to check status lines, change state of status lines, etc, you will need to use the IOCTLs. Using 'ioperm' and so on as you are doing is non-portable.

If I recall correctly, there are several options for parallel port drivers - have a look at them all to see which is the most suitable for your purposes.
Old 06-27-2008, 08:20 AM   #3
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 220

Original Poster
Rep: Reputation: 32
Thanks a lot for you answer.

My idea is to send a "packet data" using parallel port.
I do not known PLIP.
I have supposed when I send data by parallel port, strobe signal change its state.

Well, I am going to look for information about PLIP.
Perhpas is better than other option.

Best regards.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Send Data To A Port On An IP? aaron4katie Programming 4 01-16-2007 03:58 AM
is there any shell command to read and write data from parallel and serial port? baosheng Linux - Hardware 2 01-13-2007 08:35 PM
Parallel Port & Serial Port device identification helpmeforlinux Linux - Hardware 3 01-02-2007 01:15 AM
Send HEX info to parallel port thebover Slackware 14 10-12-2004 03:53 PM
How to Send data to the parallel port lambada Programming 2 02-12-2003 09:30 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration