adding formatted CCS code for NI Switch-scanning with dmm handshaking.#22
Open
bkumarng-NI wants to merge 1 commit into
Open
adding formatted CCS code for NI Switch-scanning with dmm handshaking.#22bkumarng-NI wants to merge 1 commit into
bkumarng-NI wants to merge 1 commit into
Conversation
adding formatted CCS code for NI Switch-scanning with dmm handshaking.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new NI-SWITCH example demonstrating scan-based switching coordinated with NI-DMM measurements via TTL/PXI trigger handshaking, including CLI configurability and simulated-run tests.
Changes:
- Introduces
niswitch_scanning_with_dmm_handshaking.pywith switch/DMM session setup, trigger routing, and measurement fetch/printing. - Adds CLI parameters for resource names, topology, scan list, fetch count, and DMM range/resolution, plus simulation options.
- Adds
test_example()/test_main()to exercise the example in simulated mode.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+45
to
+48
| def example( switch_resource_name, switch_topology, dmm_resource_name, dmm_options, | ||
| scan_list, samples_to_fetch, dmm_range, dmm_resolution, | ||
| continuous_scan, switch_simulate, reset_device): | ||
| """ |
Comment on lines
+148
to
+150
| dmm_session.configure_trigger(trigger_source=nidmm.TriggerSource.PXI_TRIG1) | ||
| dmm_session._set_attribute_vi_int32(attribute_id=1250334, attribute_value=0) # Trigger slope: Falling | ||
|
|
Comment on lines
+179
to
+182
| measurement = dmm_session.fetch_multi_point( | ||
| array_size=max(dmm_status[0], samples_to_fetch), | ||
| maximum_time=5000, | ||
| ) |
Comment on lines
+151
to
+158
| # -> Configure DMM Multi-Point Acquisition | ||
| # - sample_count=0 → continuous acquisition (DMM keeps measuring until abort) | ||
| # - IMMEDIATE sample trigger: DMM samples immediately after each trigger | ||
| dmm_session.configure_multi_point( | ||
| trigger_count=1, | ||
| sample_count=0, | ||
| sample_trigger=nidmm.SampleTrigger.IMMEDIATE, | ||
| ) |
| example( | ||
| switch_resource_name='PXI2568', | ||
| switch_topology='2568/31-SPST', | ||
| dmm_resource_name='DMM', |
Comment on lines
+159
to
+160
| dmm_session._set_attribute_vi_int32(attribute_id=1150010, attribute_value=0) # Raw attribute: multi-point config | ||
|
|
Comment on lines
+165
to
+166
| dmm_session._set_attribute_vi_int32(attribute_id=1150002, attribute_value=0) # Raw attribute: meas complete dest config | ||
|
|
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.
adding formatted CCS code for NI Switch-scanning with dmm handshaking.
python niswitch_scanning_with_dmm_handshaking.py -swrn "2568_Switch" -swtp "2568/31-SPST" -dmmrn "4081_DMM1" -sl "ch0->com0;" -sf 7 -dr 10.0 -dres 1e-3
python niswitch_scanning_with_dmm_handshaking.py -sim -dop "Simulate=1, DriverSetup=Model:4081"