Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
c91c2fc
Fix missing _ when making Python internal/protected functions from no…
JokeWaumans May 28, 2025
a697cb0
Fix bug when character has _ as prefix
JokeWaumans May 28, 2025
84c532c
Use lstrip to remove if statement
JokeWaumans May 28, 2025
76068f9
Use snake case function names for ps4000a
JokeWaumans May 30, 2025
b52c3ef
Add correct channels for ps4000a to the PICO_CHANNEL variable
JokeWaumans May 30, 2025
7c96dca
Add missing enums for ps3000a
JokeWaumans May 30, 2025
9aa0c66
Add set_digital_port function
JokeWaumans Jun 2, 2025
078d949
Use f-string formatting for error handling
JokeWaumans Jun 2, 2025
344bf1c
Add function to convert arguments to the correct c types
JokeWaumans Jun 2, 2025
ac88a77
Use _convert_args to convert arguments to the correct type
JokeWaumans Jun 2, 2025
3ac3f81
Update get_values to allow digital channels as well
JokeWaumans Jun 2, 2025
00f0aba
Fix set_null_trigger function when PICO_THRESHOLD_DIRECTION is not set
JokeWaumans Jun 2, 2025
27cab73
Fix run_block when 8 arguments are passed
JokeWaumans Jun 2, 2025
01bf41d
Add set_sig_gen_built_in function to use built-in signal generators
JokeWaumans Jun 2, 2025
da5b357
Add function voltage_to_logic_level to convert voltage to logic level
JokeWaumans Jun 5, 2025
1801737
Set default voltage level to 1.8V
JokeWaumans Jun 5, 2025
475eded
Split get_values function into two functions: set_data_buffer and get…
JokeWaumans Jun 12, 2025
2a07cad
Add SingletonScopeDataDict class to store the data of the buffers
JokeWaumans Jun 12, 2025
4377257
Add NumpyEncoder class to use when storing the data in a file
JokeWaumans Jun 12, 2025
4a22941
Add function to handle data from digital ports
JokeWaumans Jun 12, 2025
bf532d5
Add function to stop block capture allowing a timeout
JokeWaumans Jun 12, 2025
712d99c
Add set_trigger_channel_properties function
JokeWaumans Jun 12, 2025
62115de
Modify the defaults of set_sig_gen_built_in
JokeWaumans Jun 12, 2025
b986ebd
Fix typo
JokeWaumans Jun 12, 2025
b95249c
Set timeout to 5 minutes
JokeWaumans Jun 12, 2025
bc6dac2
Update get timebase to allow ps4000a
JokeWaumans Jun 12, 2025
fd95849
Use dictionaries to store channel data; update get_values with new fu…
JokeWaumans Jun 12, 2025
6dfbb67
Check only if the arg is not None to fix issues with buffer data in _…
JokeWaumans Jun 12, 2025
889eea4
Don't save max_samples in the library
JokeWaumans Jun 12, 2025
df3f26c
Don't save time_interval_sec in the library but pass it as an argument
JokeWaumans Jun 12, 2025
189ed6c
Add mv_to_adc function
JokeWaumans Jun 13, 2025
a940dba
Add channel argument to set_null_trigger instead of using A
JokeWaumans Jun 13, 2025
0793c12
Add set_simple_trigger function
JokeWaumans Jun 13, 2025
d5d50cf
Fix if statement when port is integer
JokeWaumans Jun 13, 2025
e131611
Add clarification to the documentation where the argument can be obta…
JokeWaumans Jun 13, 2025
4522e7d
Align arguments
JokeWaumans Jun 13, 2025
2573272
Add missing imports
JokeWaumans Jun 13, 2025
7d28cb8
Add set_and_load_data function to combine set_data_buffer and get_values
JokeWaumans Jun 13, 2025
272d068
Update docstring
JokeWaumans Jun 13, 2025
c532655
Make set_channel of Device same as the one of Library class; Update n…
JokeWaumans Jun 16, 2025
4b751b8
Add properties to Device to save various data
JokeWaumans Jun 16, 2025
23daf4f
Update close to reset all properties
JokeWaumans Jun 16, 2025
a4993d9
Add a reset function to re-open the Device
JokeWaumans Jun 16, 2025
8d298cf
Set max_adc to None in order to use the saved value in Device (uses m…
JokeWaumans Jun 16, 2025
e88dd9c
Add set_digital_port function
JokeWaumans Jun 16, 2025
1afb804
Remove trailing whitespace
JokeWaumans Jun 16, 2025
c89f900
Use time_interval in seconds instead of ns
JokeWaumans Jun 16, 2025
2efb058
Add enables channels or digital ports to the enabled sources
JokeWaumans Jun 16, 2025
89b1af6
Add get_timebase function
JokeWaumans Jun 16, 2025
f57ef74
Add errors
JokeWaumans Jun 16, 2025
0fc273c
Make a set of enabled sources
JokeWaumans Jun 16, 2025
6aa14ef
Update docstring of get_timebase
JokeWaumans Jun 16, 2025
fce0763
Add memory_segments function to Device
JokeWaumans Jun 16, 2025
b6ad22c
Add maximum_value function to Device
JokeWaumans Jun 16, 2025
da67987
Add set_null_trigger function to Device
JokeWaumans Jun 16, 2025
ebcfb09
Add set_simple_trigger function to Device
JokeWaumans Jun 16, 2025
950ed57
Add run_block function to Device
JokeWaumans Jun 16, 2025
1b515fb
Add is_ready function to Device
JokeWaumans Jun 16, 2025
926ee59
Add stop_block_capture function to Device
JokeWaumans Jun 16, 2025
8ff420c
Add set_data_buffer function to Device
JokeWaumans Jun 16, 2025
f0502f0
Add get_values function to Device
JokeWaumans Jun 16, 2025
bd982fc
Make use of max_adc property or the function maximum_value
JokeWaumans Jun 16, 2025
221c9e3
Import errors
JokeWaumans Jun 16, 2025
6d86b61
Update documentation of get_values
JokeWaumans Jun 17, 2025
c37a038
Add set_and_load_data function to Device
JokeWaumans Jun 17, 2025
c317940
Add set_trigger_channel_properties function to Device
JokeWaumans Jun 17, 2025
6e748d5
Add stop function to Device
JokeWaumans Jun 17, 2025
44616df
Add set_sig_gen_built_in function to Device
JokeWaumans Jun 17, 2025
6f7c78b
Use info property correctly
JokeWaumans Jun 17, 2025
893a2a7
Fix adding to set instead of list
JokeWaumans Jun 17, 2025
5a2bd3d
Add the device to the functions
JokeWaumans Jun 17, 2025
b9af6f0
Update set_and_load_data to use the correct buffers
JokeWaumans Jun 17, 2025
549a0ff
Remove unused import
JokeWaumans Jun 17, 2025
327d958
Update argument set_simple_trigger according to docstring and update…
JokeWaumans Jun 17, 2025
51bfa17
Return only the buffer instead dict with set_data_buffer
JokeWaumans Jun 17, 2025
44309ec
Correct the time to have the same amount of samples as the data
JokeWaumans Jun 17, 2025
5efce34
Update use of set_data_buffer
JokeWaumans Jun 17, 2025
1c14e59
Define max samples as the sum of pre and post trigger samples
JokeWaumans Jun 17, 2025
159428c
Add set_all_data_buffers function to set all data buffers for each en…
JokeWaumans Jun 17, 2025
ca04a99
Add function to trigger on a digital channel
JokeWaumans Jun 17, 2025
9bde7d1
Add function to set trigger delay
JokeWaumans Jun 17, 2025
e25f5c3
Specify the arguments
JokeWaumans Jun 18, 2025
7d17933
Set analog offset to 0
JokeWaumans Jun 18, 2025
494671e
Use the instance for the digital properties correctly
JokeWaumans Jun 18, 2025
c02a674
Delete unused function
JokeWaumans Jun 18, 2025
b17e70b
Add docstrings to the properties
JokeWaumans Jun 18, 2025
63a5173
Catch the correct error
JokeWaumans Jun 19, 2025
5362d48
Delete unused part
JokeWaumans Jun 19, 2025
db6b4c9
Update docstrings of methods in Device
JokeWaumans Jun 19, 2025
98a112e
Update docstrings methods in Library class
JokeWaumans Jun 19, 2025
0e0fc7e
Update docstring
JokeWaumans Jun 19, 2025
bf146ca
Add arguments to docstring
JokeWaumans Jun 19, 2025
d11ea69
Check if there is a digit after D for digital channels to fix usage o…
JokeWaumans Aug 11, 2025
2d4088b
Update SingletonScopeDataDict in order to obtain the correct numpy ar…
JokeWaumans Aug 21, 2025
f2b7d94
Catch KeyError as well
JokeWaumans Oct 7, 2025
c905e2e
Set all properties to None when device is closed
JokeWaumans Oct 8, 2025
9fed8c7
Fix PytestCollectionWarning
JokeWaumans Oct 8, 2025
803742c
Use time_interval in ns as default
JokeWaumans Oct 8, 2025
3cad6a9
Update tests
JokeWaumans Oct 8, 2025
346854e
Delete trailing whitespaces
JokeWaumans Oct 8, 2025
25d3c7a
Merge remote-tracking branch 'upstream/master'
JokeWaumans Oct 8, 2025
c18763e
Replace tabs with spaces
JokeWaumans Oct 8, 2025
79e4ed3
Remove trailing whitespaces
JokeWaumans Oct 8, 2025
80a3e46
Raise error when Picoscope not ready before given timeout
JokeWaumans Oct 16, 2025
6abb625
Don't use the number of retrieved samples, use max samples instead
JokeWaumans Nov 3, 2025
ddc7e4b
Fix style and add more info
JokeWaumans Nov 3, 2025
a242368
Add set_trigger_conditions method
JokeWaumans Dec 17, 2025
d98577f
Remove byref
JokeWaumans Dec 17, 2025
15e121e
Update memory_segments method to use _convert_args
JokeWaumans Dec 19, 2025
ac3e8f8
Add get_max_segments method
JokeWaumans Dec 19, 2025
6220b51
Fix method name
JokeWaumans Dec 19, 2025
77b3f65
Fix style
JokeWaumans Dec 24, 2025
d0e458d
Rename function
JokeWaumans Dec 24, 2025
1bd3291
Add error handling when the requested number of samples don't match t…
JokeWaumans Dec 24, 2025
cf38e35
Simplify the data storage with intuitive indexing
JokeWaumans Dec 24, 2025
6e2f449
Delete unused import
JokeWaumans Jan 6, 2026
7b1506c
Make sure enable is 1 or 0 instead of True or False
JokeWaumans Jan 6, 2026
606a629
Delete line
JokeWaumans Jan 6, 2026
597b418
Make sure every True/False is converted to the int 1 or 0
JokeWaumans Jan 6, 2026
e558a38
Add timebase property
JokeWaumans Jan 7, 2026
dea536d
Fix style
JokeWaumans Jan 7, 2026
fbf97db
Add setter for timebase
JokeWaumans Jan 7, 2026
a135632
Rename function in device.py to match library.py
JokeWaumans Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
538 changes: 500 additions & 38 deletions picosdk/device.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions picosdk/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ class PicoSDKCtypesError(PicoError, IOError):
class ClosedDeviceError(PicoError, IOError):
pass

class InvalidRangeOfChannel(PicoError, ValueError):
pass

class NoChannelsEnabledError(PicoError, ValueError):
pass

class ChannelNotEnabledError(PicoError, ValueError):
pass

class NoValidTimebaseForOptionsError(PicoError, ValueError):
pass
Expand Down
967 changes: 818 additions & 149 deletions picosdk/library.py

Large diffs are not rendered by default.

56 changes: 49 additions & 7 deletions picosdk/ps3000a.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ def __init__(self):
for k, v in ps3000a.PS3000A_RANGE.items() if k != "PS3000A_MAX_RANGES"
}

ps3000a.PS3000A_RATIO_MODE = {
'PS3000A_RATIO_MODE_NONE': 0,
'PS3000A_RATIO_MODE_AGGREGATE': 1,
'PS3000A_RATIO_MODE_DECIMATE': 2,
'PS3000A_RATIO_MODE_AVERAGE': 4,
}

ps3000a.PS3000A_TIME_UNITS = make_enum([
'PS3000A_FS',
'PS3000A_PS',
Expand All @@ -80,6 +73,55 @@ def __init__(self):
'PS3000A_MAX_TIME_UNITS',
])

ps3000a.PS3000A_WAVE_TYPE = make_enum([
"PS3000A_SINE",
"PS3000A_SQUARE",
"PS3000A_TRIANGLE",
"PS3000A_DC_VOLTAGE",
"PS3000A_RAMP_UP",
"PS3000A_RAMP_DOWN",
"PS3000A_SINC",
"PS3000A_GAUSSIAN",
"PS3000A_HALF_SINE",
])

ps3000a.PS3000A_SWEEP_TYPE = make_enum([
"PS3000A_UP",
"PS3000A_DOWN",
"PS3000A_UPDOWN",
"PS3000A_DOWNUP",
])

ps3000a.PS3000A_EXTRA_OPERATIONS = make_enum([
'PS3000A_ES_OFF',
'PS3000A_WHITENOISE',
'PS3000A_PRBS',
])

ps3000a.PS3000A_SIGGEN_TRIG_TYPE = make_enum([
'PS3000A_SIGGEN_RISING',
'PS3000A_SIGGEN_FALLING',
'PS3000A_SIGGEN_GATE_HIGH',
'PS3000A_SIGGEN_GATE_LOW',
])

ps3000a.PS3000A_SIGGEN_TRIG_SOURCE = make_enum([
'PS3000A_SIGGEN_NONE',
'PS3000A_SIGGEN_SCOPE_TRIG',
'PS3000A_SIGGEN_EXT_IN',
'PS3000A_SIGGEN_SOFT_TRIG',
'PS3000A_SIGGEN_TRIGGER_RAW',
])

ps3000a.PS3000A_RATIO_MODE = make_enum([
'PS3000A_RATIO_MODE_NONE',
'PS3000A_RATIO_MODE_AGGREGATE',
'PS3000A_RATIO_MODE_AVERAGE',
'PS3000A_RATIO_MODE_DECIMATE',
])

ps3000a.PICO_RATIO_MODE = {k[19:]: v for k, v in ps3000a.PS3000A_RATIO_MODE.items()}

ps3000a.PS3000A_DIGITAL_CHANNEL = make_enum([
"PS3000A_DIGITAL_CHANNEL_0",
"PS3000A_DIGITAL_CHANNEL_1",
Expand Down
Loading