home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 19 Printer / 19-Printer.zip / LPTLED.ZIP / README.LPT < prev   
Text File  |  1993-04-22  |  7KB  |  163 lines

  1. Purpose : Disply the status for a LPT port.
  2. Target  : OS/2 2.1 beta (6.498)
  3. Usage   : LPTLED
  4.           there are no command line parameters
  5.  
  6. This program has NOT been extensively tested.
  7. Please use it at your own risk.
  8. The program itself is extremely simple. OTOH, the OS/2 port/spooling
  9. system is somewhat complex. This readme attempts to explain  
  10. where LPTLED fits into this system and how LPTLED and the system
  11. interact with each other in different situations. There are many
  12. paths through the port/spooling system, most of which have not been
  13. explored while LPTLED is active. Please report any problems or
  14. curious/unexpected behavior exhibited by LPTLED. 
  15.  
  16. John R Clark 76505,1646
  17.  
  18. Notes :
  19. -------
  20. Using LPTLED on a CAPTURED or USED LPT port has NOT been tested. 
  21. This program has NOT been thouroughly tested on a monitored LPT port.
  22. The interval at which LPTLED checks status is fixed at 200ms.
  23.  
  24. Titlebar :
  25. ----------
  26.  
  27. The titlebar is used to display the current selections and state :
  28.    LPT    : LPT1, LPT2, LPT3
  29.    MODE   : File System open (FileSys) or Direct open (Direct)
  30.    STATUS : Attaching, Attached or Unknown
  31.  
  32.    "LPTLED : (NONE):(Unknown):(Unknown)" = not attached to a port.
  33.  
  34. The client area consists of pushbuttons used to select LPT/MODE, and a
  35. series of radiobuttons which represent the current LPT status bits.
  36. Familiarity with the LPT status bits is assumed.
  37.  
  38. LPT selection :
  39. ---------------
  40. Selecting LPT1 - LPT3 will attempt to attach to that port.
  41. If the port is successfully attached to, the status radiobuttons will
  42. be enabled and the titlebar will be updated to reflect the current state.
  43. The default MODE when attaching to a port is FileSys.
  44.  
  45. MODE selection :
  46. ----------------
  47. A full understanding of the different MODES available is essential to the
  48. proper use of LPTLED.
  49.  
  50.    FileSys - Use the standard file system to open the LPT port.
  51.  
  52.              Spooler enabled :
  53.    
  54.                 If the LPT port is associated with a printer queue, 
  55.                 it is a "spooled" port, and the open will succeed even 
  56.                 if the physical port does not exist. The status of a 
  57.                 spooled port will, generally, always be !Busy/Selected 
  58.                 regardless of the acutal state or existance of the
  59.                 port/printer.
  60.                 A "phantom" job will appear in the queue when the port
  61.                 is opened in this MODE. The job will disappear when the 
  62.                 port is closed.
  63.  
  64.                 If the LPT port is not associated with a printer queue 
  65.                 then the physical port must exists. In this case, the port 
  66.                 is not "spooled". The status of a non-spooled port should 
  67.                 reflect the state of the physical port/printer.
  68.  
  69.              Spooler disabled :
  70.  
  71.                 If the physical port does not exist, the open will fail.
  72.                 The status should reflect the state of the physical 
  73.                 port/printer.
  74.  
  75.              An LPT opened in this MODE should be able to be opened by other 
  76.              processes in the system.
  77.              If the port can not be opened, it is probably because the port
  78.              does not exist and is not associated with a queue.
  79.  
  80.  
  81.  
  82.    Direct  - Use the "direct" file system to open the LPT port.
  83.  
  84.              Use of this mode is the same whether the spooler is on or off.
  85.  
  86.                 If the physical port does not exist, the open will fail.
  87.                 The status should reflect the state of the physical 
  88.                 port/printer.
  89.              
  90.              Requests to open the port is this MODE are serialized by the 
  91.              system. If other processes in the system have already requested
  92.              the port in this MODE, LPTLED will wait for it's turn at which
  93.              point it will own the resouce and other process will wait.
  94.              LPTLED uses a thread to wait for its access to the port, so if
  95.              another process owns the port, the message queue will not
  96.              be blocked by LPTLED. However, if another program attempts to 
  97.              open the port while LPTLED owns it, and it does not use a thread
  98.              to wait for the port, the system may appear to hang.
  99.  
  100.              Depending on the state of the spooler and queue settings (Print 
  101.              while spooling, Hold), the process waiting on the port may be 
  102.              the printing application or the spooler. 
  103.              The spooler appears to use a thread to wait on the resource and
  104.              should not plug the message queue. If LPTLED owns the port and 
  105.              the spooler is waiting on the resource, jobs will be held in
  106.              the queue until LPTLED releases the port.
  107.  
  108.              While LPTLED is waiting for the port, the STATE displayed
  109.              in the title bar is "Attaching". There is no way to stop
  110.              LPTLED from waiting for the port except to close the program.
  111.  
  112.              If the port can not be opened, it is probably because the port
  113.              does not exist.
  114.  
  115.              | The manner in which direct opens interact with the port driver
  116.              | also depends on the ring from which the call is made. In this
  117.              | case, the call is made from ring 3.
  118.  
  119.  
  120. CLEAR selection :
  121. -----------------
  122.  
  123. Selecting CLEAR will detach from the current port.
  124.  
  125.  
  126. Typical configurations :
  127. ------------------------
  128.  
  129. "Can OS/2 see my LPT port/printer"
  130.  
  131. Attach to the desired port and then select Direct MODE.
  132.  
  133. LPTLED does NOT tell you if the LPT port is fully supported under OS/2.
  134.  
  135. What it does tell you is :
  136. - Whether the port can be opened. If LPTLED can attach to the port in 
  137.   Direct MODE, then OS/2 sees a physical port.
  138. - Whether changes made at the printer are recognized by OS/2. If you 
  139.   select and deselect the printer from its front panel, and the status 
  140.   displayed by LPTLED changes accordingly, then OS/2 has some connection
  141.   with the printer.
  142.  
  143. What it does NOT tell you is :
  144. - Whether interrupts are properly supported by the LPT hardware.
  145. - Anything else.
  146.  
  147.  
  148. "I want to see the status change as the data goes to the printer."
  149.  
  150. The easiest way to do this is to disable the spooler and attach to the 
  151. desired LPT port using the FileSys MODE. Note that this LPT port must 
  152. physically exist. If the source of the print job is not a PM app which 
  153. requires a PM driver (command prompt, windows), the spooler can be left 
  154. enabled and the desired LPT port disassociated from all queues. Something 
  155. like 'DIR /S > LPT1', then, would print to the physical port without 
  156. driver intervention and the status would be displayed in "real time".
  157.  
  158. A sneaky way to accomlish this with the spooler still enabled is to set
  159. the Output for the destination queue to Print To File. Attach LPTLED to the 
  160. desired port in FileSys MODE. Print from the PM app as you normally would. 
  161. When asked for an output file name, type in the name of the port LPTLED is
  162. attached to, such as 'LPT1'.
  163.