How to Read Response sent by LAN Printer


Joined
Nov 4, 2011
Messages
2
Reaction score
0
Hi

I have written a language monitor to print and get status from my LAN printer. I am able to print on my LAN printer; however I am not able to read response sent by the printers. I am using wireshark (LAN monitor s/w) and I can see printer has responded to my command in wireshark (LAN monitor s/w), but when I go to read response by using "fn.pfnReadPort" port monitor - it returns with zero bytes read.

Before sending the command to the printer I call "fn.pfnStartDocPort" port monitor function, then “fn.pfnWritePort" to send then command and finally "fn.pfnReadPort" to read the response.

fn.pfnReadPort fails with error code 50 “The request is not supported.” – It seems we should not use fn.pfnReadPort (port monitor) to read response over LAN.

When I created network port I had selected Device type as Standard -->"Generic Network Card"

I also tried configuring printer as described in http://uis.georgetown.edu/software/documentation/winxp/winxp.network.printer.html
but then also it didn't work.

After configuring the printer as described in above the link - I changed "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\<Printer Name>\Monitor" to My monitor name.

Please suggest me, how to read response from printer.

Regards,
Suman



 
Ad

Advertisements

Joined
Nov 15, 2011
Messages
1
Reaction score
0
Hi,
I am also writing a language monitor for a printer on network.
It seems that MS Driver doesn't support bidirectional comunication, so you can only write your command to printer but you can't read the answer. I think that you need to write a port monitor (dll) that open a socket on your network and use it inside your language monitor for the comunication between L.M. and printer (insted of fn.pfnWritePort/fn.pfnReadPort). I have to do the same work next weeks.
If anybody has another idea, please post it.
Thanks in advanced.
Val
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top