PicoScope¤
PicoScope
(SDK)
¤
PicoScope(equipment: Equipment)
flowchart LR
msl.equipment_resources.picotech.picoscope.PicoScope[PicoScope]
msl.equipment.interfaces.sdk.SDK[SDK]
msl.equipment.schema.Interface[Interface]
msl.equipment.interfaces.sdk.SDK --> msl.equipment_resources.picotech.picoscope.PicoScope
msl.equipment.schema.Interface --> msl.equipment.interfaces.sdk.SDK
click msl.equipment_resources.picotech.picoscope.PicoScope href "" "msl.equipment_resources.picotech.picoscope.PicoScope"
click msl.equipment.interfaces.sdk.SDK href "" "msl.equipment.interfaces.sdk.SDK"
click msl.equipment.schema.Interface href "" "msl.equipment.schema.Interface"
A wrapper around the PicoScope API Series SDK.
Regular-expression patterns that are used to select this Resource when connect() is called.
manufacturer=r"Pico\s*Tech"
model=r"[23456]\d{3}[A-Z]"
Warning
This class was written for the ps5000a SDK. Different SDKs (e.g., ps4000a) have similar function signatures and may or may not work with this class. Note that Pico Technology have their own repository to support their products.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
equipment
|
Equipment
|
An Equipment instance. |
required |
A Connection instance supports the following properties for a PicoScope.
Connection Properties:
| Name | Type | Description |
|---|---|---|
auto_select_power |
bool
|
PicoScopes that can be powered by either DC power or by USB power
may raise an exception if the DC power supply is not connected. Setting |
resolution |
str
|
The device resolution (bit depth).
Possible values are |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
pre_trigger
property
¤
pre_trigger: float
The number of seconds that samples were acquired for before the trigger event.
streaming_done
class-attribute
instance-attribute
¤
streaming_done: bool = False
Whether streaming mode has finished acquiring the samples.
channel_combinations_stateless
¤
channel_combinations_stateless(
*,
dt: float,
resolution: DeviceResolution | str | int,
ac_adaptor: bool = False
) -> ChannelFlags
Get the channel and port combination flags for a proposed device configuration.
It does not write the configuration to the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt
|
float
|
The proposed sampling interval, in seconds. |
required |
resolution
|
DeviceResolution | str | int
|
The resolution mode in which you propose to operate the oscilloscope. Can be an enum member name (case insensitive, with or without the "DR_" prefix) or value. |
required |
ac_adaptor
|
bool
|
Whether the proposed configuration uses the external AC adaptor or not. |
False
|
Returns:
| Type | Description |
|---|---|
ChannelFlags
|
The channel and port combination flags. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
check_for_update
¤
Check if the firmware version requires an update.
Returns:
| Type | Description |
|---|---|
tuple[str, str, bool]
|
The current version, the latest version and whether an update is required,
i.e., |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
disconnect
¤
disconnect() -> None
Disconnect from the PicoScope.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
261 262 263 264 265 266 | |
enumerate_units
staticmethod
¤
Find PicoScopes that are connected to the computer.
Note
You cannot call this function after you have opened a connection to a PicoScope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
PathLike
|
The path to the Pico Technology SDK of the scope models to find.
You may specify the filename (e.g., |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of serial numbers of the PicoScopes that were found. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
flash_led
¤
flash_led(start: int) -> None
Flashes the LED on the front of the scope without blocking the calling thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
int
|
The action required:
|
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
295 296 297 298 299 300 301 302 303 304 305 306 307 | |
get_analogue_offset
¤
get_analogue_offset(
range: Range | str | int, coupling: Coupling | str | int = "dc"
) -> tuple[float, float]
Get the minimum and maximum allowable analogue offset for a specific voltage range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range
|
Range | str | int
|
The input voltage range. Can be an enum member name (with or without the |
required |
coupling
|
Coupling | str | int
|
The impedance and coupling type. Can be an enum member name (case insensitive) or value. |
'dc'
|
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
The |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
get_channel_information
¤
get_channel_information(
channel: Channel | str | int, info: ChannelInfo | str | int = "ranges"
) -> list[int]
Get information about a channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str | int
|
The channel to get the ranges of. Can be an enum member name (case insensitive) or value. |
required |
info
|
ChannelInfo | str | int
|
The information to get for the |
'ranges'
|
Returns:
| Type | Description |
|---|---|
list[int]
|
The information that was requested. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
get_device_resolution
¤
get_device_resolution() -> DeviceResolution
Get the device resolution.
Returns:
| Type | Description |
|---|---|
DeviceResolution
|
The resolution (bit depth). |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
349 350 351 352 353 354 355 356 357 | |
get_max_down_sample_ratio
¤
Get the maximum down-sampling ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of unprocessed samples to be downsampled. |
required |
mode
|
RatioMode | str | int
|
The down-sampling mode. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment to use. |
0
|
Returns:
| Type | Description |
|---|---|
int
|
The maximum down-sampling ratio that can be used for a given number of samples in a given down-sampling mode. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
get_max_segments
¤
get_max_segments() -> int
Get the maximum number of segments allowed for the opened device.
Returns:
| Type | Description |
|---|---|
int
|
This function returns the maximum number of segments allowed for the opened device.
This number is the maximum value of |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
376 377 378 379 380 381 382 383 384 385 386 | |
get_minimum_timebase_stateless
¤
get_minimum_timebase_stateless(
*, flags: ChannelFlags, resolution: DeviceResolution | str | int
) -> float
Get the fastest available sample interval for the proposed configuration.
It does not write the configuration to the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flags
|
ChannelFlags
|
The proposed combination of enabled channels and ports. To specify multiple channels and ports, use the bitwise-OR of the relevant ChannelFlags. |
required |
resolution
|
DeviceResolution | str | int
|
The resolution mode in which you propose to operate the oscilloscope. Can be an enum member name (case insensitive, with or without the "DR_" prefix) or value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fastest sampling interval, in seconds, corresponding to the proposed configuration. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
get_no_of_captures
¤
Get the number of captures available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pre_allocate
|
bool
|
Whether to pre-allocate a numpy array to hold the samples for each channel that is enabled. Allocation happens only once per run. |
True
|
Returns:
| Type | Description |
|---|---|
int
|
The number of captures the device has made in rapid-block mode, since run_block was called. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
get_num_of_processed_captures
¤
get_num_of_processed_captures() -> int
Get the number of captures in rapid block mode that have been processed.
Returns:
| Type | Description |
|---|---|
int
|
The number of available captures that have been collected after calling run_block. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
438 439 440 441 442 443 444 445 446 447 | |
get_streaming_latest_values
¤
get_streaming_latest_values(
callback: PicoTechStreamingReadyCallback, *, strict: bool = False
) -> None
Instructs the driver to return the next block of values to your callback function.
You must have previously called run_streaming beforehand to set up streaming.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
PicoTechStreamingReadyCallback
|
The callback function to be called when the latest streaming samples have been acquired (see also, wait_until_ready and is_ready). |
required |
strict
|
bool
|
Whether to raise an exception if the device is busy so data cannot be acquired yet when this method is called. |
False
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | |
get_timebase2
¤
Get the timebase.
This function calculates the sampling interval and maximum number of samples for a given timebase under the specified conditions. The result will depend on the number of channels enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timebase
|
int
|
The timebase. |
required |
num_samples
|
int
|
The number of samples required. |
0
|
segment
|
int
|
The index of the memory segment to use. |
0
|
Returns:
| Type | Description |
|---|---|
tuple[float, int]
|
The sampling interval, in seconds, and the maximum number of samples available. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
get_trigger_info_bulk
¤
get_trigger_info_bulk(
from_segment: int = 0, to_segment: int | None = None
) -> TriggerInfo
Get information about the trigger point in one or more segments of captured data.
If from_segment > to_segment, the segment index will wrap from the last segment back to 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_segment
|
int
|
The zero-based number of the first segment of interest. |
0
|
to_segment
|
int | None
|
The zero-based number of the last segment of interest. If |
None
|
Returns:
| Type | Description |
|---|---|
TriggerInfo
|
The trigger-information struct. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | |
get_trigger_time_offset64
¤
Gets the time at which the trigger occurred.
Call it after block-mode data has been captured or when data has been retrieved from a previous block-mode capture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
segment
|
int
|
The index of the memory segment for which the information is required. |
0
|
Returns:
| Type | Description |
|---|---|
float
|
The offset time, in seconds. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | |
get_unit_info
¤
Retrieves information about the PicoScope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
info
|
PicoInfo | str | int | None
|
The info to get. Can be an enum member name (case insensitive) or value.
If |
None
|
prefix
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
str
|
The requested information from the PicoScope. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | |
get_values
¤
get_values(
num_samples: int | None = None,
start: int = 0,
factor: int = 1,
mode: RatioMode | str | int = "none",
segment: int = 0,
) -> tuple[int, int]
Get the block-mode data, with or without down sampling, starting at the specified sample number.
It is used to get the stored data from the driver after data collection has stopped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
int | None
|
The number of samples required. If |
None
|
start
|
int
|
A zero-based index that indicates the start point for data collection. It is measured in sample intervals from the start of the buffer. |
0
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment where the data is stored. |
0
|
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
The actual number of samples retrieved and a flag that indicate whether
an over-voltage has occurred on any of the channels. It is a bit field
with bit 0 denoting Channel A (i.e., |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
get_values_async
¤
get_values_async(
callback: PicoTechDataReadyCallback,
num_samples: int | None = None,
start: int = 0,
factor: int = 1,
mode: RatioMode | str | int = "none",
segment: int = 0,
) -> None
Get data either with or without down sampling, starting at the specified sample number.
It is used to get the stored data from the scope after data collection has stopped. It returns the data to the callback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
PicoTechDataReadyCallback
|
A callback function to call when data is ready. |
required |
num_samples
|
int | None
|
The number of samples required. If |
None
|
start
|
int
|
A zero-based index that indicates the start point for data collection. It is measured in sample intervals from the start of the buffer. |
0
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment where the data is stored. |
0
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | |
get_values_bulk
¤
get_values_bulk(
from_segment: int = 0,
to_segment: int | None = None,
factor: int = 1,
mode: RatioMode | str | int = "none",
num_samples: int | None = None,
) -> tuple[int, list[int]]
Get waveforms captured using rapid block mode.
The waveforms must have been collected sequentially and in the same run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_segment
|
int
|
The first segment from which the waveform should be retrieved. |
0
|
to_segment
|
int | None
|
The last segment from which the waveform should be retrieved. If |
None
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
num_samples
|
int | None
|
The number of samples required. If |
None
|
Returns:
| Type | Description |
|---|---|
tuple[int, list[int]]
|
The actual number samples retrieved per capture and a list of overflow bit-mask flags for each capture. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
get_values_overlapped
¤
get_values_overlapped(
start: int = 0,
factor: int = 1,
mode: RatioMode | str | int = "none",
segment: int = 0,
) -> tuple[int, int]
Allows you to make a deferred data-collection request in block mode.
The advantage of this function is that the driver makes contact with the scope only once, when you call run_block, compared with the two contacts that occur when you use the conventional run_block, get_values calling sequence. This slightly reduces the dead time between successive captures in block mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
int
|
A zero-based index that indicates the start point for data collection. It is measured in sample intervals from the start of the buffer. |
0
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment where the data is stored. |
0
|
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
The actual number of samples retrieved and a flag that indicate whether
an over-voltage has occurred on any of the channels. It is a bit field
with bit 0 denoting Channel A (i.e., |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
get_values_overlapped_bulk
¤
get_values_overlapped_bulk(
start: int = 0,
factor: int = 1,
mode: RatioMode | str | int = "none",
from_segment: int = 0,
to_segment: int | None = None,
num_samples: int | None = None,
) -> tuple[int, list[int]]
Allows you to make a deferred data-collection request in block mode.
The advantage of this function is that the driver makes contact with the scope only once, when you call run_block, compared with the two contacts that occur when you use the conventional run_block, get_values_bulk calling sequence. This slightly reduces the dead time between successive captures in rapid block mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
int
|
A zero-based index that indicates the start point for data collection. It is measured in sample intervals from the start of the buffer. |
0
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
from_segment
|
int
|
The first segment from which the waveform should be retrieved. |
0
|
to_segment
|
int | None
|
The last segment from which the waveform should be retrieved. If |
None
|
num_samples
|
int | None
|
The number of samples required. If |
None
|
Returns:
| Type | Description |
|---|---|
tuple[int, list[int]]
|
The actual number samples retrieved per capture and a list of overflow bit-mask flags for each capture. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | |
get_values_trigger_time_offset_bulk64
¤
get_values_trigger_time_offset_bulk64(
from_segment: int = 0, to_segment: int | None = None
) -> list[float]
Get the 64-bit time offsets for waveforms captured in rapid block mode.
If from_segment > to_segment, the segment index will wrap from the last segment back to 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_segment
|
int
|
The zero-based number of the first segment of interest. |
0
|
to_segment
|
int | None
|
The zero-based number of the last segment of interest. If |
None
|
Returns:
| Type | Description |
|---|---|
list[float]
|
The trigger time offset, in seconds, for each requested segment index. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | |
is_led_flashing
¤
is_led_flashing() -> int
This function reports whether or not the LED is flashing.
Returns:
| Type | Description |
|---|---|
int
|
Whether the LED is flashing. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
791 792 793 794 795 796 797 798 799 | |
is_ready
¤
is_ready() -> bool
Check if the PicoScope has collected the requested number of samples.
This function may be used instead of a callback function to receive data from
run_block.
To use this method, pass None as the callback parameter in
run_block.
You must then poll the driver to see if it has finished collecting the requested samples.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the PicoScope has collected the requested number of samples. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | |
is_trigger_or_pulse_width_qualifier_enabled
¤
This function checks whether the trigger or pulse-width qualifier is enabled.
Returns:
| Type | Description |
|---|---|
tuple[bool, bool]
|
Whether the trigger is enabled and the pulse-width qualifier is enabled, i.e., |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 | |
maximum_value
¤
maximum_value() -> int
Get the maximum ADC value.
Returns:
| Type | Description |
|---|---|
int
|
The maximum ADC value. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
833 834 835 836 837 838 839 840 841 | |
memory_segments
¤
Sets the number of memory segments that the scope will use.
When the scope is opened, the number of segments defaults to 1, meaning that each capture fills the scopes available memory. This function allows you to divide the memory into a number of segments so that the scope can store several waveforms sequentially.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_segments
|
int
|
The number of memory segments. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of samples available in each segment. This is the total number over all channels, so if two channels or 8-bit digital ports are in use, the number of samples available to each channel is divided by 2. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
minimum_value
¤
minimum_value() -> int
Get the minimum ADC value.
Returns:
| Type | Description |
|---|---|
int
|
The minimum ADC value. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
863 864 865 866 867 868 869 870 871 | |
nearest_sample_interval_stateless
¤
nearest_sample_interval_stateless(
*,
flags: ChannelFlags,
dt: float,
resolution: DeviceResolution | str | int,
use_ets: bool = False
) -> tuple[int, float]
Get the nearest timebase index and sample interval for the proposed configuration.
It does not write the configuration to the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flags
|
ChannelFlags
|
The proposed combination of enabled channels and ports. To specify multiple channels and ports, use the bitwise-OR of the relevant ChannelFlags. |
required |
dt
|
float
|
The proposed sampling interval, in seconds. |
required |
resolution
|
DeviceResolution | str | int
|
The resolution mode in which you propose to operate the oscilloscope. Can be an enum member name (case insensitive, with or without the "DR_" prefix) or value. |
required |
use_ets
|
bool
|
The proposed state of ETS (disabled or enabled). |
False
|
Returns:
| Type | Description |
|---|---|
tuple[int, float]
|
The nearest (rounded up) timebase index and sampling interval, in seconds, corresponding to the proposed configuration. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | |
no_of_streaming_values
¤
no_of_streaming_values() -> int
Gets the number of samples available after data collection in streaming mode.
Call it after calling stop.
Returns:
| Type | Description |
|---|---|
int
|
The number of samples. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
899 900 901 902 903 904 905 906 907 908 909 | |
ping_unit
¤
ping_unit() -> None
Ping the PicoScope.
This function can be used to check that the already opened device is still connected to the USB port and communication is successful.
Raises MSLConnectionError if pinging was not successful.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
911 912 913 914 915 916 917 918 919 920 | |
query_output_edge_detect
¤
query_output_edge_detect() -> bool
Whether output edge detection mode is currently enabled.
The default state is enabled.
Returns:
| Type | Description |
|---|---|
bool
|
Whether edge detection is enabled. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
922 923 924 925 926 927 928 929 930 931 932 | |
run_block
¤
run_block(
pre_trigger: float = 0.0,
callback: PicoTechBlockReadyCallback | None = None,
segment: int = 0,
) -> float
Start acquiring samples in block mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pre_trigger
|
float
|
The number of seconds before the trigger event to start acquiring samples. The value must be ≥ 0. |
0.0
|
callback
|
PicoTechBlockReadyCallback | None
|
An optional callback function to be called when all samples have been acquired. (see also, wait_until_ready and is_ready). |
None
|
segment
|
int
|
The index of the memory segment to save the samples to. |
0
|
Returns:
| Type | Description |
|---|---|
float
|
The approximate time, in seconds, that the scope will spend acquiring samples. This does not include any auto trigger timeout |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 | |
run_streaming
¤
run_streaming(
pre_trigger: float = 0.0,
factor: int = 1,
mode: RatioMode | str | int = "none",
*,
auto_stop: bool = True,
strict: bool = True
) -> float
Start collecting samples in streaming mode.
This function tells the oscilloscope to start collecting data in streaming mode. When data has been collected from the device it is down sampled if necessary and then delivered to the application. Call get_streaming_latest_values to retrieve the data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pre_trigger
|
float
|
The number of seconds before the trigger event to start acquiring data. |
0.0
|
factor
|
int
|
The down-sampling factor that will be applied to the raw data. |
1
|
mode
|
RatioMode | str | int
|
Which down-sampling mode to use. Can be an enum member name (case insensitive) or value. |
'none'
|
auto_stop
|
bool
|
Whether streaming should stop when all of samples have been captured. |
True
|
strict
|
bool
|
Whether to force the requested and the actual sampling intervals to be equal. |
True
|
Returns:
| Type | Description |
|---|---|
float
|
The actual time interval, in seconds, between samples. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | |
set_auto_trigger
¤
set_auto_trigger(wait: float) -> None
Sets up the auto-trigger function.
The auto-trigger function starts a capture if no trigger event occurs within a specified time after a run command has been issued.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wait
|
float
|
The number of seconds to wait for a trigger before timing out. If this argument is zero, the scope will wait indefinitely for a trigger. Rounds to the nearest microsecond. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | |
set_channel
¤
set_channel(
channel: Channel | str | int,
*,
bandwidth: BandwidthLimiter | str | int = "full",
coupling: Coupling | str | int = "dc",
enabled: bool = True,
offset: float = 0.0,
range: Range | str | int = "10V"
) -> None
Configure a channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str | int
|
The channel to configure. Can be an enum member name (case insensitive) or value. |
required |
bandwidth
|
BandwidthLimiter | str | int
|
The bandwidth limiter to use. Can be an enum member name (case insensitive, with
or without the |
'full'
|
coupling
|
Coupling | str | int
|
The impedance and coupling type. Can be an enum member name (case insensitive) or value. |
'dc'
|
enabled
|
bool
|
Whether to enable the channel. |
True
|
offset
|
float
|
A voltage to add to the input channel before digitization. The allowable range of offsets depends on the input range selected for the channel, as obtained from get_analogue_offset. |
0.0
|
range
|
Range | str | int
|
The input voltage range. Can be an enum member name (with or without the |
'10V'
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | |
set_data_buffer
¤
set_data_buffer(
channel: Channel | str | int,
buffer: NDArray[int16] | None = None,
mode: RatioMode | str | int = "none",
segment: int = 0,
) -> None
Set the data buffer for the specified channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str | int
|
The channel. Can be an enum member name (case insensitive) or value. |
required |
buffer
|
NDArray[int16] | None
|
A numpy array of dtype int16. If |
None
|
mode
|
RatioMode | str | int
|
The ratio mode. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment where the data is stored. |
0
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 | |
set_data_buffers
¤
set_data_buffers(
channel: Channel | str | int,
buffer_max: NDArray[int16] | None = None,
buffer_min: NDArray[int16] | None = None,
mode: RatioMode | str | int = "none",
segment: int = 0,
) -> None
Set the location of one or two buffers for receiving data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str | int
|
The channel. Can be an enum member name (case insensitive) or value. |
required |
buffer_max
|
NDArray[int16] | None
|
A user-allocated buffer to receive the maximum data values in aggregation mode,
or the non-aggregated values otherwise. Each value is a 16-bit ADC count scaled
according to the selected voltage range for the |
None
|
buffer_min
|
NDArray[int16] | None
|
A user-allocated buffer to receive the minimum data values in aggregation mode.
Not normally used in other modes, but you can direct the driver to write non-aggregated
values to this buffer by setting |
None
|
mode
|
RatioMode | str | int
|
The ratio mode. Can be an enum member name (case insensitive) or value. |
'none'
|
segment
|
int
|
The index of the memory segment where the data is stored. |
0
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | |
set_device_resolution
¤
set_device_resolution(bit_depth: DeviceResolution | str | int) -> None
Set the device resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bit_depth
|
DeviceResolution | str | int
|
The resolution. Can be an enum member name (case insensitive,
with or without the |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 | |
set_digital_port
¤
Enable the digital port and set the logic level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
Channel | str | int
|
A digital channel. Can be an enum member name (case insensitive) or value. |
required |
logic_level
|
int
|
The voltage at which the state transitions from 0 to 1. |
required |
enabled
|
bool
|
Whether to enable or disable the |
True
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
set_ets
¤
Enable or disable ETS (equivalent-time sampling) and set the ETS parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ETSMode | str | int
|
The ETS mode. Can be an enum member name (case insensitive) or value. |
required |
cycles
|
int
|
The number of ETS cycles to store. |
required |
interleave
|
int
|
The number of waveforms to combine into a single ETS capture. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The effective sampling interval, in seconds, of the ETS data. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 | |
set_ets_time_buffer
¤
Set the ETS time buffers.
This function tells the driver where to find your applications ETS time buffers. These buffers contain the timing information for each ETS sample after you run a block-mode ETS capture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buffer
|
NDArray[int64]
|
A numpy array of dtype int64 where each element represents the time, in femtoseconds, at which the samples were captured. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 | |
set_no_of_captures
¤
set_no_of_captures(n: int) -> None
Sets the number of captures to be collected in one run of rapid block mode.
If you do not call this function before a run, the driver will capture only one waveform. Once a value has been set, the value remains constant unless changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of captures. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 | |
set_output_edge_detect
¤
set_output_edge_detect(*, enable: bool) -> None
Enables or disables output edge detection mode for the logic trigger.
Output edge detection is enabled by default and should be left enabled for normal operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
bool
|
Whether to enable or disable output edge detection mode. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1249 1250 1251 1252 1253 1254 1255 1256 1257 | |
set_pulse_width_digital_port_properties
¤
set_pulse_width_digital_port_properties(
directions: Sequence[DigitalChannelDirections],
) -> None
Set the individual digital channels' pulse-width trigger directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directions
|
Sequence[DigitalChannelDirections]
|
The digital-port properties. The sequence can contain a single element describing
the properties of one digital channel, or a number of elements describing several digital
channels. If empty, digital pulse width triggering is switched off. A digital channel that
is not included in the array will be set to |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 | |
set_pulse_width_qualifier_conditions
¤
set_pulse_width_qualifier_conditions(
conditions: Sequence[Condition], info: ConditionsInfo | str | int
) -> None
Set the condition to the pulse-width qualifier.
It can either add the new condition to the existing qualifier, or clear the existing qualifier and replace it with the new condition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conditions
|
Sequence[Condition]
|
A sequence of conditions. |
required |
info
|
ConditionsInfo | str | int
|
Whether to add this condition to the existing definition or clear the definition and start a new one. Can be an enum member name (case insensitive) or value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 | |
set_pulse_width_qualifier_directions
¤
Set the directions for all the trigger sources used with the pulse-width qualifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directions
|
Sequence[Direction]
|
Specifies which direction to apply to each trigger source. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1288 1289 1290 1291 1292 1293 1294 1295 | |
set_pulse_width_qualifier_properties
¤
set_pulse_width_qualifier_properties(
lower: int, upper: int = 0, type: PulseWidthType | str | int = "none"
) -> None
Set the pulse width timings and logic type of the pulse-width trigger qualifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lower
|
int
|
The lower limit of the pulse-width counter, in samples. This argument is required for all pulse width types. |
required |
upper
|
int
|
The upper limit of the pulse-width counter, in samples. This argument is
used only when the type is |
0
|
type
|
PulseWidthType | str | int
|
The type of pulse width trigger. Can be an enum member name (case insensitive) or value. |
'none'
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 | |
set_sig_gen_arbitrary
¤
set_sig_gen_arbitrary(
waveform: NDArray[float64],
repetition_rate: float | None = None,
offset_voltage: float = 0.0,
peak_to_peak: float | None = None,
start_delta_phase: int | None = None,
stop_delta_phase: int | None = None,
delta_phase_increment: int = 0,
dwell_count: int | None = None,
sweep_type: SweepType | str | int = "up",
operation: ExtraOperations | str | int = "off",
index_mode: IndexMode | str | int = "single",
shots: int = 0,
sweeps: int = 0,
trigger_type: SigGenTrigType | str | int = "rising",
trigger_source: SigGenTrigSource | str | int = "none",
ext_in_threshold: int = 0,
) -> NDArray[int16]
Set the signal generator to produce an arbitrary waveform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
NDArray[float64]
|
The arbitrary waveform, in volts. Must be 1D array. |
required |
repetition_rate
|
float | None
|
The requested repetition rate (frequency in Hz) of the entire arbitrary waveform.
The actual repetition rate that is used may be different based on the specifications of
the AWG. If specified then the
sig_gen_frequency_to_phase
method is called (with the |
None
|
offset_voltage
|
float
|
The offset, in volts, to be applied to the waveform. |
0.0
|
peak_to_peak
|
float | None
|
The peak-to-peak voltage of the waveform signal. If |
None
|
start_delta_phase
|
int | None
|
The initial value added to the phase accumulator as the generator begins
to step through the waveform buffer. If |
None
|
stop_delta_phase
|
int | None
|
The final value added to the phase accumulator before the generator restarts or
reverses the sweep. When frequency sweeping is not required, set equal to |
None
|
delta_phase_increment
|
int
|
The amount added to the delta phase value every time the |
0
|
dwell_count
|
int | None
|
The time, in 50 ns steps, between successive additions of |
None
|
sweep_type
|
SweepType | str | int
|
How the frequency will sweep from |
'up'
|
operation
|
ExtraOperations | str | int
|
The type of waveform to be produced. Can be an enum member name (case insensitive) or value. |
'off'
|
index_mode
|
IndexMode | str | int
|
Specifies how the signal will be formed from the arbitrary waveform data. Can be an enum member name (case insensitive) or value. |
'single'
|
shots
|
int
|
See the manual. |
0
|
sweeps
|
int
|
See the manual. |
0
|
trigger_type
|
SigGenTrigType | str | int
|
The type of trigger that will be applied to the signal generator. Can be an enum member name (case insensitive) or value. |
'rising'
|
trigger_source
|
SigGenTrigSource | str | int
|
The source that will trigger the signal generator. Can be an enum member name (case insensitive) or value. |
'none'
|
ext_in_threshold
|
int
|
Used to set trigger level for an external trigger. |
0
|
Returns:
| Type | Description |
|---|---|
NDArray[int16]
|
The arbitrary waveform in ADU counts. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 | |
set_sig_gen_builtin_v2
¤
set_sig_gen_builtin_v2(
offset_voltage: float = 0.0,
peak_to_peak: float = 1.0,
wave_type: WaveType | str | int = "sine",
start_frequency: float = 1.0,
stop_frequency: float | None = None,
increment: float = 0.1,
dwell_time: float = 1.0,
sweep_type: SweepType | str | int = "up",
operation: ExtraOperations | str | int = "off",
shots: int = 0,
sweeps: int = 0,
trigger_type: SigGenTrigType | str | int = "rising",
trigger_source: SigGenTrigSource | str | int = "none",
ext_in_threshold: int = 0,
) -> None
Set up the signal generator to produce a signal from a list of built-in waveforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset_voltage
|
float
|
The voltage offset, in volts, to be applied to the waveform. |
0.0
|
peak_to_peak
|
float
|
The peak-to-peak voltage, in volts, of the waveform signal. |
1.0
|
wave_type
|
WaveType | str | int
|
The type of waveform to be generated. Can be an enum member name (case insensitive) or value. |
'sine'
|
start_frequency
|
float
|
The frequency that the signal generator will initially produce. |
1.0
|
stop_frequency
|
float | None
|
The frequency at which the sweep reverses direction or returns
to the initial frequency. If |
None
|
increment
|
float
|
The amount of frequency increase or decrease in sweep mode. |
0.1
|
dwell_time
|
float
|
The time, in seconds, for which the sweep stays at each frequency. |
1.0
|
sweep_type
|
SweepType | str | int
|
How the frequency will sweep from |
'up'
|
operation
|
ExtraOperations | str | int
|
The type of waveform to be produced (not used by 5000A models). Can be an enum member name (case insensitive) or value. |
'off'
|
shots
|
int
|
See the manual. |
0
|
sweeps
|
int
|
See the manual. |
0
|
trigger_type
|
SigGenTrigType | str | int
|
The type of trigger that will be applied to the signal generator. Can be an enum member name (case insensitive) or value. |
'rising'
|
trigger_source
|
SigGenTrigSource | str | int
|
The source that will trigger the signal generator. Can be an enum member name (case insensitive) or value. |
'none'
|
ext_in_threshold
|
int
|
Used to set trigger level for an external trigger. |
0
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 | |
set_timebase
¤
Set the timebase information.
This method does not consider ETS (equivalent-time sampling). If using ETS, consider using set_ets. See also, nearest_sample_interval_stateless.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt
|
float
|
The requested sampling interval, in seconds. |
required |
duration
|
float
|
The number of seconds to acquire samples for. |
required |
segment
|
int
|
The index of the memory segment to use. |
0
|
Returns:
| Type | Description |
|---|---|
tuple[float, int]
|
The actual sampling interval (i.e., actual Δt) and the number of samples that will be acquired. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | |
set_trigger
¤
set_trigger(
channel: Channel | str | int,
threshold: float,
*,
delay: float = 0.0,
direction: ThresholdDirection | str | int = "RISING",
timeout: float | None = None,
enable: bool = True
) -> None
Set up the trigger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel | str | int
|
The trigger channel. Can be an enum member name (case insensitive) or value. |
required |
threshold
|
float
|
The threshold voltage to signal a trigger event. |
required |
delay
|
float
|
The time, in seconds, between the trigger occurring and the first sample. |
0.0
|
direction
|
ThresholdDirection | str | int
|
The direction in which the signal must move to cause a trigger. Can be an enum member name (case insensitive) or value. |
'RISING'
|
timeout
|
float | None
|
The time, in seconds, to wait to automatically create a trigger event if no
trigger event occurs. If |
None
|
enable
|
bool
|
Set to |
True
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 | |
set_trigger_channel_conditions_v2
¤
set_trigger_channel_conditions_v2(
conditions: Sequence[Condition], info: ConditionsInfo | str | int
) -> None
Sets up trigger conditions on the scope's inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conditions
|
Sequence[Condition]
|
The conditions that should be applied to each channel. In the simplest case, the sequence consists of a single element. When there is more than one element, the overall trigger condition is the logical OR of all the elements. |
required |
info
|
ConditionsInfo | str | int
|
Specifies whether to clear the existing conditions or add the current condition to them using logical OR. Can be an enum member name (case insensitive) or value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | |
set_trigger_channel_directions_v2
¤
Sets the direction of the trigger for each channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directions
|
Sequence[Direction]
|
A sequence of directions in which the signal must pass through the threshold to activate the trigger. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1611 1612 1613 1614 1615 1616 1617 1618 1619 | |
set_trigger_channel_properties_v2
¤
set_trigger_channel_properties_v2(
properties: Sequence[TriggerChannelPropertiesV2],
) -> None
Enable or disable triggering and set its parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
properties
|
Sequence[TriggerChannelPropertiesV2]
|
The requested properties. The sequence can contain a single element describing the properties of one channel, or a number of elements describing several channels. If empty, triggering is switched off. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 | |
set_trigger_delay
¤
set_trigger_delay(delay: float) -> None
Sets the post-trigger delay, which causes capture to start a defined time after the trigger event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
float
|
The time, in seconds, between the trigger occurring and the first sample |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 | |
set_trigger_digital_port_properties
¤
set_trigger_digital_port_properties(
directions: Sequence[DigitalChannelDirections],
) -> None
Set the individual digital channel's trigger directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directions
|
Sequence[DigitalChannelDirections]
|
The digital-port properties. The sequence can contain a single element describing
the properties of one digital channel, or a number of elements describing several digital
channels. If empty, digital pulse width triggering is switched off. A digital channel that
is not included in the array will be set to |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | |
sig_gen_arbitrary_min_max_values
¤
Get the range of possible sample values and waveform buffer sizes.
Returns:
| Type | Description |
|---|---|
tuple[int, int, int, int]
|
The range of possible sample values and waveform buffer sizes that can be supplied to
set_sig_gen_arbitrary
for setting up the arbitrary waveform generator (i.e., |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 | |
sig_gen_frequency_to_phase
¤
sig_gen_frequency_to_phase(
repetition_rate: float, index_mode: IndexMode | str | int, size: int
) -> int
Converts a frequency to a phase count for use with the arbitrary waveform generator (AWG).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repetition_rate
|
float
|
The requested repetition rate (frequency in Hz) of the entire arbitrary waveform. |
required |
index_mode
|
IndexMode | str | int
|
Specifies how the signal will be formed from the arbitrary waveform data. Can be an enum member name (case insensitive) or value. |
required |
size
|
int
|
The size (number of samples) of the waveform. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The phase count. The phase count can then be sent to the driver through set_sig_gen_arbitrary. |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 | |
sig_gen_software_control
¤
sig_gen_software_control(*, state: bool) -> None
Send a software trigger event, or starts and stops gating.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
bool
|
Specifies the new state of the gate signal. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1710 1711 1712 1713 1714 1715 1716 | |
stop
¤
stop() -> None
Stop the oscilloscope from sampling data.
If this function is called before a trigger event occurs, then the oscilloscope may not contain valid data.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1718 1719 1720 1721 1722 1723 1724 | |
trigger_within_pre_trigger_samples
¤
trigger_within_pre_trigger_samples(
state: TriggerWithinPreTrigger | str | int,
) -> None
Allow a trigger anywhere within the pre-trigger samples.
This function selects a mode in which the scope can be triggered anywhere within the pre-trigger samples, as opposed to the normal operation of only arming the trigger after all the pre-trigger samples have been collected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
TriggerWithinPreTrigger | str | int
|
Can be an enum member name (case insensitive) or value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | |
wait_until_ready
¤
wait_until_ready() -> None
Blocking function to wait for the scope to finish acquiring samples.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1739 1740 1741 1742 | |
A wrapper around the PicoScope SDK.
The main class is PicoScope. The other classes are enumerations and structs from the SDK. Version 11.1.0.418 of the SDK was used as a reference.
Warning
This class was written for the ps5000a SDK. Different SDKs (e.g., ps4000a) have similar function signatures and may or may not work with this class. Note that Pico Technology have their own repository to support their products.
Channel
(IntEnum)
¤
An analogue input channel, 8-bit digital port or other input.
Attributes:
| Name | Type | Description |
|---|---|---|
A |
int
|
Analogue channel A. |
B |
int
|
Analogue channel B. |
C |
int
|
Analogue channel C. |
D |
int
|
Analogue channel D. |
EXT |
int
|
External trigger input; not on MSOs. |
MAX_CHANNELS |
int
|
|
TRIGGER_AUX |
int
|
Reserved. |
MAX_TRIGGER_SOURCES |
int
|
|
PORT0 |
int
|
Digital port 0, inputs D0-D7, MSO models only. |
PORT1 |
int
|
Digital port 1, inputs D8-D15, MSO models only. |
PORT2 |
int
|
Reserved. |
PORT3 |
int
|
Reserved. |
PULSE_WIDTH_SOURCE |
int
|
Pulse width qualifier. |
ChannelFlags
(IntFlag)
¤
Channel flags enum.
Attributes:
| Name | Type | Description |
|---|---|---|
A |
int
|
Analogue channel A. |
B |
int
|
Analogue channel B. |
C |
int
|
Analogue channel C. |
D |
int
|
Analogue channel D. |
PORT0 |
int
|
Digital port 0, inputs D0-D7, MSO models only. |
PORT1 |
int
|
Digital port 1, inputs D8-D15, MSO models only. |
PORT2 |
int
|
Reserved. |
PORT3 |
int
|
Reserved. |
ChannelSettings
¤
ChannelSettings(
*,
bandwidth: BandwidthLimiter,
channel: Channel,
enabled: bool,
coupling: Coupling,
voltage_range: float,
voltage_offset: float,
max_adu_value: int
)
The settings for a channel.
Do not instantiate this class directly. Created when set_channel is called.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
Channel
|
The channel. |
required |
bandwidth
|
BandwidthLimiter
|
The bandwidth limiter that is used. |
required |
enabled
|
bool
|
Whether the channel is enabled. |
required |
coupling
|
Coupling
|
The impedance and coupling type. |
required |
voltage_range
|
float
|
The voltage range, in Volts. |
required |
voltage_offset
|
float
|
The voltage offset, in Volts. |
required |
max_adu_value
|
int
|
The maximum analogue-to-digital value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | |
bandwidth
instance-attribute
¤
bandwidth: BandwidthLimiter = bandwidth
The bandwidth limiter that is used.
voltage_offset
instance-attribute
¤
voltage_offset: float = voltage_offset
The voltage offset, in Volts.
voltage_range
instance-attribute
¤
voltage_range: float = voltage_range
The voltage range, in Volts.
volts_per_adu
instance-attribute
¤
The voltage/ADU factor.
allocate
¤
Maybe allocate memory to save the samples (if the array needs to be resized).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
int
|
The number of samples. |
required |
num_captures
|
int
|
The number of captures. |
1
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 | |
Condition
(Structure)
¤
Trigger condition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Channel | str | int
|
The channel to use for the condition. Can be an enum member name (case insensitive) or value. |
required |
condition
|
TriggerState | str | int
|
The trigger state of the |
'DONT_CARE'
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 | |
DigitalChannelDirections
(Structure)
¤
DigitalChannelDirections(channel: int, direction: DigitalDirection | str | int)
The trigger direction for the specified digital channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
The digital channel number. |
required |
direction
|
DigitalDirection | str | int
|
The direction in which the digital input must cross the threshold(s) to cause a trigger event. Can be an enum member name (case insensitive) or value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 | |
DigitalDirection
(IntEnum)
¤
The polarity of a digital channel used as a trigger source.
Attributes:
| Name | Type | Description |
|---|---|---|
DONT_CARE |
int
|
Ignore input. |
LOW |
int
|
Input must be low. |
HIGH |
int
|
Input must be high. |
RISING |
int
|
Input must have a rising edge. |
FALLING |
int
|
Input must have a falling edge. |
RISING_OR_FALLING |
int
|
Input must have an edge of either polarity. |
Direction
(Structure)
¤
Direction(
source: Channel | str | int,
direction: ThresholdDirection | str | int = "rising",
mode: ThresholdMode | str | int = "level",
)
The direction in which the specified source signal must cross the threshold(s) to produce a trigger event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Channel | str | int
|
The channel to use for the trigger source. Can be an enum member name (case insensitive) or value. |
required |
direction
|
ThresholdDirection | str | int
|
The direction in which the signal must cross the threshold. Can be an enum member name (case insensitive) or value. |
'rising'
|
mode
|
ThresholdMode | str | int
|
Whether to use a level trigger (a single threshold) or a window trigger (two thresholds defining a range). |
'level'
|
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 | |
IndexMode
(IntEnum)
¤
Index mode used by the arbitrary waveform generator.
Attributes:
| Name | Type | Description |
|---|---|---|
SINGLE |
int
|
The generator outputs the raw contents of the buffer repeatedly.
This mode is the only one that can generate asymmetrical waveforms. You
can also use this mode for symmetrical waveforms, but the |
DUAL |
int
|
The generator outputs the contents of the buffer from beginning to
end, and then does a second pass in the reverse direction through the buffer.
This allows you to specify only the first half of a waveform with twofold
symmetry, such as a Gaussian function, and let the generator fill in the
other half. |
QUAD |
int
|
Not used. |
PulseWidthType
(IntEnum)
¤
The type of pulse-width trigger.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
int
|
Do not use the pulse width qualifier. |
LESS_THAN |
int
|
Pulse width less than lower. |
GREATER_THAN |
int
|
Pulse width greater than lower. |
IN_RANGE |
int
|
Pulse width between lower and upper. |
OUT_OF_RANGE |
int
|
Pulse width not between lower and upper. |
Range
(IntEnum)
¤
The possible voltage ranges to which an analogue input channel can be set.
Each range is bipolar, so the R_10mV range spans from -10 mV to +10 mV.
Attributes:
| Name | Type | Description |
|---|---|---|
R_10mV |
int
|
|
R_20mV |
int
|
|
R_50mV |
int
|
|
R_100mV |
int
|
|
R_200mV |
int
|
|
R_500mV |
int
|
|
R_1V |
int
|
|
R_2V |
int
|
|
R_5V |
int
|
|
R_10V |
int
|
|
R_20V |
int
|
|
R_50V |
int
|
|
R_MAX |
int
|
|
RatioMode
(IntEnum)
¤
Various methods of data reduction (down sampling).
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
int
|
No down sampling. |
AGGREGATE |
int
|
Reduces every block of n values to just two values: a minimum and a maximum. |
DECIMATE |
int
|
Reduces every block of n values to just the first value in the block,
discarding all the other values. |
AVERAGE |
int
|
Reduces every block of n values to a single value representing the
average (arithmetic mean) of all the values. |
DISTRIBUTION |
int
|
Not used. |
SigGenTrigSource
(IntEnum)
¤
How triggering of the signal generator or arbitrary waveform generator works.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
int
|
Run without waiting for trigger. |
SCOPE_TRIG |
int
|
Use scope trigger. |
AUX_IN |
int
|
Use AUX input. |
EXT_IN |
int
|
Use EXT input. |
SOFT_TRIG |
int
|
Wait for software trigger from
sig_gen_software_control.
|
SweepType
(IntEnum)
¤
The frequency sweep mode of the signal generator or arbitrary waveform generator.
Attributes:
| Name | Type | Description |
|---|---|---|
UP |
int
|
Sweep the frequency from lower limit up to upper limit. |
DOWN |
int
|
Sweep the frequency from upper limit down to lower limit. |
UPDOWN |
int
|
Sweep the frequency up and then down. |
DOWNUP |
int
|
Sweep the frequency down and then up. |
ThresholdDirection
(IntEnum)
¤
The direction(s) in which the trigger source must cross the threshold(s) to cause a trigger event.
Attributes:
| Name | Type | Description |
|---|---|---|
ABOVE |
int
|
Using upper threshold. |
BELOW |
int
|
Using upper threshold. |
RISING |
int
|
Using upper threshold. |
FALLING |
int
|
Using upper threshold. |
RISING_OR_FALLING |
int
|
Using both thresholds. |
ABOVE_LOWER |
int
|
Using lower threshold. |
BELOW_LOWER |
int
|
Using lower threshold. |
RISING_LOWER |
int
|
Using lower threshold. |
FALLING_LOWER |
int
|
Using lower threshold. |
INSIDE |
int
|
Windowing using both thresholds. |
OUTSIDE |
int
|
Windowing using both thresholds. |
ENTER |
int
|
Windowing using both thresholds. |
EXIT |
int
|
Windowing using both thresholds. |
ENTER_OR_EXIT |
int
|
Windowing using both thresholds. |
POSITIVE_RUNT |
int
|
Windowing using both thresholds. |
NEGATIVE_RUNT |
int
|
Windowing using both thresholds. |
NONE |
int
|
No trigger set. |
TriggerChannelPropertiesV2
(Structure)
¤
TriggerChannelPropertiesV2(
threshold_upper: int,
threshold_upper_hysteresis: int,
threshold_lower: int,
threshold_lower_hysteresis: int,
channel: Channel | str | int,
)
The trigger thresholds for a given channel (version 2).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold_upper
|
int
|
The upper threshold at which the trigger must fire. This is scaled in 16-bit ADC counts at the currently selected range for that channel. |
required |
threshold_upper_hysteresis
|
int
|
The hysteresis by which the trigger must exceed the upper threshold before it will fire. It is scaled in 16-bit counts. |
required |
threshold_lower
|
int
|
The lower threshold at which the trigger must fire. This is scaled in 16-bit ADC counts at the currently selected range for that channel. |
required |
threshold_lower_hysteresis
|
int
|
The hysteresis by which the trigger must exceed the lower threshold before it will fire. It is scaled in 16-bit counts. |
required |
channel
|
Channel | str | int
|
The channel to which the properties apply. Can be an enum member name (case insensitive) or value. |
required |
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 | |
TriggerInfo
dataclass
¤
The trigger timestamp information for the specified buffer segment.
Attributes:
| Name | Type | Description |
|---|---|---|
segment_index |
int
|
A zero-based index identifying the segment. |
trigger_index |
int
|
The index of the trigger point measured in samples within the captured data, with the first sample being index 0. |
trigger_time |
float
|
The trigger offset time, in seconds. |
timestamp_counter |
int
|
The number of sample intervals between the trigger point of this segment and the previous segment. This allows you to determine the time interval between the trigger points of captures within a single rapid block run. |
block_ready
¤
block_ready(f: PicoTechBlockReadyCallback) -> _CFunctionType
Use as a decorator for a callback function when the data block is ready.
See ps5000a_block_ready_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1755 1756 1757 1758 1759 1760 1761 | |
data_ready
¤
data_ready(f: PicoTechDataReadyCallback) -> _CFunctionType
Use as a decorator for a callback function when the data is ready.
See ps5000a_data_ready_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1764 1765 1766 1767 1768 1769 1770 | |
streaming_ready
¤
streaming_ready(f: PicoTechStreamingReadyCallback) -> _CFunctionType
Use as a decorator for a callback function when the data stream is ready.
See ps5000a_streaming_ready_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/picotech/picoscope.py
1773 1774 1775 1776 1777 1778 1779 | |