def test_initialize_multiple_sessions(self): self.patched_library.niTClk_Initiate.side_effect = self.side_effects_helper.niTClk_Initiate nitclk.initiate(multiple_session_references) self.patched_library.niTClk_Initiate.assert_called_once_with( _matchers.ViUInt32Matcher(len(multiple_sessions)), _matchers.ViSessionBufferMatcher(multiple_sessions)) return
def test_initialize_one_session(self): self.patched_library.niTClk_Initiate.side_effect = self.side_effects_helper.niTClk_Initiate nitclk.initiate(single_session) self.patched_library.niTClk_Initiate.assert_called_once_with( _matchers.ViUInt32Matcher(len(single_session)), _matchers.ViSessionBufferMatcher(single_session)) return
def example(resource_name1, resource_name2, options): with niscope.Session(resource_name=resource_name1, options=options) as session1, niscope.Session( resource_name=resource_name2, options=options) as session2: session_list = [session1, session2] for session in session_list: session.configure_vertical(range=1.0, coupling=niscope.VerticalCoupling.DC) session.configure_horizontal_timing(min_sample_rate=50000000, min_num_pts=1000, ref_position=50.0, num_records=1, enforce_realtime=True) session1.trigger_type = niscope.TriggerType.SOFTWARE nitclk.configure_for_homogeneous_triggers(session_list) nitclk.synchronize(session_list, 200e-9) nitclk.initiate(session_list) time.sleep(100) session1.send_software_trigger_edge(niscope.WhichTrigger.START) waveforms = session2.channels[0].fetch(num_samples=1000) for i in range(len(waveforms)): print('Waveform {0} information:'.format(i)) print(str(waveforms[i]) + '\n\n')
def test_nitclk_is_done(multiple_niscope_sessions): nitclk.configure_for_homogeneous_triggers(multiple_niscope_sessions) nitclk.synchronize(multiple_niscope_sessions, .001) nitclk.initiate(multiple_niscope_sessions) nitclk.is_done(multiple_niscope_sessions)