Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

plt_data(3)

intro(3)

xplot(7)



  plt_ctrl(3)                         CLIX                         plt_ctrl(3)



  NAME

    plt_ctrl, plt_ctrl_nw - Sends a control word to the parallel port

  LIBRARY

    Intergraph Device Library (libix.a)

  SYNOPSIS

    #include <sys/types.h>

    #include <sys/immu.h>

    #include <sys/pop.h>

    #include <sys/xio/xerr.h>

    #include <sys/xio/xio.h>

    int plt_ctrl(
      int interface ,
      int status ,
      int ctrl ,
      int timeout ,
      int pulse );

    int plt_ctrl_nw(
      int interface ,
      int status ,
      int ctrl ,
      int timeout ,
      int pulse ,
      struct xiosb *xiosb ,
      int efn );

  PARAMETERS

    interface   Represents an interface type.  This value defines the signal
                mapping for the target device, which must be one of the types
                listed in <sys/pop.h>:  CENTRONICS, VERSATEC, or
                INTERGRAPH_DIFF.

    status      Specifies a three-bit status mask.  Bits set in the mask
                indicate that the corresponding signals received from the
                target device should be asserted in order for the clear-to-
                send condition to be true.  The format of the status mask is:







  2/94 - Intergraph Corporation                                              1






  plt_ctrl(3)                         CLIX                         plt_ctrl(3)



                                 ___________________________
                                |   2  |     1    |    0   |
                                |______|__________|________|
                                | READY|  NO ERROR|  ONLINE|
                                |   H  |     H    |    H   |
                                |______|__________|________|

    ctrl        Specifies the 16-bit word value sent to the device when the
                clear-to-send condition is true.  Bits 0-7 are data, and bits
                8-15 correspond to the control mask:

                ______________________________________________________________
               |  15 |   14  |   13  |   12  |   11  |   10  |    9  |    8  |
               |_____|_______|_______|_______|_______|_______|_______|_______|
               | NOT |  RESET|  RFFED|  REOTR|  RLTER|  CLEAR|  PICLK|  PRINT|
               | USED|    H  |    H  |    H  |    H  |    H  |    H  |    H  |
               |_____|_______|_______|_______|_______|_______|_______|_______|

    timeout     Specifies the number of 1/60 second intervals to wait for the
                clear-to-send condition before aborting the request.  This
                value is limited to 32767.

    pulse       Indicates whether bit 8 of the control mask (PRINT H) is
                toggled as a control bit or interpreted as a data bit.  If
                pulse is nonzero, the bit is toggled as a control bit.

    xiosb       Points to an xiosb structure updated upon completion of an
                asynchronous request.  The xfcnt member of the structure is
                not used.

    efn         Specifies the event flag number associated with an
                asynchronous request.

  DESCRIPTION

    The plt_ctrl() function provides a mechanism to send a single word,
    specified by ctrl, to a target parallel device by means of the parallel
    port.  When the clear-to-send condition, specified by status, is true, the
    word is sent to the target device.  The clear-to-send condition may never
    become true; thus, a timeout parameter is provided.  The target device's
    interface type and interface must agree for proper signal mapping.  The
    pulse parameter is currently used to control Intergraph multiplexer (MUX)
    devices.

    The plt_ctrl_nw() function is the asynchronous version of plt_ctrl(),
    providing the same capability without waiting for completion of the
    request.  The efn and xiosb parameters are necessary to support
    asynchronous requests.  (See intro(3) for information on asynchronous
    requests.)

  EXAMPLES



  2                                              Intergraph Corporation - 2/94






  plt_ctrl(3)                         CLIX                         plt_ctrl(3)



    To strobe all data and control bits of the parallel port connected to an
    Intergraph differential-type device:

    void exit(), perror();
    if (plt_ctrl(INTERGRAPH_DIFF, 0, 0xffff, 0, 0) !=NULL) {
         perror("plt_ctrl - setting all bits");
         exit(2);
    }
    if (plt_ctrl(INTERGRAPH_DIFF, 0, 0, 0, 0) !=NULL) {
         perror("plt_ctrl - clearing all bits");
         exit(2);
    }


  RETURN VALUES

    If the synchronous request was not accepted by the XIO system, either
    XIO_FAILURE or XIO_DEVICE_FULL is returned.  Upon completion of the
    synchronous request, if the clear-to-send condition never became true, a
    negative status is returned and bits 0-2 of the return value reflect the
    state of the status signals from the target device.  Otherwise, 0 is
    returned.

    If the asynchronous request is accepted by the XIO system, a value of 0 is
    returned.  Otherwise, either XIO_FAILURE or XIO_DEVICE_FULL is returned.
    Upon completion of the asynchronous request, if the clear-to-send
    condition never became true, a negative status is returned in the status
    member of the xiosb structure and bits 0-2 reflect the state of the status
    signals from the target device.  Otherwise, 0 is returned in the status
    member.

  ERRORS

    The plt_ctrl() and plt_ctrl_nw() functions fail if one of the following is
    true:

    [XIO_FAILURE]
           The system does not contain the driver needed to support this
           request or efn is invalid.

    [XIO_DEVICE_FULL]
           Another process is currently using the parallel port or the device
           queue is full.  The current limit of queue slots is 10.

  RELATED INFORMATION

    Functions:  plt_data(3), intro(3)

    Files:  xplot(7)





  2/94 - Intergraph Corporation                                              3




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026