Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gpib_read(3)

gpib_write(3)

gpib_cancel(3)

intro(3)

xgpib(7)



  gpib_cmd(3)                         CLIX                         gpib_cmd(3)



  NAME

    gpib_cmd, gpib_cmd_nw - Sends commands to a General Purpose Interface Bus
    (GPIB) channel

  LIBRARY

    Intergraph Device Library (libix.a)

  SYNOPSIS

    #include <sys/types.h>

    #include <sys/immu.h>

    #include <sys/xio/xio.h>

    #include <sys/xio/xerr.h>

    #include <sys/xio/xgpib.h>

    int gpib_cmd(
      int channel ,
      char *cmd ,
      int ccnt ,
      int timeout );

    int gpib_cmd_nw(
      int channel ,
      char *cmd ,
      int ccnt ,
      int timeout ,
      struct xiosb *xiosb ,
      int efn );

  PARAMETERS

    channel   An integer representing a BPIB channel

    cmd       A pointer to a GPIB command

    ccnt      The number of byte messages to transfer

    timeout   The number of 1/60 second intervals to wait before aborting the
              request

    xiosb     A pointer to an xiosb structure

    efn       The event number associated with the transfer request

  DESCRIPTION



  2/94 - Intergraph Corporation                                              1






  gpib_cmd(3)                         CLIX                         gpib_cmd(3)



    The gpib_cmd() function sends device-specific General Purpose Interface
    Bus (GPIB) command sequences directly to the GPIB channel.  The controller
    is placed in the active state before sending the commands and remains in
    the active state upon completion.

    The cmd points to an array of GPIB messages, while ccnt reflects the
    number of byte messages to be transferred.  The user is responsible for
    ensuring the validity of GPIB messages, listener addresses, and talker
    addresses.

    If an abort timeout is desired, timeout contains the number of 1/60 second
    intervals the driver waits before aborting the request.  A value of 0
    disables the timeout mechanism.

    The gpib_cmd_nw() is the asynchronous version of gpib_cmd(), providing the
    same capability without waiting for completion of the request.  The efn
    parameter is the event flag number associated with the request.  The xiosb
    parameter is a pointer to the xiosb structure updated upon completion of
    the request (see intro(3)).  The xfcnt member of the xiosb structure
    indicates the number of bytes transmitted.

  RETURN VALUES

    Upon successful completion of the synchronous request, a value of 0 is
    returned.  Otherwise, one of the following failure codes is returned.

    If the asynchronous request is accepted by the XIO system, a value of 0
    will be returned by the request.  Otherwise, XIO_FAILURE will be returned.
    Upon completion of an accepted request, the status member of the xiosb
    structure will be set to either 0 if successful, or to one of the
    following failure codes if unsuccessful.

  ERRORS

    The gpib_cmd() and gpib_cmd_nw() functions will 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.

    [GPIB_OUT_OF_RANGE]
           The specified channel is beyond the maximum allowed.

    [GPIB_NOT_OPEN]
           The specified channel is not open.

    [GPIB_NOT_OWNER]
           The specified channel is currently open by another process.

    [GPIB_CANCELED]



  2                                              Intergraph Corporation - 2/94






  gpib_cmd(3)                         CLIX                         gpib_cmd(3)



           The request was canceled by gpib_cancel(3A).

    [GPIB_TIMEOUT]
           A timeout occurred before the request completed.

    [BAD_DATA_BUFFER_ADDRESS]
           The cmd parameter points to an invalid memory address.

    [BAD_DATA_BUFFER_SIZE]
           The command count ccnt is incorrect.

  RELATED INFORMATION

    Functions:  gpib_read(3), gpib_write(3), gpib_cancel(3), intro(3)

    Files:  xgpib(7)






































  2/94 - Intergraph Corporation                                              3




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