Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)
system is configured as specified in the PXI Trigger Lines and RTSI
Lines topic of the NI-TClk Synchronization Help. You can locate this
help file at Start>>Programs>>National Instruments>>NI-TClk.
Args:
sessions (list of (Driver Session or nitclk.SessionReference)): sessions is an array of sessions that are being synchronized.
min_tclk_period (hightime.timedelta, datetime.timedelta, or float in seconds): Minimal period of TClk, expressed in seconds. Supported values are
between 0.0 s and 0.050 s (50 ms). Minimal period for a single
chassis/PC is 200 ns. If the specified value is less than 200 ns,
NI-TClk automatically coerces minTime to 200 ns. For multichassis
synchronization, adjust this value to account for propagation delays
through the various devices and cables.
'''
session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160
sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_number_list(sessions), library_type=_visatype.ViSession) # case B520
min_tclk_period_ctype = _converters.convert_timedelta_to_seconds_real64(min_tclk_period) # case S140
error_code = self._library.niTClk_Synchronize(session_count_ctype, sessions_ctype, min_tclk_period_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return
support pause triggers, configure_for_homogeneous_triggers does not
affect pause triggers. Pause triggers are considered to be configured
for all sessions if either one or the other of the following conditions
is true: - No session has a pause trigger that is None - One session has
a pause trigger that is None and all other sessions have pause triggers
other than None. The one session with the None trigger must have
pause_trigger_master_session set to itself, indicating
that the session itself is the pause trigger master Note: TClk
synchronization is not supported for pause triggers on acquisition
sessions.
Args:
sessions (list of (Driver Session or nitclk.SessionReference)): sessions is an array of sessions that are being synchronized.
'''
session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160
sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_number_list(sessions, _visatype.ViSession), library_type=_visatype.ViSession) # case B520
error_code = self._library.niTClk_ConfigureForHomogeneousTriggers(session_count_ctype, sessions_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return
error, use the return values of the individual methods because once
_get_extended_error_info reports an errorString, it does not report
an empty string again.
Returns:
error_string (str): Extended error description. If errorString is NULL, then it is not large
enough to hold the entire error description. In this case, the return
value of _get_extended_error_info is the size that you should use
for _get_extended_error_info to return the full error string.
'''
error_string_ctype = None # case C050
error_string_size_ctype = _visatype.ViUInt32() # case S170
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=True)
error_string_size_ctype = _visatype.ViUInt32(error_code) # case S180
error_string_ctype = (_visatype.ViChar * error_string_size_ctype.value)() # case C060
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True)
return error_string_ctype.value.decode(self._encoding)
system is configured as specified in the PXI Trigger Lines and RTSI
Lines topic of the NI-TClk Synchronization Help. You can locate this
help file at Start>>Programs>>National Instruments>>NI-TClk.
Args:
sessions (list of (Driver Session or nitclk.SessionReference)): sessions is an array of sessions that are being synchronized.
min_tclk_period (float in seconds or datetime.timedelta): Minimal period of TClk, expressed in seconds. Supported values are
between 0.0 s and 0.050 s (50 ms). Minimal period for a single
chassis/PC is 200 ns. If the specified value is less than 200 ns,
NI-TClk automatically coerces minTime to 200 ns. For multichassis
synchronization, adjust this value to account for propagation delays
through the various devices and cables.
'''
session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160
sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_number_list(sessions, _visatype.ViSession), library_type=_visatype.ViSession) # case B520
min_tclk_period_ctype = _converters.convert_timedelta_to_seconds(min_tclk_period, _visatype.ViReal64) # case S140
error_code = self._library.niTClk_Synchronize(session_count_ctype, sessions_ctype, min_tclk_period_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return
Reports extended error information for the most recent NI-TClk method
that returned an error. To establish the method that returned an
error, use the return values of the individual methods because once
_get_extended_error_info reports an errorString, it does not report
an empty string again.
Returns:
error_string (str): Extended error description. If errorString is NULL, then it is not large
enough to hold the entire error description. In this case, the return
value of _get_extended_error_info is the size that you should use
for _get_extended_error_info to return the full error string.
'''
error_string_ctype = None # case C050
error_string_size_ctype = _visatype.ViUInt32() # case S170
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=True)
error_string_size_ctype = _visatype.ViUInt32(error_code) # case S180
error_string_ctype = (_visatype.ViChar * error_string_size_ctype.value)() # case C060
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True)
return error_string_ctype.value.decode(self._encoding)
Reports extended error information for the most recent NI-TClk method
that returned an error. To establish the method that returned an
error, use the return values of the individual methods because once
_get_extended_error_info reports an errorString, it does not report
an empty string again.
Returns:
error_string (str): Extended error description. If errorString is NULL, then it is not large
enough to hold the entire error description. In this case, the return
value of _get_extended_error_info is the size that you should use
for _get_extended_error_info to return the full error string.
'''
error_string_ctype = None # case C050
error_string_size_ctype = _visatype.ViUInt32() # case S170
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=True)
error_string_size_ctype = _visatype.ViUInt32(error_code) # case S180
error_string_ctype = (_visatype.ViChar * error_string_size_ctype.value)() # case C060
error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True)
return error_string_ctype.value.decode(self._encoding)
r'''finish_sync_pulse_sender_synchronize
Finishes synchronizing the Sync Pulse Sender.
Args:
sessions (list of (nimi-python Session class or nitclk.SessionReference)): sessions is an array of sessions that are being synchronized.
min_time (float in seconds or datetime.timedelta): Minimal period of TClk, expressed in seconds. Supported values are
between 0.0 s and 0.050 s (50 ms). Minimal period for a single
chassis/PC is 200 ns. If the specified value is less than 200 ns,
NI-TClk automatically coerces minTime to 200 ns. For multichassis
synchronization, adjust this value to account for propagation delays
through the various devices and cables.
'''
session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160
sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_number_list(sessions, _visatype.ViSession), library_type=_visatype.ViSession) # case B520
min_time_ctype = _converters.convert_timedelta_to_seconds(min_time, _visatype.ViReal64) # case S140
error_code = self._library.niTClk_FinishSyncPulseSenderSynchronize(session_count_ctype, sessions_ctype, min_time_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return