Announcement

Collapse
No announcement yet.

Printer Timeout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lance Edmonds
    replied
    PS, Sonny... your "Sonny" account has been disabled as the rules of the BBS require full names (first + last). Please use your original account that you set up on the 10th Jan. Thanks!


    -------------
    Lance
    PowerBASIC Support
    ( mailto:[email protected][email protected]</A> )

    Leave a comment:


  • Lance Edmonds
    replied
    Here is some of my own code... it sets the retries to 255 (longest timeout for some lazer printers), but you'll probably want to set it to 2 or 3 tries. It takes approx 2 seconds for try (actually DOS performs a "retry" many times for each try that is set with this code...ie, 20 retries takes about 45 seconds.

    Code:
    '***********************************************************************
     
    sub SetPrinterTimeout(byval Port?, SaveTries%) local public
            local RetryAddr%
     
            SaveTries% = 20                         ' Default DOS value
            if Port? < 1 or Port? > 3 then exit sub
     
            RetryAddr% = &H477 + Port?              ' LPTNo = 1 for LPT1, 2 for LPT2, etc.
            def seg = 0                             ' For the peeks and pokes that follow
            SaveTries% = peek(RetryAddr%)           ' Save the current setting
            poke RetryAddr%, 255                    ' Set to 1-255 retries, 0 = infinite
            def seg
    end sub
     
    '***********************************************************************
     
    sub ResetPrinterTimeout(byval Port?, SaveTries%) local public
            Local RetryAddr%, TempSaveTries%
     
            if Port? < 1 or Port? > 3 or SaveTries% < 1 or SaveTries% > 255 then exit sub
            RetryAddr% = &H477 + Port?              ' LPTNo = 1 for LPT1, 2 for LPT2, etc.
            def seg = 0                             ' For the peeks and pokes that follow
            TempSaveTries% = peek(RetryAddr%)       ' Save the current setting
            poke RetryAddr%, SaveTries%             ' Restore the original Retry
            def seg
            swap SaveTries%, TempSaveTries%
    end sub
     
    '***********************************************************************

    -------------
    Lance
    PowerBASIC Support
    ( mailto:[email protected][email protected]</A> )

    Leave a comment:


  • Sonny
    Guest started a topic Printer Timeout

    Printer Timeout

    Whenever my printer is not connected, It takes about 45 sec. for the error message to appear that the printer is off. How do I shorten the time out time to approx. 10-10 seconds?
Working...
X