Trigger Configuration

Bases: PicoScopeBase, shared_ps6000a_psospa, shared_4000a_6000a

PicoScope 6000 (A) API specific functions

Methods:

Name Description
get_trigger_info

Retrieve trigger timing information for one or more segments.

get_trigger_time_offset

Get the trigger time offset for jitter correction in waveforms.

get_values_trigger_time_offset_bulk

Retrieve trigger time offsets for a range of segments.

set_advanced_trigger

Configure an advanced trigger in a single call.

set_aux_io_mode

Configure the AUX IO connector using ps6000aSetAuxIoMode.

set_pulse_width_trigger

Configures a pulse width trigger using a specified channel and timing parameters.

set_simple_trigger

Sets up a simple trigger from a specified channel and threshold in mV.

set_trigger_channel_conditions

Configure a trigger condition.

set_trigger_channel_directions

Specify the trigger direction for channel.

set_trigger_channel_properties

Configure trigger thresholds for channel. All

set_trigger_delay

Delay the trigger by delay samples.

set_trigger_digital_port_properties

Configure digital port trigger directions.

set_trigger_holdoff_counter_by_samples

Set the trigger holdoff period in sample intervals.

trigger_within_pre_trigger_samples

Control trigger positioning relative to pre-trigger samples.

get_trigger_info(first_segment_index=0, segment_count=1)

Retrieve trigger timing information for one or more segments.

Parameters:
  • first_segment_index (int, default: 0 ) –

    Index of the first memory segment to query.

  • segment_count (int, default: 1 ) –

    Number of consecutive segments starting at first_segment_index.

Returns:
  • list[dict]

    List of dictionaries for each trigger event

Raises:
  • PicoSDKException

    If the function call fails or preconditions are not met.

get_trigger_time_offset(time_unit, segment_index=0)

Get the trigger time offset for jitter correction in waveforms.

The driver interpolates between adjacent samples to estimate when the trigger actually occurred. This means the value returned can have a very fine granularity—down to femtoseconds—even though the effective resolution is usually limited to roughly one-tenth of the sampling interval in real-world use.

Parameters:
  • time_unit (TIME_UNIT) –

    Desired unit for the returned offset.

  • segment_index (int, default: 0 ) –

    The memory segment to query. Default is 0.

Returns:
  • int( int ) –

    Trigger time offset converted to time_unit.

Raises:
  • PicoSDKException

    If the function call fails or preconditions are not met.

get_values_trigger_time_offset_bulk(from_segment_index, to_segment_index)

Retrieve trigger time offsets for a range of segments.

This method returns the trigger time offset and associated time unit for each requested segment.

Parameters:
  • from_segment_index (int) –

    Index of the first memory segment to query.

  • to_segment_index (int) –

    Index of the last memory segment. If this value is less than from_segment_index the driver wraps around.

Returns:
  • list[tuple[int, PICO_TIME_UNIT]]

    list[tuple[int, PICO_TIME_UNIT]]: [(offset, unit), ...] for each

  • list[tuple[int, PICO_TIME_UNIT]]

    segment beginning with from_segment_index.

set_advanced_trigger(channel, state, direction, threshold_mode, threshold_upper_mv, threshold_lower_mv, hysteresis_upper_mv=0.0, hysteresis_lower_mv=0.0, aux_output_enable=0, auto_trigger_ms=0, action=ACTION.CLEAR_ALL | ACTION.ADD)

Configure an advanced trigger in a single call.

This helper sets up the trigger condition, direction and properties required for non-simple triggers.

Parameters:
  • channel (int) –

    Channel to monitor for the trigger condition.

  • state (int) –

    Trigger state used with set_trigger_channel_conditions.

  • direction (int) –

    Trigger direction from :class:PICO_THRESHOLD_DIRECTION.

  • threshold_mode (int) –

    Threshold mode from :class:PICO_THRESHOLD_MODE.

  • threshold_upper_mv (float) –

    Upper trigger threshold in millivolts.

  • threshold_lower_mv (float) –

    Lower trigger threshold in millivolts.

  • hysteresis_upper_mv (float, default: 0.0 ) –

    Optional hysteresis for threshold_upper_mv in millivolts.

  • hysteresis_lower_mv (float, default: 0.0 ) –

    Optional hysteresis for threshold_lower_mv in millivolts.

  • aux_output_enable (int, default: 0 ) –

    Optional auxiliary output flag.

  • auto_trigger_ms (int, default: 0 ) –

    Auto-trigger timeout in milliseconds. 0 waits indefinitely.

  • action (int, default: CLEAR_ALL | ADD ) –

    Action flag for set_trigger_channel_conditions.

set_aux_io_mode(mode)

Configure the AUX IO connector using ps6000aSetAuxIoMode.

Parameters:
  • mode (AUXIO_MODE) –

    Requested AUXIO mode from :class:~pypicosdk.constants.AUXIO_MODE.

set_pulse_width_trigger(channel, timebase, samples, direction, pulse_width_type, time_upper=0, time_upper_units=TIME_UNIT.US, time_lower=0, time_lower_units=TIME_UNIT.US, threshold_upper_mv=0.0, threshold_lower_mv=0.0, hysteresis_upper_mv=0.0, hysteresis_lower_mv=0.0, trig_dir=None, threshold_mode=THRESHOLD_MODE.LEVEL, auto_trigger_us=0)

Configures a pulse width trigger using a specified channel and timing parameters.

This method sets up a trigger condition where a pulse on the specified channel must be within or outside a defined pulse width window. The trigger logic uses both level thresholds and pulse width qualifiers to define the trigger behavior.

Parameters:
  • channel (CHANNEL) –

    The input channel on which to apply the pulse width trigger.

  • timebase (int) –

    The timebase index to determine sampling interval.

  • samples (int) –

    The number of samples to be captured (used to resolve timing).

  • direction (THRESHOLD_DIRECTION) –

    Pulse polarity to trigger on (e.g. RISING or FALLING).

  • pulse_width_type (PULSE_WIDTH_TYPE) –

    Type of pulse width qualifier (e.g. GREATER_THAN).

  • time_upper (float, default: 0 ) –

    Upper time bound for pulse width. Default is 0 (disabled).

  • time_upper_units (TIME_UNIT, default: US ) –

    Units for time_upper. Default is microseconds.

  • time_lower (float, default: 0 ) –

    Lower time bound for pulse width. Default is 0 (disabled).

  • time_lower_units (TIME_UNIT, default: US ) –

    Units for time_lower. Default is microseconds.

  • threshold_upper_mv (float, default: 0.0 ) –

    Upper voltage threshold in millivolts. Default is 0.0 mV.

  • threshold_lower_mv (float, default: 0.0 ) –

    Lower voltage threshold in millivolts. Default is 0.0 mV.

  • hysteresis_upper_mv (float, default: 0.0 ) –

    Hysteresis for upper threshold in mV. Default is 0.0 mV.

  • hysteresis_lower_mv (float, default: 0.0 ) –

    Hysteresis for lower threshold in mV. Default is 0.0 mV.

  • trig_dir (THRESHOLD_DIRECTION, default: None ) –

    Trigger direction for the initial pulse. If None, inferred as opposite of direction. Default is None.

  • threshold_mode (THRESHOLD_MODE, default: LEVEL ) –

    Specifies whether thresholds are in level or window mode. Default is LEVEL.

  • auto_trigger_us (int, default: 0 ) –

    Time in microseconds after which an automatic trigger occurs. Default is 0 (disabled).

set_simple_trigger(channel, threshold_mv=0, enable=True, direction=TRIGGER_DIR.RISING, delay=0, auto_trigger_ms=5000)

Sets up a simple trigger from a specified channel and threshold in mV.

Parameters:
  • channel (int) –

    The input channel to apply the trigger to.

  • threshold_mv (float) –

    Trigger threshold level in millivolts.

  • enable (bool, default: True ) –

    Enables or disables the trigger.

  • direction (TRIGGER_DIR, default: RISING ) –

    Trigger direction (e.g., TRIGGER_DIR.RISING).

  • delay (int, default: 0 ) –

    Delay in samples after the trigger condition is met before starting capture.

  • auto_trigger (int, default: 0 ) –

    Timeout in microseconds after which data capture proceeds even if no trigger occurs. If 0, the PicoScope will wait indefintely.

Examples:

When using TRIGGER_AUX, threshold is fixed to 1.25 V

>>> scope.set_simple_trigger(channel=psdk.CHANNEL.TRIGGER_AUX)

set_trigger_channel_conditions(conditions, action=ACTION.CLEAR_ALL | ACTION.ADD)

Configure a trigger condition.

Parameters:
  • conditions (list[tuple[CHANNEL, TRIGGER_STATE]]) –

    A list of tuples describing the CHANNEL and TRIGGER_STATE for that channel

  • action (int, default: CLEAR_ALL | ADD ) –

    Action to apply this condition relateive to any previous condition. Defaults to ACTION.CLEAR_ALL | ACTION.ADD.

set_trigger_channel_directions(channel, direction, threshold_mode)

Specify the trigger direction for channel. If multiple directions are needed, channel, direction and threshold_mode can be given a list of values.

Parameters:
  • channel (CHANNEL | list) –

    Single or list of channels to configure.

  • direction (THRESHOLD_DIRECTION | list) –

    Single or list of directions to configure.

  • threshold_mode (THRESHOLD_MODE | list) –

    Single or list of threshold modes to configure.

set_trigger_channel_properties(threshold_upper, hysteresis_upper, threshold_lower, hysteresis_lower, channel, aux_output_enable=0, auto_trigger_us=0)

Configure trigger thresholds for channel. All threshold and hysteresis values are specified in ADC counts.

Parameters:
  • threshold_upper (int) –

    Upper trigger level.

  • hysteresis_upper (int) –

    Hysteresis for threshold_upper.

  • threshold_lower (int) –

    Lower trigger level.

  • hysteresis_lower (int) –

    Hysteresis for threshold_lower.

  • channel (int) –

    Target channel as a :class:CHANNEL value.

  • aux_output_enable (int, default: 0 ) –

    Auxiliary output flag.

  • auto_trigger_us (int, default: 0 ) –

    Auto-trigger timeout in microseconds. 0 waits indefinitely.

set_trigger_delay(delay)

Delay the trigger by delay samples. Args: delay: Number of samples to delay the trigger by.

set_trigger_digital_port_properties(port, directions)

Configure digital port trigger directions. Args: port: Digital port identifier. directions: Optional list of channel directions to set. None to clear existing configuration.

set_trigger_holdoff_counter_by_samples(samples)

Set the trigger holdoff period in sample intervals. Args: samples: Number of samples for the holdoff period.

trigger_within_pre_trigger_samples(state)

Control trigger positioning relative to pre-trigger samples. Args: state: 0 to enable, 1 to disable