Solved

Data Communication through parallel port

Posted on 1997-12-28
5
321 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can I interface a standard USB flash drive into a micro-USB port? 9 37
Mouse and Trackpad issue 6 46
Windows 7 Professional 6 61
hp laptop model 10 47
In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
This is about my first experience with programming Arduino.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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