msl.equipment.resources.picotech.picoscope.picoscope_2k3k module

Base class for the ps2000 and ps3000 PicoScopes.

class msl.equipment.resources.picotech.picoscope.picoscope_2k3k.PicoScope2k3k(record, func_ptrs)[source]

Bases: PicoScope

Use the PicoScope SDK to communicate with ps2000 and ps3000 oscilloscopes.

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters
errcheck_zero(result, func, args)[source]

If the SDK function returns 0 then raise an exception.

errcheck_one(result, func, args)[source]

If the SDK function returns 1 then raise an exception.

errcheck_negative_one(result, func, args)[source]

If the SDK function returns -1 then raise an exception.

flash_led()[source]

Flashes the LED on the front of the oscilloscope three times and returns within one second.

get_streaming_last_values(lp_get_overview_buffers_max_min)[source]

This function is used to collect the next block of values while fast streaming is running. You must call run_streaming_ns() beforehand to set up fast streaming.

get_streaming_values(no_of_values, no_of_samples_per_aggregate)[source]

This function is used after the driver has finished collecting data in fast streaming mode. It allows you to retrieve data with different aggregation ratios, and thus zoom in to and out of any region of the data.

get_streaming_values_no_aggregation(no_of_values)[source]

This function retrieves raw streaming data from the driver’s data store after fast streaming has stopped.

get_timebase(timebase, no_of_samples, oversample=0)[source]

This function discovers which timebases are available on the oscilloscope. You should set up the channels using set_channel() and, if required, ETS mode using set_ets() first. Then call this function with increasing values of timebase, starting from 0, until you find a timebase with a sampling interval and sample count close enough to your requirements.

get_times_and_values(time_units, no_of_values)[source]

This function is used to get values and times in block mode after calling run_block().

get_values(num_values)[source]

This function is used to get values in compatible streaming mode after calling run_streaming(), or in block mode after calling run_block().

open_unit()[source]

This function opens a PicoScope 2000/3000 Series oscilloscope. The driver can support up to 64 oscilloscopes.

open_unit_async()[source]

This function opens a PicoScope 2000/3000 Series oscilloscope without waiting for the operation to finish. You can find out when it has finished by periodically calling open_unit_progress(), which returns a value of 100 when the scope is open.

The driver can support up to 64 oscilloscopes.

open_unit_progress()[source]

This function checks on the progress of open_unit_async().

The function will return a value from 0 to 100, where 100 implies that the operation is complete.

overview_buffer_status()[source]

This function indicates whether or not the overview buffers used by run_streaming_ns() have overrun. If an overrun occurs, you can choose to increase the overview_buffer_size argument that you pass in the next call to run_streaming_ns().

run_streaming_ns(sample_interval, time_units, max_samples, auto_stop, no_of_samples_per_aggregate, overview_buffer_size)[source]

This function tells the scope unit to start collecting data in fast streaming mode . The function returns immediately without waiting for data to be captured. After calling this function, you should next call get_streaming_last_values() to copy the data to your application’s buffer.

set_adv_trigger_channel_directions(channel_a, channel_b, channel_c, channel_d, ext)[source]

This function sets the direction of the trigger for each channel.

set_adv_trigger_delay(delay, pre_trigger_delay)[source]

This function sets the pre-trigger and post-trigger delays. The default action, when both these delays are zero, is to start capturing data beginning with the trigger event and to stop a specified time later. The start of capture can be delayed by using a nonzero value of delay. Alternatively, the start of capture can be advanced to a time before the trigger event by using a negative value of pre_trigger_delay. If both arguments are non-zero then their effects are added together.

set_ets(mode, ets_cycles, ets_interleave)[source]

This function is used to enable or disable ETS (equivalent time sampling) and to set the ETS parameters.

set_trigger(source, threshold, direction, delay, auto_trigger_ms)[source]

This function just calls set_trigger2(), since Python supports a floating-point value for defining the delay parameter.

set_trigger2(source, threshold, direction, delay, auto_trigger_ms)[source]

This function is used to enable or disable triggering and its parameters. It has the same behaviour as set_trigger(), except that the delay parameter is a floating-point value.

For oscilloscopes that support advanced triggering, see set_adv_trigger_channel_conditions() and related functions.

set_adv_trigger_channel_properties(channel_properties, auto_trigger_milliseconds)[source]

This function is used to enable or disable triggering and set its parameters.

set_adv_trigger_channel_conditions(conditions)[source]

This function sets up trigger conditions on the scope’s inputs. The trigger is set up by defining a list of TriggerConditions structures, which are found in the structs module. Each structure is the AND of the states of one scope input.