Skip to content

adding formatted CCS code for NI Switch-scanning with dmm handshaking.#22

Open
bkumarng-NI wants to merge 1 commit into
mainfrom
users/bkumarng-NI/adding_switchscanningwithdmm
Open

adding formatted CCS code for NI Switch-scanning with dmm handshaking.#22
bkumarng-NI wants to merge 1 commit into
mainfrom
users/bkumarng-NI/adding_switchscanningwithdmm

Conversation

@bkumarng-NI

Copy link
Copy Markdown
Collaborator

adding formatted CCS code for NI Switch-scanning with dmm handshaking.

  1. With default values :
image
  1. Through CLI custom values:
    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
image
  1. Simulated device:
    python niswitch_scanning_with_dmm_handshaking.py -sim -dop "Simulate=1, DriverSetup=Model:4081"
image

adding formatted CCS code for NI Switch-scanning with dmm handshaking.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py with 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants