public Pwq(Imports.PwqConditions[] conditions,
     short nConditions,
     Imports.ThresholdDirection direction,
     uint lower, uint upper,
     Imports.PulseWidthType type)
 {
     this.conditions = conditions;
       this.nConditions = nConditions;
       this.direction = direction;
       this.lower = lower;
       this.upper = upper;
       this.type = type;
 }
        /****************************************************************************
         *  SetTrigger
         *  this function sets all the required trigger parameters, and calls the
         *  triggering functions
         ****************************************************************************/
        short SetTrigger(Imports.TriggerChannelProperties[] channelProperties, short nChannelProperties, Imports.TriggerConditions[] triggerConditions, short nTriggerConditions, Imports.ThresholdDirection[] directions, Pwq pwq, uint delay, short auxOutputEnabled, int autoTriggerMs)
        {
            short status;

              if (
            (status =
             Imports.SetTriggerChannelProperties(_handle, channelProperties, nChannelProperties, auxOutputEnabled,
                                             autoTriggerMs)) != 0)
              {
            return status;
              }

              if ((status = Imports.SetTriggerChannelConditions(_handle, triggerConditions, nTriggerConditions)) != 0)
              {
            return status;
              }

              if (directions == null) directions = new Imports.ThresholdDirection[] { Imports.ThresholdDirection.None,
            Imports.ThresholdDirection.None, Imports.ThresholdDirection.None, Imports.ThresholdDirection.None,
            Imports.ThresholdDirection.None, Imports.ThresholdDirection.None};

              if ((status = Imports.SetTriggerChannelDirections(_handle,
                                                        directions[(int)Imports.Channel.ChannelA],
                                                        directions[(int)Imports.Channel.ChannelB],
                                                        directions[(int)Imports.Channel.ChannelC],
                                                        directions[(int)Imports.Channel.ChannelD],
                                                        directions[(int)Imports.Channel.External],
                                                        directions[(int)Imports.Channel.Aux])) != 0)
              {
            return status;
              }

              if ((status = Imports.SetTriggerDelay(_handle, delay)) != 0)
              {
            return status;
              }

              if (pwq == null) pwq = new Pwq(null, 0, Imports.ThresholdDirection.None, 0, 0, Imports.PulseWidthType.None);

              status = Imports.SetPulseWidthQualifier(_handle, pwq.conditions,
                                              pwq.nConditions, pwq.direction,
                                              pwq.lower, pwq.upper, pwq.type);

              return status;
        }