[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

606.0. "?Foreign Printers" by MPGS::ORNSTEIN (Ian Ornstein ) Tue Nov 24 1987 14:41

    On my current project we need to us a direct thermal printer to
    print bar coded labels in a clean room.  The hookup to this printer
    is RS-232 with XON XOFF protocol.  The printer sends signals
    such as low paper suuply or takup reel full.
    
    How do I get these signals back into my program so I can alert
    the operator to take appropriate action?  Since I am not a 
    "systems programmer" my only VMS device exposure is via the
    printer queues.   If the printer was on a microcomputer,
    then I might be able to Hack at it myself.
    
    There is a local label format mode on this printer.
    It is the preferred method.  When satisfied, the user can
    ask the printer to "send" the format to the computer where
    it can be saved and resent to the printer after each power up.
    
    What kind of connection supports this kind of dialogue?
    
    						Thanks,
    						- Ian -
T.RTitleUserPersonal
Name
DateLines
606.1An option or two.DPDMAI::BEATTIEBut, Is BLISS ignorance?Tue Nov 24 1987 19:3339
    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