verify that some software is licensed to run on a computer. They are designed to respond when their manufacturer's software talks to them in some special way. At all other times, they are designed to pass all parallel port signals to the printer and vice versa.
Table 15.3 Parallel port registers
Offset | Access | Register |
---|---|---|
0 | Read/Write | Data |
1 | Read only | Status |
Bit 3 | ONLINE | |
Bit 5 | OUT_OF_PAPER | |
Bit 6 | ACK# | |
Bit 7 | BUSY# | |
2 | Read/Write | Control |
Bit 0 | STROBE | |
Bit 2 | INIT# | |
Bit 3 | SELECT | |
Bit 4 | ENABLE_INT | |
Bit 6 | 1 | |
Bit 7 | 1 |
The
1. Open a handle to the WdmIo device. The
2. Disable the interrupts and connect to an interrupt.
3. Initialize the printer.
4. Send commands for writing each byte.
5. Read the status every second until the printer is ready. Time-out after 20 seconds.
6. Write a message to the printer.
7. Get the write results.
8. Disable the interrupt.
9. Close the handle.
HANDLE hPhdIo = CreateFile('\\.\PHDIo\isa\io378,3\irq7\override', GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
Table 15.4 shows the different resource specifiers that may be used as a part of the PHDIo filename. The first specifier must be isa. The other specifiers can be in any order. An I/O port specifier must be given. Use the override specifier with caution and never use it in a commercial release. All letters in the filename must be in lower case.
Table 15.4 PHDIo filename resource elements
Element | Required | Description |
---|---|---|
isa | Mandatory | Initial string: Isa bus |