home *** CD-ROM | disk | FTP | other *** search
- Purpose : Disply the status for a LPT port.
- Target : OS/2 2.1 beta (6.498)
- Usage : LPTLED
- there are no command line parameters
-
- This program has NOT been extensively tested.
- Please use it at your own risk.
- The program itself is extremely simple. OTOH, the OS/2 port/spooling
- system is somewhat complex. This readme attempts to explain
- where LPTLED fits into this system and how LPTLED and the system
- interact with each other in different situations. There are many
- paths through the port/spooling system, most of which have not been
- explored while LPTLED is active. Please report any problems or
- curious/unexpected behavior exhibited by LPTLED.
-
- John R Clark 76505,1646
-
- Notes :
- -------
- Using LPTLED on a CAPTURED or USED LPT port has NOT been tested.
- This program has NOT been thouroughly tested on a monitored LPT port.
- The interval at which LPTLED checks status is fixed at 200ms.
-
- Titlebar :
- ----------
-
- The titlebar is used to display the current selections and state :
- LPT : LPT1, LPT2, LPT3
- MODE : File System open (FileSys) or Direct open (Direct)
- STATUS : Attaching, Attached or Unknown
-
- "LPTLED : (NONE):(Unknown):(Unknown)" = not attached to a port.
-
- The client area consists of pushbuttons used to select LPT/MODE, and a
- series of radiobuttons which represent the current LPT status bits.
- Familiarity with the LPT status bits is assumed.
-
- LPT selection :
- ---------------
- Selecting LPT1 - LPT3 will attempt to attach to that port.
- If the port is successfully attached to, the status radiobuttons will
- be enabled and the titlebar will be updated to reflect the current state.
- The default MODE when attaching to a port is FileSys.
-
- MODE selection :
- ----------------
- A full understanding of the different MODES available is essential to the
- proper use of LPTLED.
-
- FileSys - Use the standard file system to open the LPT port.
-
- Spooler enabled :
-
- If the LPT port is associated with a printer queue,
- it is a "spooled" port, and the open will succeed even
- if the physical port does not exist. The status of a
- spooled port will, generally, always be !Busy/Selected
- regardless of the acutal state or existance of the
- port/printer.
- A "phantom" job will appear in the queue when the port
- is opened in this MODE. The job will disappear when the
- port is closed.
-
- If the LPT port is not associated with a printer queue
- then the physical port must exists. In this case, the port
- is not "spooled". The status of a non-spooled port should
- reflect the state of the physical port/printer.
-
- Spooler disabled :
-
- If the physical port does not exist, the open will fail.
- The status should reflect the state of the physical
- port/printer.
-
- An LPT opened in this MODE should be able to be opened by other
- processes in the system.
- If the port can not be opened, it is probably because the port
- does not exist and is not associated with a queue.
-
-
-
- Direct - Use the "direct" file system to open the LPT port.
-
- Use of this mode is the same whether the spooler is on or off.
-
- If the physical port does not exist, the open will fail.
- The status should reflect the state of the physical
- port/printer.
-
- Requests to open the port is this MODE are serialized by the
- system. If other processes in the system have already requested
- the port in this MODE, LPTLED will wait for it's turn at which
- point it will own the resouce and other process will wait.
- LPTLED uses a thread to wait for its access to the port, so if
- another process owns the port, the message queue will not
- be blocked by LPTLED. However, if another program attempts to
- open the port while LPTLED owns it, and it does not use a thread
- to wait for the port, the system may appear to hang.
-
- Depending on the state of the spooler and queue settings (Print
- while spooling, Hold), the process waiting on the port may be
- the printing application or the spooler.
- The spooler appears to use a thread to wait on the resource and
- should not plug the message queue. If LPTLED owns the port and
- the spooler is waiting on the resource, jobs will be held in
- the queue until LPTLED releases the port.
-
- While LPTLED is waiting for the port, the STATE displayed
- in the title bar is "Attaching". There is no way to stop
- LPTLED from waiting for the port except to close the program.
-
- If the port can not be opened, it is probably because the port
- does not exist.
-
- | The manner in which direct opens interact with the port driver
- | also depends on the ring from which the call is made. In this
- | case, the call is made from ring 3.
-
-
- CLEAR selection :
- -----------------
-
- Selecting CLEAR will detach from the current port.
-
-
- Typical configurations :
- ------------------------
-
- "Can OS/2 see my LPT port/printer"
-
- Attach to the desired port and then select Direct MODE.
-
- LPTLED does NOT tell you if the LPT port is fully supported under OS/2.
-
- What it does tell you is :
- - Whether the port can be opened. If LPTLED can attach to the port in
- Direct MODE, then OS/2 sees a physical port.
- - Whether changes made at the printer are recognized by OS/2. If you
- select and deselect the printer from its front panel, and the status
- displayed by LPTLED changes accordingly, then OS/2 has some connection
- with the printer.
-
- What it does NOT tell you is :
- - Whether interrupts are properly supported by the LPT hardware.
- - Anything else.
-
-
- "I want to see the status change as the data goes to the printer."
-
- The easiest way to do this is to disable the spooler and attach to the
- desired LPT port using the FileSys MODE. Note that this LPT port must
- physically exist. If the source of the print job is not a PM app which
- requires a PM driver (command prompt, windows), the spooler can be left
- enabled and the desired LPT port disassociated from all queues. Something
- like 'DIR /S > LPT1', then, would print to the physical port without
- driver intervention and the status would be displayed in "real time".
-
- A sneaky way to accomlish this with the spooler still enabled is to set
- the Output for the destination queue to Print To File. Attach LPTLED to the
- desired port in FileSys MODE. Print from the PM app as you normally would.
- When asked for an output file name, type in the name of the port LPTLED is
- attached to, such as 'LPT1'.
-