Solved

Data Communication through parallel port

Posted on 1997-12-28
5
320 Views
Last Modified: 2008-03-04
How do I program data communication thruogh parallel port
In DOS, C or assemble are OK
If has sample code is better
0
Comment
Question by:ginaa
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 100 total points
ID: 1017446
Use interrupt 17h

void InitPrinter (int printer)
{
union REGS register;

register.h.ah=1;
register.x.dx=printer;
int86(0x17,&register,&register);
}

sendbyte(int printer,unsigned char byte)
{
union REGS register;

register.h.ah=0;
register.l.al=byte;
register.x.dx=printer;
int86(0x17,&register,&register);
}

int getstatus(int printer)
{
union REGS register;

register.h.ah=1;
register.x.dx=printer;
int86(0x17,&register,&register);
return ((int)register.h.ah));
}

0
 

Author Comment

by:ginaa
ID: 1017447
Sorry, I guess I don't say clear
I want to transfer data between two computers through parallel port (like LL3, LL5, DOS' Interlnk...)
I mean can a parallel port works like a serial port?

0
 
LVL 2

Expert Comment

by:PHOENIX
ID: 1017448
If both machines have windows95, use DIRECT CONNECT and a direct connect cable to the parallel ports..
0
 
LVL 10

Expert Comment

by:rbr
ID: 1017449
You can use these functions to work in both directions with these routines. I did this to controll a A/D-converter. You can use the Paper Out, the Busy and the online pin to receive data via the getstatus routine. Connect 3 pins of the 8 data pins with these 3  pins (busy, paper out, online) and vice versa and send the data with send byte.
Status-Byte:
Bit 0: Time out
Bit 4: online
Bit 5: paper out
Bit 7: Busy
0
 

Author Comment

by:ginaa
ID: 1017450
Thank you very much
But do you have any sample code for this, any code in DOS (C,
assembly will be OK)

0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now