Language Monitor and Port Monitor Relationships
In general, port monitor components deal with the relatively low-level communications protocol between the printer and computer. Language monitors deal with a higher-level communications exchange between printer and computer, as described in the section above.
Fundamental ideas about monitor components in the Windows 95 spooler architecture are:
- At least one port monitor component is required for the spooler to output print jobs, while language monitors are completely optional.
- Only port monitors send and receive signals through the hardware port a printer is connected to.
- Only language monitors are able to parse the strings of data read from a port with a bidirectional printer attached. The language monitor calls the port monitor ReadPort or GetPrinterDataFromPort functions to get data from a bidirectional printer. The port monitor ReadPort and GetPrinterDataFromPort functions read any data available from the printer and pass that data back to the language monitor without changing it in any way and it is up to the language monitor to interpret the meaning of the data from the printer. The language monitor should use a GetPrinterDataFromPort function call if the bidirectional printer supports the IEEE 1284 standard; otherwise, it should use a ReadPort call. The language monitor can call either of these port monitor functions from a background thread on a periodic basis (say every few seconds), using a timer, to read unsolicited status information from a bidirectional printer. The source code for the sample language monitor supplied with the DDK, PJLMON, contains code that implements reading unsolicited printer status information in this way.
The spooler architecture diagram in Typical Printing Process Scenario Using a Raw Spool File illustrates these principles. It shows a spooler with one port monitor and one language monitor, and only the port monitor sends and receives through the hardware port. A diagram that showed the relationship between spooler components when the only local target printer is nonbidirectional would probably not show a language monitor component.
Note that it is possible to integrate the language monitor functionality and port monitor functionality into one component.