Adding continuous update example for scope#15
Open
Upatel-NI wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new NI-SCOPE example script that continuously acquires waveform data and displays it in a live-updating matplotlib graph, aligning with the repo’s “community examples” goal of providing runnable reference workflows.
Changes:
- Introduces
niscope_continuously_update_graph.pyimplementing continuous acquisition + animated plotting. - Adds a CLI entry point to configure acquisition parameters (samples, vertical range/coupling, sample rate, etc.).
- Adds basic simulated-run test helpers (
test_example,test_main) for automation parity with other examples.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+43
to
+46
| resource_name (str): Resource name of the Scope (e.g., 'PXIe5162') | ||
| options (dict): Session options dictionary for driver configuration | ||
| num_samples (int, optional): Number of samples to read. Defaults to 250.0 | ||
| vertical_range (float, optional): Voltage range in volts. Defaults to 5.0 |
| """Parses command-line arguments and runs the example.""" | ||
| parser = argparse.ArgumentParser(description='NI-SCOPE Continuously Update Graph Example') | ||
|
|
||
| parser.add_argument('-n', '--resource_name', default='PXIe5162', help='Resource name of the NI oscilloscope (default: PXIe5162)') |
|
|
||
| def test_example(): | ||
| """Simulated hardware test — runs example() with a virtual PXIe-5162 (no real HW needed).""" | ||
| options = {'Simulate': '1','DriverSetup': 'Model:5162; BoardType:PXIe'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this Pull Request accomplish?
Adding continuous update graph example for scope
Why should this Pull Request be merged?
Adding continuous update graph example for scope
What testing has been done?
or continuous example

With command line
Normal execution

For read and plot example


With command line
Normal execution