Windows – How to access parallel ports created by NET command in Windows XP

networkingparallel portprinterwindows xp

I am trying to get a USB-to-Parallel IEEE-1284 cable which is showed as USB Printing Support in Device manager to work as a LPT port and tried the answer here. Using this command:

NET USE LPT1: \\[Computer-Name]\Printer /PERSISTENT:YES

The command execute successfully but I can't see the LPT1 in Hardware Devices to get the address to write to it. I know the port I create exits because I made a Java application that lists Serial and Parallel ports using RXTX lib, here is the output:

enter image description here

I added all that LPT ports with the NET command because my PC doesn't have any. But I don't see them anywhere to get the address and RXTX lib doesn't allow me to get port address AFAIK. Any ideas how to access ports?

EDIT:

Ok, to clarify things a little, I have a USB-to-Parallel IEEE-1284, when you connect it to a Windows XP machine it is showed as an USB Printing Support device so It doesn't appear as a LPT port because it is designed to work with printers.

I created a Printer with Generic/Text driver and connected it to USB001 port because it is the port of the USB cable. Then I share the printer and create a LPT port using NET command. Now I want to write data to that LPT port as I would do with any other native LPT port using for example InpOut32.dll.

If it is not possible to access the port on that way, how can I get access to the port to write/read raw data to it? Not to print a document but to write/read raw data to it as you would do with any parallel port.

Best Answer

Ok. So you connected a parallel device/printer via a "USB-to-Parallel IEEE-1284"-cable to the USB-port of your computer. Now you need to directly communicate to it. I understand you can't change the software directly to communicate with modern ports like USB001 etc. like the drivers of scanners do. And the software you have needs to communicate by normal protocol for old-LPTx ports (i.e. 0x378 instead of LPT1 etc.)

That leaves you with one option and that is "emulation". This should be done by the driver which came with the "USB-to-Parallel IEEE-1284"-cable. This driver should make a LPTx port and capture port-communication etc. But most (if not all) of these adapters come with drivers who emulate an USB-printer. In most cases this is the easiest (and even in case of old DOS-programs this can be solved with a NET command) but when it comes to real port-communication it is useless.

So you need to find a program that can emulate a LPTx (and its ports) and bidirectionally communicate with (any) USB-driver on your computer. I have not found one (yet).

The only thing useful i found was this Converter From USB To Parallel. This one emulates the LPTx and ports and communicates directly with the adapter. I have not tested this myself but the info-page looks promising. From the help-file:

The USB2LPT device and its driver enables redirecting of port access by random application software to a USB-attached parallel port, i.e. emulating a parallel port via USB. This unique solution works on all USB supporting Windows operating systems.

It does label its own driver as "Driver unstable" but you'll get the idea for what you're looking for. It also needs a special USB2LPT-adapter though. From its faq-page:

Q3. Can I use the USB2LPT.SYS driver with a regular (cheap) USB to parallel printer adapter?
A. Of course not! It's never possible due to design limitations of such adapters. See below.

It also lists as a minus for itself its Reduced speed due to emulation (expect 10..100 times slower). But it will allow communication with Base address same as built-in (378h, 278h). If you like you can make your own adapter. The schematics are all on the site. Here you can find complete instructions (including videos) on how to build one. Or else you can mail him for details on how to get one.

USB2LPT-adapter USB2LPT-adapter Converter From USB To Parallel

Related Question