/******************************************************************************
 *
 * Structures used by the init routines to fill in the onst, twst,... and the
 * onvl, twvl,... fields in MBBI and MBBO record types.
 *
 * Note that the intExtSsBm and intExtSsBmStop structures use the same
 * intExtSsBmStopList and intExtSsBmStopVal lists but have a different number
 * of elements in them that they use... The intExtSsBm structure only represents
 * 4 elements, while the intExtSsBmStop structure represents 5.
 *
 ******************************************************************************/

static char                *MIX_IOList[] = { "CH1-CH2" ,"CH1-REF" ,"CH2-REF" };
static unsigned long       MIX_IOVal[] = { 0 ,1 ,2 };
static struct devGpibNames MIX_IO = { 3, MIX_IOList, MIX_IOVal, 2 };

/******************************************************************************
 *
 * String arrays for EFAST operations.  Note that the last entry must be 
 * NULL.
 *
 * On input operations, only as many bytes as are found in the string array
 * elements are compared.  If there are more bytes than that in the input
 * message, they are ignored.  The first matching string found (starting
 * from the 0'th element) will be used as a match.
 *
 * NOTE: For the input operations, the strings are compared literally!  This
 * can cause problems if the instrument is returning things like \r and \n
 * characters.  You must take care when defining input strings so you include
 * them as well.
 *
 ******************************************************************************/

static char *(MIX_IN[])={"INP:1,2\r\n","INP:1,3\r\n","INP:2,3\r\n",NULL};
static char *(MIX_OUT[])={"SINP:1,2\r\n","SINP:1,3\r\n","SINP:2,3\r\n",NULL};

/******************************************************************************
 *
 * Array of structures that define all GPIB messages
 * supported for this type of instrument.
 *
 ******************************************************************************/

static struct gpibCmd gpibCmds[] = { 

    /* CMMAND 0 read_at_ch1 */
  {&DSET_LI, GPIBREAD, IB_Q_LOW, "RAT1\r\n", "AT1:%ld\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 1 read_at_ch2 */
  {&DSET_LI, GPIBREAD, IB_Q_LOW, "RAT2\r\n", "AT2:%ld\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 2 read_ch1_level */
  {&DSET_AI, GPIBREAD, IB_Q_LOW, "RCH1\r\n", "CH1:%lf\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 3 read_ch2_level */
  {&DSET_AI, GPIBREAD, IB_Q_LOW, "RCH2\r\n", "CH2:%lf\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 4 read_signal_in */
  {&DSET_MBBI, GPIBEFASTI, IB_Q_LOW, NULL, NULL, 0, 32, NULL, 0, 0, MIX_IN, &MIX
_IO, -1 },

    /* CMMAND 5 read_phase */
  {&DSET_AI, GPIBREAD, IB_Q_LOW, "RPHV\r\n", "PHV:%lf\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 6 read_ref_level */
  {&DSET_AI, GPIBREAD, IB_Q_LOW, "RREF\r\n", "REF:%lf\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 7 read_samp_num */
  {&DSET_LI, GPIBREAD, IB_Q_LOW, "RSAM\r\n", "SAM:%ld\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 8 read_temp */
  {&DSET_AI, GPIBREAD, IB_Q_LOW, "RTEM\r\n", "TEM:%ld\r\n", 0, 511, NULL, 0, 0, 
NULL, NULL, -1 },

    /* CMMAND 9 read_ver */
  {&DSET_SI, GPIBREAD, IB_Q_LOW, "RVER\r\n", "%s\r\n", 0, 511, NULL, 0, 0, NULL,
 NULL, -1 },

    /* CMMAND 10 set_at_ch1 */
  {&DSET_LO, GPIBWRITE, IB_Q_LOW, NULL, "SAT1:%ld\r\n", 0, 32, NULL, 0, 0, NULL,
 NULL, -1 },

    /* CMMAND 11 set_at_ch2 */
  {&DSET_LO, GPIBWRITE, IB_Q_LOW, NULL, "SAT2:%ld\r\n", 0, 32, NULL, 0, 0, NULL,
 NULL, -1 },

    /* CMMAND 12 set_signal_in */
  {&DSET_MBBO, GPIBEFASTO, IB_Q_LOW, NULL, NULL, 0, 32, NULL, 0, 0, MIX_OUT, &MI
X_IO, -1 },

    /* CMMAND 13 set_samp_num */
  {&DSET_LO, GPIBWRITE, IB_Q_LOW, NULL, "SSAM:%ld\r\n", 0, 32, NULL, 0, 0, NULL,
 NULL, -1 }
};