| RE: .0
My experience with printers has been that if they are set to use
XON/XOFF flow control, typically the printer will merely signal
XOFF to indicate any "not ready" conditions, including buffer full,
paper low/out/jammed, etc.
If such is the case, merely having the printer set up on a standard
VMS print queue would probably do the trick. The Job Controller
will signal the Printer Operator that a current print job is stalled
if an XOFF condition lasts for any substanial length of time. (See
REPLY/ENABLE in help or your DCL Dictionary).
If your printer uses EIA signals to indicate these error
conditions, I have great sympathy for you. In my opinion, it is
difficult to achieve desirable results in your average VAX, which
(again, my opinion) is quite uncooperative in allowing programatic
detection in the change of state of most EIA lines. If I recall
correctly, you can detect signals on DCD (pin 8), DSR (pin 6), CTS
(pin 5), and possibly the pin that indicates "RING" on the modems [on
some devices, access to EIA signals is limited to 1 or two ports].
Programs attempting to implement this sort of stuff will be knee-deep
in AST's and IO$_SENSEMODE QIO's before accomplishing very much.
If your printer maintains something like an error status register
that will be returned to the host on demand (some status-seeking
escape sequence or such) programs to output to the printer device can
range from the simple to the complex, based on your time and needs.
In the simplest case, your program could merely open the port like
a file (RMS, or the 3GL of your choice, and use $PUT / WRITE / PRINT
/ writeln / printf /whatever to send the data to the printer.
If you can stand the wait, you could solicit printer status at the
end of each I/O (tack it onto the end of each record), and then
immediately read the response using a timed read (IO$M_TIMEOUT,
et. al.) if you get an error signal or a timeout, simply report
it and wait. Such a program could be run in batch, and (heaven
help us) even be implemented in DCL!.
Hope this helps.
-- Brian
|