Repository navigation
Adding Continuous Acquisition Chart Multiple Samples example in NI-DMM - #2220
NI-velmurugan wants to merge 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2220 +/- ##
=======================================
Coverage 88.11% 88.12%
=======================================
Files 88 88
Lines 22832 22832
=======================================
+ Hits 20119 20120 +1
+ Misses 2713 2712 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The plotting approach in this example follows the existing gRPC Device Server example continuous-acquire-graph-multiple-points.py , which displays the continuous data with matplotlib. |
|
@jarnoldNI, the PR is ready for your review. |
| try: | ||
| with session.initiate(): | ||
| # A fetch_count of None runs until the chart window is closed or Ctrl+C is pressed | ||
| while plt.fignum_exists(figure.number) and ( |
There was a problem hiding this comment.
Intentionally skipped the LabVIEW STOP button behavior to keep the example simple.
The loop stops when the chart window is closed or Ctrl+C is pressed.
There was a problem hiding this comment.
There's certainly precedent for leaving out something like in our Python examples.
niscope_fetch_forever.py terminates its fetch while loop after fetching after a configured number of samples.
This, like that, is a continuous acquisition, so perhaps we should use a similar termination mechanism?
Does your current code update the graph continuously?
Can you post a screenshot of what the plot looks like? |
Thanks for pointing that out. I've attached screenshots of the plot below with additional details for clarity: Screenshot 1: Shows the plot generated with Python example. Please let me know if there's any other information you'd like me to include.
|
| figure, axes = plt.subplots() | ||
| (line,) = axes.plot([]) | ||
| axes.set_title('Measurements') | ||
| axes.set_xlabel('Samples') | ||
| axes.set_ylabel('Measured value') | ||
| axes.grid(True) |
There was a problem hiding this comment.
All this matplotlib stuff feels like a distraction from the demonstration of how to use nidmm. @marcoskirsch what do you think?
There was a problem hiding this comment.
It seems a bit more involved than what we did for the nidaqmx examples:
- https://github.com/ni/nidaqmx-python/blob/master/examples/analog_in/voltage_acq_int_clk_plot_data.py
- https://github.com/ni/nidaqmx-python/blob/master/examples/analog_in/voltage_acq_int_clk_plot_wfm.py
But that might be because it's doing a chart rather than a single graph.


- [ ] I've added tests applicable for this pull requestWhat does this Pull Request accomplish?
This PR adds
nidmm_cont_acq_chart_multiple_samples.py, a Python adaptation of the LabVIEWCont Acq & Chart Multiple Samples.viWhat testing has been done?