public TriggerDirections( Channel source, ThresholdDirection direction) { this.Source = source; this.Direction = direction; }
public static extern short SetTriggerChannelDirections( short handle, ThresholdDirection channelA, ThresholdDirection channelB, ThresholdDirection channelC, ThresholdDirection channelD, ThresholdDirection ext);
public static extern UInt32 SetSimpleTrigger( short handle, short enable, Channel channel, short threshold, ThresholdDirection direction, uint delay, short autotrigger_ms);
public static extern short SetPulseWidthQualifier( short handle, PwqConditions[] conditions, short nConditions, ThresholdDirection direction, uint lower, uint upper, PulseWidthType type);
public static extern uint SetSimpleTrigger( short handle, short enable, Channel source, short threshold, ThresholdDirection direction, uint delay, short autoTrigger_ms);
public static extern UInt32 SetTriggerChannelDirections( short handle, ThresholdDirection channelA, ThresholdDirection channelB, ThresholdDirection channelC, ThresholdDirection channelD, ThresholdDirection ext, ThresholdDirection aux);
public tPS5000ADirection( Channel channel, ThresholdDirection direction, ThresholdMode mode) { this.channel = channel; this.direction = direction; this.mode = mode; }
public Pwq(PwqConditions[] conditions, short nConditions, ThresholdDirection direction, uint lower, uint upper, PulseWidthType type) { this.conditions = conditions; this.nConditions = nConditions; this.direction = direction; this.lower = lower; this.upper = upper; this.type = type; }
/// <summary> /// This function sets up a rising edge trigger on a specified channel. Expecting 2Vpp signal. /// </summary> public static StandardDriverStatusCode SetTrigger(short handle, Channel channel, int autoTriggerDelay = 0) { //3% of signal range ushort hysteresis = (ushort)((UInt16.MaxValue / 100.0) * 3.0); var triggerChannelProperty = new TriggerChannelProperties(0, hysteresis, 0, hysteresis, channel); var triggerChannelProperties = new List <TriggerChannelProperties>() { triggerChannelProperty }; var status = DriverImports.PS6000a.SetTriggerChannelProperties(handle, triggerChannelProperties.ToArray(), (short)triggerChannelProperties.Count, 0, autoTriggerDelay); if (status != StandardDriverStatusCode.Ok) { return(status); } var triggerCondition = new TriggerCondition(channel, TriggerState.True); var triggerConditions = new List <TriggerCondition>() { triggerCondition }; status = DriverImports.PS6000a.SetTriggerChannelConditions(handle, triggerConditions.ToArray(), (short)triggerConditions.Count, DriverImports.Action.PICO_CLEAR_ALL | DriverImports.Action.PICO_ADD); if (status != StandardDriverStatusCode.Ok) { return(status); } var thresholdDirection = new ThresholdDirection(channel, TriggerDirection.Rising, ThresholdMode.Level); var thresholdDirections = new List <ThresholdDirection>() { thresholdDirection }; status = DriverImports.PS6000a.SetTriggerChannelDirections(handle, thresholdDirections.ToArray(), (short)thresholdDirections.Count); if (status == StandardDriverStatusCode.Ok) { Console.WriteLine("Trigger has been setup successfully. Please input a 2Vpp signal onto channel: " + channel); } return(status); }
/// <summary> /// This function sets up a digital rising edge trigger on DIGITAL_CHANNEL5 on a specified port. /// </summary> public static StandardDriverStatusCode SetDigitalTrigger(short handle, Channel port) { var channel = DigitalChannel.DIGITAL_CHANNEL5; var digitalChannelDirection = new DigitalChannelDirections(channel, DigitalDirection.DIGITAL_DIRECTION_RISING); var digitalChannelDirections = new List <DigitalChannelDirections>() { digitalChannelDirection }; var status = DriverImports.PS6000a.SetTriggerDigitalPortProperties(handle, port, digitalChannelDirections.ToArray(), 1); if (status != StandardDriverStatusCode.Ok) { return(status); } var triggerCondition = new TriggerCondition(port, TriggerState.True); var triggerConditions = new List <TriggerCondition>() { triggerCondition }; status = DriverImports.PS6000a.SetTriggerChannelConditions(handle, triggerConditions.ToArray(), (short)triggerConditions.Count, DriverImports.Action.PICO_CLEAR_ALL | DriverImports.Action.PICO_ADD); if (status != StandardDriverStatusCode.Ok) { return(status); } var thresholdDirection = new ThresholdDirection(port, TriggerDirection.Rising, ThresholdMode.Level); var thresholdDirections = new List <ThresholdDirection>() { thresholdDirection }; status = DriverImports.PS6000a.SetTriggerChannelDirections(handle, thresholdDirections.ToArray(), (short)thresholdDirections.Count); if (status == StandardDriverStatusCode.Ok) { Console.WriteLine("Trigger has been setup successfully. Please input a signal signal onto port: " + port + " channel: " + channel); } return(status); }
public static extern UInt32 SetPulseWidthQualifierProperties(short handle, ThresholdDirection direction, uint lower, uint upper, PulseWidthType type);
public static extern short SetTriggerChannelDirections( short handle, ThresholdDirection channelA, ThresholdDirection channelB, ThresholdDirection channelC, ThresholdDirection channelD, ThresholdDirection ext, ThresholdDirection aux);
public static extern short SetPulseWidthQualifier( short handle, PwqConditions[] conditions, short numConditions, ThresholdDirection direction, uint lower, uint upper, PulseWidthType type);
/// <summary> /// This function sets up a pulse width trigger on a specified channel. Expecting 2Vpp signal. /// </summary> public static StandardDriverStatusCode SetTriggerAndPulseWidth(short handle, Channel channel, uint pulseWidthSampleCount, PulseWidthType pulseWidthType, int autoTriggerDelay = 0) { int hysteresis = 2048; var triggerChannelProperty = new TriggerChannelProperties((short)hysteresis, (ushort)hysteresis, 0, (ushort)hysteresis, channel); var triggerChannelProperties = new List <TriggerChannelProperties>() { triggerChannelProperty }; var status = DriverImports.PS6000a.SetTriggerChannelProperties(handle, triggerChannelProperties.ToArray(), (short)triggerChannelProperties.Count, 0, autoTriggerDelay); if (status != StandardDriverStatusCode.Ok) { return(status); } var triggerCondition = new TriggerCondition(channel, TriggerState.True); var triggerConditionPulseWidth = new TriggerCondition(Channel.PulseWidthSource, TriggerState.True); var triggerConditions = new List <TriggerCondition>() { triggerCondition, triggerConditionPulseWidth }; status = DriverImports.PS6000a.SetTriggerChannelConditions(handle, triggerConditions.ToArray(), (short)triggerConditions.Count, DriverImports.Action.PICO_CLEAR_ALL | DriverImports.Action.PICO_ADD); if (status != StandardDriverStatusCode.Ok) { return(status); } var thresholdDirection = new ThresholdDirection(channel, TriggerDirection.Falling, ThresholdMode.Level); var thresholdDirections = new List <ThresholdDirection>() { thresholdDirection }; status = DriverImports.PS6000a.SetTriggerChannelDirections(handle, thresholdDirections.ToArray(), (short)thresholdDirections.Count); if (status != StandardDriverStatusCode.Ok) { return(status); } var pulseCondition = new TriggerCondition(channel, TriggerState.True); var pulseConditions = new List <TriggerCondition>() { pulseCondition }; status = DriverImports.PS6000a.SetPulseWidthQualifierConditions(handle, pulseConditions.ToArray(), (short)pulseConditions.Count, DriverImports.Action.PICO_CLEAR_ALL | DriverImports.Action.PICO_ADD); if (status != StandardDriverStatusCode.Ok) { return(status); } var pulseDirection = new ThresholdDirection(channel, TriggerDirection.Rising, ThresholdMode.Level); var pulseDirections = new List <ThresholdDirection> { pulseDirection }; status = DriverImports.PS6000a.SetPulseWidthQualifierDirections(handle, pulseDirections.ToArray(), (short)pulseDirections.Count); if (status != StandardDriverStatusCode.Ok) { return(status); } status = DriverImports.PS6000a.SetPulseWidthQualifierProperties(handle, pulseWidthSampleCount, 0, pulseWidthType); if (status != StandardDriverStatusCode.Ok) { return(status); } if (status == StandardDriverStatusCode.Ok) { Console.WriteLine("Trigger has been setup successfully with pulse width. Please input a 2Vpp signal onto channel: " + channel); } return(status); }