I have a number of POS printers and need to automatically recognize the type of the printer. I need do it without using POS.NET or printer drivers. How can I do that?
-
I have read documentation and don't found anything what can help me. – pavel Mar 11 '11 at 07:56
-
You have to have drivers to use a printer. That's how Windows works. Your question doesn't make any sense. How do you propose to communicate with the printer? – Cody Gray - on strike Mar 11 '11 at 08:35
-
I don't know that there is a standard for what you are trying to do. I believe it is device specific. That is why POS for .NET was created, so you don't have to write your own POS device drivers. You may be able to find the POS for .NET drivers for each printer you are trying to interface with, and use .NET Reflector to reverse engineer how the driver is written (although that may be against license - look at the software license for each printer before you do something that may land you in trouble). – Merlyn Morgan-Graham Mar 11 '11 at 08:41
3 Answers
There is no standard way to recognize printers like this.
It's difficult or impossible in the general case (printers may use different COM port configuration - baud rate etc - and different protocols). It's complicated further by the fact that many printers can be configured in different ways by DIP switches or by sending commands.
If you have a reasonably small number of printers to recognize, for all of which you know the correct COM port configuration, you could experiment with sending commands / reading responses to find combinations that allow you to uniquely identify printers among the ones you support.
Many POS printers support variants of the ESC/POS protocol, and responses to status requests (look at each printer's manual) may have differences that enable you to make the distinction.
Of course you will then have an ongoing maintenance headache - each time you want to support a new printer model, you are going to have to again try to find some distinguishing characteristic and update your recognition software.

- 122,218
- 32
- 205
- 338
-
I hoped that is another way available, but I haven't choice it's requirements of my chief – pavel Mar 11 '11 at 10:36
Take a look at this project which supports a lot of POS printers in the source codes:
In the implementation of each printer, you can find recognition subroutine for auto-searching the connected printers.

- 3,881
- 8
- 44
- 83

- 51
- 1
- 8
-
They kill 2.0 version and start 3.0: http://dev.cyberplat.com/redmine/repositories/browse/pt/3.0/src/modules/Hardware/Printers/src – Vendi Spancer Dec 01 '12 at 17:43
Just did a quick google search, maybe you can just list the printers available, an example here: http://www.c-sharpcorner.com/UploadFile/mahesh/printerslisting06072007092859AM/printerslisting.aspx
and here:
How to get Printer Info in .NET?
Not sure if this just lists the installed printers or the ones online?

- 1
- 1

- 24,079
- 20
- 92
- 147
-
My printers is not installed, they just plugged to com port. I can't use this example – pavel Mar 11 '11 at 08:08
-
Does windows not autodetect them and install some kind of generic driver whilst its available? Have you tried doing this? – Mark Redman Mar 11 '11 at 08:11
-
My problem is that i can't install driver. I should work with this printer just using POS commands witch provided in manual to them. – pavel Mar 11 '11 at 08:18
-
If you can only communicate directly using specific commands, I would either look for a command that acknowledges the existance of the printer or more specifically the unique model/name/version/id/serial no of the printer and use that to identify that there is a printer and which one it is. You may need to store the list of identifiers in your own application and look through those to find a match? – Mark Redman Mar 11 '11 at 08:33
-
Unfortunately there are no such commands witch provide information about model/name/version/id/serial – pavel Mar 11 '11 at 08:36
-
1If you have no way to communicate with the printer, what happens if you send a print command and there is an error/response? You could try and use that feedback, If not you may need to go down a manual route, ie number/name the printers and ask the user which printer is attached. – Mark Redman Mar 11 '11 at 08:41