diff --git a/docs/nidcpower/class.rst b/docs/nidcpower/class.rst index 9095a7695..7ceb4538b 100644 --- a/docs/nidcpower/class.rst +++ b/docs/nidcpower/class.rst @@ -154,6 +154,11 @@ abort .. note:: One or more of the referenced methods are not in the Python API for this driver. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + clear_latched_output_cutoff_state --------------------------------- @@ -254,6 +259,11 @@ commit + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + configure_aperture_time ----------------------- @@ -505,7 +515,7 @@ create_advanced_sequence_step Creates a new advanced sequence step in the advanced sequence specified by the Active advanced sequence. When you create an advanced sequence - step, each property you passed to the :py:meth:`nidcpower.Session._create_advanced_sequence` + step, each property you passed to the :py:meth:`nidcpower.Session.create_advanced_sequence` method is reset to its default value for that step unless otherwise specified. @@ -524,7 +534,7 @@ create_advanced_sequence_step `Programming States `__ - :py:meth:`nidcpower.Session._create_advanced_sequence` + :py:meth:`nidcpower.Session.create_advanced_sequence` @@ -534,6 +544,11 @@ create_advanced_sequence_step for more information about supported devices. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + :param set_as_active_step: @@ -578,6 +593,11 @@ delete_advanced_sequence for more information about supported devices. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + :param sequence_name: @@ -1126,6 +1146,11 @@ initiate .. note:: This method will return a Python context manager that will initiate on entering and abort on exit. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + lock ---- @@ -1325,14 +1350,12 @@ query_latched_output_cutoff_state .. py:method:: query_latched_output_cutoff_state(output_cutoff_reason) Discovers if an output cutoff limit was exceeded for the specified reason. When an output cutoff is engaged, the output of the channel(s) is disconnected. - If a limit was exceeded, the state is latched until you clear it with the :py:meth:`nidcpower.Session.clear_latched_output_cutoff_state` method or the :py:meth:`nidcpower.Session.ResetWithChannels` method. + If a limit was exceeded, the state is latched until you clear it with the :py:meth:`nidcpower.Session.clear_latched_output_cutoff_state` method or the :py:meth:`nidcpower.Session.reset` method. outputCutoffReason specifies the conditions for which an output is disconnected. - .. note:: One or more of the referenced methods are not in the Python API for this driver. - .. tip:: This method requires repeated capabilities. If called directly on the nidcpower.Session object, then the method will use all repeated capabilities in the session. @@ -1595,6 +1618,11 @@ reset + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + reset_device ------------ @@ -1735,6 +1763,11 @@ send_software_edge_trigger for more information about supported devices. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + :param trigger: @@ -1860,6 +1893,11 @@ wait_for_event for more information about supported devices. + .. tip:: This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + :param event_id: @@ -3642,6 +3680,14 @@ instrument_manufacturer Contains the name of the manufacturer for the device you are currently using. + + + + .. tip:: This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. + The following table lists the characteristics of this property. +----------------+-----------+ @@ -3651,7 +3697,7 @@ instrument_manufacturer +----------------+-----------+ | Permissions | read only | +----------------+-----------+ - | Channel Based | No | + | Channel Based | Yes | +----------------+-----------+ | Resettable | No | +----------------+-----------+ @@ -6652,6 +6698,12 @@ self_calibration_persistence .. note:: This property is not supported by all devices. Refer to Supported Properties by Device for information + + .. tip:: This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. + The following table lists the characteristics of this property. +----------------+----------------------------------+ @@ -6661,7 +6713,7 @@ self_calibration_persistence +----------------+----------------------------------+ | Permissions | read-write | +----------------+----------------------------------+ - | Channel Based | No | + | Channel Based | Yes | +----------------+----------------------------------+ | Resettable | No | +----------------+----------------------------------+ @@ -7134,6 +7186,14 @@ serial_number Contains the serial number for the device you are currently using. + + + + .. tip:: This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. + The following table lists the characteristics of this property. +----------------+-----------+ @@ -7143,7 +7203,7 @@ serial_number +----------------+-----------+ | Permissions | read only | +----------------+-----------+ - | Channel Based | No | + | Channel Based | Yes | +----------------+-----------+ | Resettable | No | +----------------+-----------+ diff --git a/generated/nidcpower/nidcpower/_library.py b/generated/nidcpower/nidcpower/_library.py index 30ee3c9ed..d3bd86588 100644 --- a/generated/nidcpower/nidcpower/_library.py +++ b/generated/nidcpower/nidcpower/_library.py @@ -19,14 +19,14 @@ def __init__(self, ctypes_library): self._func_lock = threading.Lock() self._library = ctypes_library # We cache the cfunc object from the ctypes.CDLL object - self.niDCPower_Abort_cfunc = None + self.niDCPower_AbortWithChannels_cfunc = None self.niDCPower_CalSelfCalibrate_cfunc = None self.niDCPower_ClearLatchedOutputCutoffState_cfunc = None - self.niDCPower_Commit_cfunc = None + self.niDCPower_CommitWithChannels_cfunc = None self.niDCPower_ConfigureApertureTime_cfunc = None - self.niDCPower_CreateAdvancedSequence_cfunc = None - self.niDCPower_CreateAdvancedSequenceStep_cfunc = None - self.niDCPower_DeleteAdvancedSequence_cfunc = None + self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc = None + self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc = None + self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc = None self.niDCPower_Disable_cfunc = None self.niDCPower_ExportAttributeConfigurationBuffer_cfunc = None self.niDCPower_ExportAttributeConfigurationFile_cfunc = None @@ -46,7 +46,7 @@ def __init__(self, ctypes_library): self.niDCPower_ImportAttributeConfigurationBuffer_cfunc = None self.niDCPower_ImportAttributeConfigurationFile_cfunc = None self.niDCPower_InitializeWithChannels_cfunc = None - self.niDCPower_Initiate_cfunc = None + self.niDCPower_InitiateWithChannels_cfunc = None self.niDCPower_LockSession_cfunc = None self.niDCPower_Measure_cfunc = None self.niDCPower_MeasureMultiple_cfunc = None @@ -59,8 +59,9 @@ def __init__(self, ctypes_library): self.niDCPower_QueryOutputState_cfunc = None self.niDCPower_ReadCurrentTemperature_cfunc = None self.niDCPower_ResetDevice_cfunc = None + self.niDCPower_ResetWithChannels_cfunc = None self.niDCPower_ResetWithDefaults_cfunc = None - self.niDCPower_SendSoftwareEdgeTrigger_cfunc = None + self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc = None self.niDCPower_SetAttributeViBoolean_cfunc = None self.niDCPower_SetAttributeViInt32_cfunc = None self.niDCPower_SetAttributeViInt64_cfunc = None @@ -68,10 +69,9 @@ def __init__(self, ctypes_library): self.niDCPower_SetAttributeViString_cfunc = None self.niDCPower_SetSequence_cfunc = None self.niDCPower_UnlockSession_cfunc = None - self.niDCPower_WaitForEvent_cfunc = None + self.niDCPower_WaitForEventWithChannels_cfunc = None self.niDCPower_close_cfunc = None self.niDCPower_error_message_cfunc = None - self.niDCPower_reset_cfunc = None self.niDCPower_self_test_cfunc = None def _get_library_function(self, name): @@ -81,13 +81,13 @@ def _get_library_function(self, name): raise errors.DriverTooOldError() from e return function - def niDCPower_Abort(self, vi): # noqa: N802 + def niDCPower_AbortWithChannels(self, vi, channel_name): # noqa: N802 with self._func_lock: - if self.niDCPower_Abort_cfunc is None: - self.niDCPower_Abort_cfunc = self._get_library_function('niDCPower_Abort') - self.niDCPower_Abort_cfunc.argtypes = [ViSession] # noqa: F405 - self.niDCPower_Abort_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_Abort_cfunc(vi) + if self.niDCPower_AbortWithChannels_cfunc is None: + self.niDCPower_AbortWithChannels_cfunc = self._get_library_function('niDCPower_AbortWithChannels') + self.niDCPower_AbortWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 + self.niDCPower_AbortWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_AbortWithChannels_cfunc(vi, channel_name) def niDCPower_CalSelfCalibrate(self, vi, channel_name): # noqa: N802 with self._func_lock: @@ -105,13 +105,13 @@ def niDCPower_ClearLatchedOutputCutoffState(self, vi, channel_name, output_cutof self.niDCPower_ClearLatchedOutputCutoffState_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_ClearLatchedOutputCutoffState_cfunc(vi, channel_name, output_cutoff_reason) - def niDCPower_Commit(self, vi): # noqa: N802 + def niDCPower_CommitWithChannels(self, vi, channel_name): # noqa: N802 with self._func_lock: - if self.niDCPower_Commit_cfunc is None: - self.niDCPower_Commit_cfunc = self._get_library_function('niDCPower_Commit') - self.niDCPower_Commit_cfunc.argtypes = [ViSession] # noqa: F405 - self.niDCPower_Commit_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_Commit_cfunc(vi) + if self.niDCPower_CommitWithChannels_cfunc is None: + self.niDCPower_CommitWithChannels_cfunc = self._get_library_function('niDCPower_CommitWithChannels') + self.niDCPower_CommitWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 + self.niDCPower_CommitWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_CommitWithChannels_cfunc(vi, channel_name) def niDCPower_ConfigureApertureTime(self, vi, channel_name, aperture_time, units): # noqa: N802 with self._func_lock: @@ -121,29 +121,29 @@ def niDCPower_ConfigureApertureTime(self, vi, channel_name, aperture_time, units self.niDCPower_ConfigureApertureTime_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_ConfigureApertureTime_cfunc(vi, channel_name, aperture_time, units) - def niDCPower_CreateAdvancedSequence(self, vi, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence): # noqa: N802 + def niDCPower_CreateAdvancedSequenceStepWithChannels(self, vi, channel_name, set_as_active_step): # noqa: N802 with self._func_lock: - if self.niDCPower_CreateAdvancedSequence_cfunc is None: - self.niDCPower_CreateAdvancedSequence_cfunc = self._get_library_function('niDCPower_CreateAdvancedSequence') - self.niDCPower_CreateAdvancedSequence_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViInt32), ViBoolean] # noqa: F405 - self.niDCPower_CreateAdvancedSequence_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_CreateAdvancedSequence_cfunc(vi, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence) + if self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc is None: + self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc = self._get_library_function('niDCPower_CreateAdvancedSequenceStepWithChannels') + self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViBoolean] # noqa: F405 + self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_CreateAdvancedSequenceStepWithChannels_cfunc(vi, channel_name, set_as_active_step) - def niDCPower_CreateAdvancedSequenceStep(self, vi, set_as_active_step): # noqa: N802 + def niDCPower_CreateAdvancedSequenceWithChannels(self, vi, channel_name, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence): # noqa: N802 with self._func_lock: - if self.niDCPower_CreateAdvancedSequenceStep_cfunc is None: - self.niDCPower_CreateAdvancedSequenceStep_cfunc = self._get_library_function('niDCPower_CreateAdvancedSequenceStep') - self.niDCPower_CreateAdvancedSequenceStep_cfunc.argtypes = [ViSession, ViBoolean] # noqa: F405 - self.niDCPower_CreateAdvancedSequenceStep_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_CreateAdvancedSequenceStep_cfunc(vi, set_as_active_step) + if self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc is None: + self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc = self._get_library_function('niDCPower_CreateAdvancedSequenceWithChannels') + self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViInt32), ViBoolean] # noqa: F405 + self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_CreateAdvancedSequenceWithChannels_cfunc(vi, channel_name, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence) - def niDCPower_DeleteAdvancedSequence(self, vi, sequence_name): # noqa: N802 + def niDCPower_DeleteAdvancedSequenceWithChannels(self, vi, channel_name, sequence_name): # noqa: N802 with self._func_lock: - if self.niDCPower_DeleteAdvancedSequence_cfunc is None: - self.niDCPower_DeleteAdvancedSequence_cfunc = self._get_library_function('niDCPower_DeleteAdvancedSequence') - self.niDCPower_DeleteAdvancedSequence_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niDCPower_DeleteAdvancedSequence_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_DeleteAdvancedSequence_cfunc(vi, sequence_name) + if self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc is None: + self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc = self._get_library_function('niDCPower_DeleteAdvancedSequenceWithChannels') + self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ctypes.POINTER(ViChar)] # noqa: F405 + self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_DeleteAdvancedSequenceWithChannels_cfunc(vi, channel_name, sequence_name) def niDCPower_Disable(self, vi): # noqa: N802 with self._func_lock: @@ -297,13 +297,13 @@ def niDCPower_InitializeWithChannels(self, resource_name, channels, reset, optio self.niDCPower_InitializeWithChannels_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_InitializeWithChannels_cfunc(resource_name, channels, reset, option_string, vi) - def niDCPower_Initiate(self, vi): # noqa: N802 + def niDCPower_InitiateWithChannels(self, vi, channel_name): # noqa: N802 with self._func_lock: - if self.niDCPower_Initiate_cfunc is None: - self.niDCPower_Initiate_cfunc = self._get_library_function('niDCPower_Initiate') - self.niDCPower_Initiate_cfunc.argtypes = [ViSession] # noqa: F405 - self.niDCPower_Initiate_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_Initiate_cfunc(vi) + if self.niDCPower_InitiateWithChannels_cfunc is None: + self.niDCPower_InitiateWithChannels_cfunc = self._get_library_function('niDCPower_InitiateWithChannels') + self.niDCPower_InitiateWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 + self.niDCPower_InitiateWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_InitiateWithChannels_cfunc(vi, channel_name) def niDCPower_LockSession(self, vi, caller_has_lock): # noqa: N802 with self._func_lock: @@ -401,6 +401,14 @@ def niDCPower_ResetDevice(self, vi): # noqa: N802 self.niDCPower_ResetDevice_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_ResetDevice_cfunc(vi) + def niDCPower_ResetWithChannels(self, vi, channel_name): # noqa: N802 + with self._func_lock: + if self.niDCPower_ResetWithChannels_cfunc is None: + self.niDCPower_ResetWithChannels_cfunc = self._get_library_function('niDCPower_ResetWithChannels') + self.niDCPower_ResetWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 + self.niDCPower_ResetWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_ResetWithChannels_cfunc(vi, channel_name) + def niDCPower_ResetWithDefaults(self, vi): # noqa: N802 with self._func_lock: if self.niDCPower_ResetWithDefaults_cfunc is None: @@ -409,13 +417,13 @@ def niDCPower_ResetWithDefaults(self, vi): # noqa: N802 self.niDCPower_ResetWithDefaults_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_ResetWithDefaults_cfunc(vi) - def niDCPower_SendSoftwareEdgeTrigger(self, vi, trigger): # noqa: N802 + def niDCPower_SendSoftwareEdgeTriggerWithChannels(self, vi, channel_name, trigger): # noqa: N802 with self._func_lock: - if self.niDCPower_SendSoftwareEdgeTrigger_cfunc is None: - self.niDCPower_SendSoftwareEdgeTrigger_cfunc = self._get_library_function('niDCPower_SendSoftwareEdgeTrigger') - self.niDCPower_SendSoftwareEdgeTrigger_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niDCPower_SendSoftwareEdgeTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_SendSoftwareEdgeTrigger_cfunc(vi, trigger) + if self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc is None: + self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc = self._get_library_function('niDCPower_SendSoftwareEdgeTriggerWithChannels') + self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32] # noqa: F405 + self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_SendSoftwareEdgeTriggerWithChannels_cfunc(vi, channel_name, trigger) def niDCPower_SetAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 with self._func_lock: @@ -473,13 +481,13 @@ def niDCPower_UnlockSession(self, vi, caller_has_lock): # noqa: N802 self.niDCPower_UnlockSession_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_UnlockSession_cfunc(vi, caller_has_lock) - def niDCPower_WaitForEvent(self, vi, event_id, timeout): # noqa: N802 + def niDCPower_WaitForEventWithChannels(self, vi, channel_name, event_id, timeout): # noqa: N802 with self._func_lock: - if self.niDCPower_WaitForEvent_cfunc is None: - self.niDCPower_WaitForEvent_cfunc = self._get_library_function('niDCPower_WaitForEvent') - self.niDCPower_WaitForEvent_cfunc.argtypes = [ViSession, ViInt32, ViReal64] # noqa: F405 - self.niDCPower_WaitForEvent_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_WaitForEvent_cfunc(vi, event_id, timeout) + if self.niDCPower_WaitForEventWithChannels_cfunc is None: + self.niDCPower_WaitForEventWithChannels_cfunc = self._get_library_function('niDCPower_WaitForEventWithChannels') + self.niDCPower_WaitForEventWithChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 + self.niDCPower_WaitForEventWithChannels_cfunc.restype = ViStatus # noqa: F405 + return self.niDCPower_WaitForEventWithChannels_cfunc(vi, channel_name, event_id, timeout) def niDCPower_close(self, vi): # noqa: N802 with self._func_lock: @@ -497,14 +505,6 @@ def niDCPower_error_message(self, vi, error_code, error_message): # noqa: N802 self.niDCPower_error_message_cfunc.restype = ViStatus # noqa: F405 return self.niDCPower_error_message_cfunc(vi, error_code, error_message) - def niDCPower_reset(self, vi): # noqa: N802 - with self._func_lock: - if self.niDCPower_reset_cfunc is None: - self.niDCPower_reset_cfunc = self._get_library_function('niDCPower_reset') - self.niDCPower_reset_cfunc.argtypes = [ViSession] # noqa: F405 - self.niDCPower_reset_cfunc.restype = ViStatus # noqa: F405 - return self.niDCPower_reset_cfunc(vi) - def niDCPower_self_test(self, vi, self_test_result, self_test_message): # noqa: N802 with self._func_lock: if self.niDCPower_self_test_cfunc is None: diff --git a/generated/nidcpower/nidcpower/session.py b/generated/nidcpower/nidcpower/session.py index 47d611bf8..4158d5ea5 100644 --- a/generated/nidcpower/nidcpower/session.py +++ b/generated/nidcpower/nidcpower/session.py @@ -55,7 +55,7 @@ def get_ctypes_and_array(value, array_type): class _Acquisition(object): def __init__(self, session): self._session = session - self._session._initiate() + self._session._initiate_with_channels() def __enter__(self): return self @@ -815,6 +815,12 @@ class _SessionBase(object): '''Type: str Contains the name of the manufacturer for the device you are currently using. + + Tip: + This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. ''' instrument_model = _attributes.AttributeViString(1050512) '''Type: str @@ -2124,6 +2130,12 @@ class _SessionBase(object): Default Value: SelfCalibrationPersistence.KEEP_IN_MEMORY Note: This property is not supported by all devices. Refer to Supported Properties by Device for information + + Tip: + This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. ''' sense = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.Sense, 1150013) '''Type: enums.Sense @@ -2304,6 +2316,12 @@ class _SessionBase(object): '''Type: str Contains the serial number for the device you are currently using. + + Tip: + This property can use repeated capabilities. If set or get directly on the + nidcpower.Session object, then the set/get will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling set/get value on the result. ''' shutdown_trigger_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.TriggerType, 1150275) '''Type: enums.TriggerType @@ -2746,6 +2764,46 @@ def _get_error_description(self, error_code): ''' These are code-generated ''' + @ivi_synchronized + def abort(self): + r'''abort + + Transitions the NI-DCPower session from the Running state to the + Uncommitted state. If a sequence is running, it is stopped. Any + configuration methods called after this method are not applied until + the initiate method is called. If power output is enabled + when you call the abort method, the output channels remain + in their current state and continue providing power. + + Use the ConfigureOutputEnabled method to disable power + output on a per channel basis. Use the reset method to + disable output on all channels. + + Refer to the `Programming + States `__ topic in + the *NI DC Power Supplies and SMUs Help* for information about the + specific NI-DCPower software states. + + **Related Topics:** + + `Programming + States `__ + + Note: + One or more of the referenced methods are not in the Python API for this driver. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + error_code = self._library.niDCPower_AbortWithChannels(vi_ctype, channel_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + @ivi_synchronized def self_cal(self): r'''self_cal @@ -2836,6 +2894,37 @@ def clear_latched_output_cutoff_state(self, output_cutoff_reason): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + @ivi_synchronized + def commit(self): + r'''commit + + Applies previously configured settings to the device. Calling this + method moves the NI-DCPower session from the Uncommitted state into + the Committed state. After calling this method, modifying any + property reverts the NI-DCPower session to the Uncommitted state. Use + the initiate method to transition to the Running state. + Refer to the `Programming + States `__ topic in + the *NI DC Power Supplies and SMUs Help* for details about the specific + NI-DCPower software states. + + **Related Topics:** + + `Programming + States `__ + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + error_code = self._library.niDCPower_CommitWithChannels(vi_ctype, channel_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + @ivi_synchronized def configure_aperture_time(self, aperture_time, units=enums.ApertureTimeUnits.SECONDS): r'''configure_aperture_time @@ -2893,22 +2982,37 @@ def configure_aperture_time(self, aperture_time, units=enums.ApertureTimeUnits.S return @ivi_synchronized - def fetch_multiple(self, count, timeout=hightime.timedelta(seconds=1.0)): - '''fetch_multiple + def create_advanced_sequence_step(self, set_as_active_step=True): + r'''create_advanced_sequence_step - Returns a list of named tuples (Measurement) that were - previously taken and are stored in the NI-DCPower buffer. This method - should not be used when the measure_when property is - set to MeasureWhen.ON_DEMAND. You must first call - initiate before calling this method. + Creates a new advanced sequence step in the advanced sequence specified + by the Active advanced sequence. When you create an advanced sequence + step, each property you passed to the create_advanced_sequence + method is reset to its default value for that step unless otherwise + specified. - Fields in Measurement: + **Support for this Method** - - **voltage** (float) - - **current** (float) - - **in_compliance** (bool) + You must set the source mode to Sequence to use this method. - Note: This method is not supported on all devices. Refer to `Supported Methods by Device `__ for more information about supported devices. + Using the set_sequence method with Advanced Sequence + methods is unsupported. + + **Related Topics**: + + `Advanced Sequence + Mode `__ + + `Programming + States `__ + + create_advanced_sequence + + Note: + This method is not supported on all devices. Refer to `Supported + Methods by + Device `__ + for more information about supported devices. Tip: This method requires repeated capabilities. If called directly on the @@ -2917,83 +3021,48 @@ def fetch_multiple(self, count, timeout=hightime.timedelta(seconds=1.0)): nidcpower.Session repeated capabilities container, and calling this method on the result. Args: - count (int): Specifies the number of measurements to fetch. - - timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete. If the method does not complete within this time interval, NI-DCPower returns an error. - - Note: When setting the timeout interval, ensure you take into account any triggers so that the timeout interval is long enough for your application. - - - Returns: - measurements (list of Measurement): List of named tuples with fields: - - - **voltage** (float) - - **current** (float) - - **in_compliance** (bool) + set_as_active_step (bool): Specifies that this current step in the active sequence is active. ''' - import collections - Measurement = collections.namedtuple('Measurement', ['voltage', 'current', 'in_compliance']) - - voltage_measurements, current_measurements, in_compliance = self._fetch_multiple(timeout, count) - - return [Measurement(voltage=voltage_measurements[i], current=current_measurements[i], in_compliance=in_compliance[i]) for i in range(count)] + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + set_as_active_step_ctype = _visatype.ViBoolean(set_as_active_step) # case S150 + error_code = self._library.niDCPower_CreateAdvancedSequenceStepWithChannels(vi_ctype, channel_name_ctype, set_as_active_step_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return @ivi_synchronized - def measure_multiple(self): - '''measure_multiple - - Returns a list of named tuples (Measurement) containing the measured voltage - and current values on the specified output channel(s). Each call to this method - blocks other method calls until the measurements are returned from the device. - The order of the measurements returned in the array corresponds to the order - on the specified output channel(s). - - Fields in Measurement: - - - **voltage** (float) - - **current** (float) - - **in_compliance** (bool) - Always None + def _create_advanced_sequence_with_channels(self, sequence_name, attribute_ids, set_as_active_sequence): + r'''_create_advanced_sequence_with_channels - Note: This method is not supported on all devices. Refer to `Supported Methods by Device `__ for more information about supported devices. + Creates an empty advanced sequence. Call the + create_advanced_sequence_step method to add steps to the + active advanced sequence. - Tip: - This method requires repeated capabilities. If called directly on the - nidcpower.Session object, then the method will use all repeated capabilities in the session. - You can specify a subset of repeated capabilities using the Python index notation on an - nidcpower.Session repeated capabilities container, and calling this method on the result. + You can create multiple advanced sequences in a session. - Returns: - measurements (list of Measurement): List of named tuples with fields: + **Support for this method** - - **voltage** (float) - - **current** (float) - - **in_compliance** (bool) - Always None + You must set the source mode to Sequence to use this method. - ''' - import collections - Measurement = collections.namedtuple('Measurement', ['voltage', 'current', 'in_compliance']) + Using the set_sequence method with Advanced Sequence + methods is unsupported. - voltage_measurements, current_measurements = self._measure_multiple() + Use this method in the Uncommitted or Committed programming states. + Refer to the `Programming + States `__ topic in + the *NI DC Power Supplies and SMUs Help* for more information about + NI-DCPower programming states. - return [Measurement(voltage=voltage_measurements[i], current=current_measurements[i], in_compliance=None) for i in range(self._parse_channel_count())] + **Related Topics**: - @ivi_synchronized - def _fetch_multiple(self, timeout, count): - r'''_fetch_multiple + `Advanced Sequence + Mode `__ - Returns an array of voltage measurements, an array of current - measurements, and an array of compliance measurements that were - previously taken and are stored in the NI-DCPower buffer. This method - should not be used when the measure_when property is - set to MeasureWhen.ON_DEMAND. You must first call - initiate before calling this method. + `Programming + States `__ - Refer to the `Acquiring - Measurements `__ - and `Compliance `__ topics in - the *NI DC Power Supplies and SMUs Help* for more information about - configuring this method. + create_advanced_sequence_step Note: This method is not supported on all devices. Refer to `Supported @@ -3008,57 +3077,163 @@ def _fetch_multiple(self, timeout, count): nidcpower.Session repeated capabilities container, and calling this method on the result. Args: - timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete, in - seconds. If the method does not complete within this time interval, - NI-DCPower returns an error. - - Note: - When setting the timeout interval, ensure you take into account any - triggers so that the timeout interval is long enough for your - application. - - count (int): Specifies the number of measurements to fetch. - - - Returns: - voltage_measurements (array.array("d")): Returns an array of voltage measurements. Ensure that sufficient space - has been allocated for the returned array. - - current_measurements (array.array("d")): Returns an array of current measurements. Ensure that sufficient space - has been allocated for the returned array. - - in_compliance (list of bool): Returns an array of Boolean values indicating whether the output was in - compliance at the time the measurement was taken. Ensure that sufficient - space has been allocated for the returned array. + sequence_name (str): Specifies the name of the sequence to create. - actual_count (int): Indicates the number of measured values actually retrieved from the - device. + attribute_ids (list of int): Specifies the properties you reconfigure per step in the advanced + sequence. The following table lists which properties can be configured + in an advanced sequence for each NI-DCPower device that supports + advanced sequencing. A Yes indicates that the property can be configured + in advanced sequencing. An No indicates that the property cannot be + configured in advanced sequencing. - ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - timeout_ctype = _converters.convert_timedelta_to_seconds_real64(timeout) # case S140 - count_ctype = _visatype.ViInt32(count) # case S210 - voltage_measurements_size = count # case B600 - voltage_measurements_array = array.array("d", [0] * voltage_measurements_size) # case B600 - voltage_measurements_ctype = get_ctypes_pointer_for_buffer(value=voltage_measurements_array, library_type=_visatype.ViReal64) # case B600 - current_measurements_size = count # case B600 - current_measurements_array = array.array("d", [0] * current_measurements_size) # case B600 - current_measurements_ctype = get_ctypes_pointer_for_buffer(value=current_measurements_array, library_type=_visatype.ViReal64) # case B600 - in_compliance_size = count # case B600 - in_compliance_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViBoolean, size=in_compliance_size) # case B600 - actual_count_ctype = _visatype.ViInt32() # case S220 - error_code = self._library.niDCPower_FetchMultiple(vi_ctype, channel_name_ctype, timeout_ctype, count_ctype, voltage_measurements_ctype, current_measurements_ctype, in_compliance_ctype, None if actual_count_ctype is None else (ctypes.pointer(actual_count_ctype))) + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | Property | PXIe-4135 | PXIe-4136 | PXIe-4137 | PXIe-4138 | PXIe-4139 | PXIe-4140/4142/4144 | PXIe-4141/4143/4145 | PXIe-4162/4163 | + +================================+===========+===========+===========+===========+===========+=====================+=====================+================+ + | dc_noise_rejection | Yes | No | Yes | No | Yes | No | No | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | aperture_time | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | measure_record_length | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | sense | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | ovp_enabled | Yes | Yes | Yes | No | No | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | ovp_limit | Yes | Yes | Yes | No | No | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_delay | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_off_time | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_on_time | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | source_delay | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_compensation_frequency | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_gain_bandwidth | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_pole_zero_ratio | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_compensation_frequency | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_gain_bandwidth | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_pole_zero_ratio | Yes | No | Yes | No | Yes | No | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_level | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_level_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_limit | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_limit_high | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_limit_low | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_limit_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_limit | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_limit_high | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_limit_low | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | current_limit_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_level | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | voltage_level_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | output_enabled | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | output_function | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | output_resistance | Yes | No | Yes | No | Yes | No | Yes | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_current_level | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_voltage_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_voltage_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_voltage_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_level | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_level_range | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_limit_range | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_current_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_current_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_current_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_bias_voltage_level | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_current_limit_range | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_level | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | pulse_voltage_level_range | Yes | Yes | Yes | Yes | Yes | No | No | No | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + | transient_response | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ + + set_as_active_sequence (bool): Specifies that this current sequence is active. + + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + sequence_name_ctype = ctypes.create_string_buffer(sequence_name.encode(self._encoding)) # case C020 + attribute_id_count_ctype = _visatype.ViInt32(0 if attribute_ids is None else len(attribute_ids)) # case S160 + attribute_ids_ctype = get_ctypes_pointer_for_buffer(value=attribute_ids, library_type=_visatype.ViInt32) # case B550 + set_as_active_sequence_ctype = _visatype.ViBoolean(set_as_active_sequence) # case S150 + error_code = self._library.niDCPower_CreateAdvancedSequenceWithChannels(vi_ctype, channel_name_ctype, sequence_name_ctype, attribute_id_count_ctype, attribute_ids_ctype, set_as_active_sequence_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return voltage_measurements_array, current_measurements_array, [bool(in_compliance_ctype[i]) for i in range(count_ctype.value)] + return @ivi_synchronized - def _get_attribute_vi_boolean(self, attribute_id): - r'''_get_attribute_vi_boolean + def delete_advanced_sequence(self, sequence_name): + r'''delete_advanced_sequence - | Queries the value of a ViBoolean property. - | You can use this method to get the values of device-specific - properties and inherent IVI properties. + Deletes a previously created advanced sequence and all the advanced + sequence steps in the advanced sequence. + + **Support for this Method** + + You must set the source mode to Sequence to use this method. + + Using the set_sequence method with Advanced Sequence + methods is unsupported. + + **Related Topics**: + + `Advanced Sequence + Mode `__ + + `Programming + States `__ + + Note: + This method is not supported on all devices. Refer to `Supported + Methods by + Device `__ + for more information about supported devices. Tip: This method requires repeated capabilities. If called directly on the @@ -3067,51 +3242,33 @@ def _get_attribute_vi_boolean(self, attribute_id): nidcpower.Session repeated capabilities container, and calling this method on the result. Args: - attribute_id (int): Specifies the ID of a property. From the method panel window, you - can use this control as follows. - - - In the method panel window, click on the control or press **Enter** - or the spacebar to display a dialog box containing hierarchical list - of the available properties. Help text is shown for each property. - Select a property by double-clicking on it or by selecting it and - then pressing **Enter**. - - A ring control at the top of the dialog box allows you to see all IVI - properties or only the properties of type ViBoolean. If you choose to - see all IVI properties, the data types appear to the right of the - property names in the list box. Properties with data types other - than ViBoolean are dim. If you select a property data type that is - dim, LabWindows/CVI transfers you to the method panel for the - corresponding method that is consistent with the data type. - - If you want to enter a variable name, press **Ctrl**\ +\ **T** to - change this ring control to a manual input box. If the property in - this ring control has named constants as valid values, you can view - the constants by moving to the value control and pressing **Enter**. - - - Returns: - attribute_value (bool): Returns the current value of the property. Passes the address of a - ViBoolean variable. - If the property currently showing in the property ring control has - constants as valid values, you can view a list of the constants by - pressing **Enter** on this control. Select a value by double-clicking on - it or by selecting it and then pressing **Enter**. + sequence_name (str): specifies the name of the sequence to delete. ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S220 - error_code = self._library.niDCPower_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) + sequence_name_ctype = ctypes.create_string_buffer(sequence_name.encode(self._encoding)) # case C020 + error_code = self._library.niDCPower_DeleteAdvancedSequenceWithChannels(vi_ctype, channel_name_ctype, sequence_name_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return bool(attribute_value_ctype.value) + return @ivi_synchronized - def _get_attribute_vi_int32(self, attribute_id): - r'''_get_attribute_vi_int32 + def fetch_multiple(self, count, timeout=hightime.timedelta(seconds=1.0)): + '''fetch_multiple - | Queries the value of a ViInt32 property. - | You can use this method to get the values of device-specific - properties and inherent IVI properties. + Returns a list of named tuples (Measurement) that were + previously taken and are stored in the NI-DCPower buffer. This method + should not be used when the measure_when property is + set to MeasureWhen.ON_DEMAND. You must first call + initiate before calling this method. + + Fields in Measurement: + + - **voltage** (float) + - **current** (float) + - **in_compliance** (bool) + + Note: This method is not supported on all devices. Refer to `Supported Methods by Device `__ for more information about supported devices. Tip: This method requires repeated capabilities. If called directly on the @@ -3120,51 +3277,254 @@ def _get_attribute_vi_int32(self, attribute_id): nidcpower.Session repeated capabilities container, and calling this method on the result. Args: - attribute_id (int): Specifies the ID of a property. From the method panel window, you - can use this control as follows. + count (int): Specifies the number of measurements to fetch. - - In the method panel window, click on the control or press **Enter** - or the spacebar to display a dialog box containing hierarchical list - of the available properties. Help text is shown for each property. - Select a property by double-clicking on it or by selecting it and - then pressing **Enter**. - - A ring control at the top of the dialog box allows you to see all IVI - properties or only the properties of type ViInt32. If you choose to - see all IVI properties, the data types appear to the right of the - property names in the list box. Properties with data types other - than ViInt32 are dim. If you select a property data type that is - dim, LabWindows/CVI transfers you to the method panel for the - corresponding method that is consistent with the data type. - - If you want to enter a variable name, press **Ctrl**\ +\ **T** to - change this ring control to a manual input box. If the property in - this ring control has named constants as valid values, you can view - the constants by moving to the value control and pressing **Enter**. + timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete. If the method does not complete within this time interval, NI-DCPower returns an error. + + Note: When setting the timeout interval, ensure you take into account any triggers so that the timeout interval is long enough for your application. Returns: - attribute_value (int): Returns the current value of the property. Passes the address of a - ViInt32 variable. - If the property currently showing in the property ring control has - constants as valid values, you can view a list of the constants by - pressing **Enter** on this control. Select a value by double-clicking on - it or by selecting it and then pressing **Enter**. + measurements (list of Measurement): List of named tuples with fields: + + - **voltage** (float) + - **current** (float) + - **in_compliance** (bool) ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S220 - error_code = self._library.niDCPower_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(attribute_value_ctype.value) + import collections + Measurement = collections.namedtuple('Measurement', ['voltage', 'current', 'in_compliance']) - @ivi_synchronized - def _get_attribute_vi_int64(self, attribute_id): - r'''_get_attribute_vi_int64 + voltage_measurements, current_measurements, in_compliance = self._fetch_multiple(timeout, count) - | Queries the value of a ViInt64 property. - | You can use this method to get the values of device-specific - properties and inherent IVI properties. + return [Measurement(voltage=voltage_measurements[i], current=current_measurements[i], in_compliance=in_compliance[i]) for i in range(count)] + + @ivi_synchronized + def measure_multiple(self): + '''measure_multiple + + Returns a list of named tuples (Measurement) containing the measured voltage + and current values on the specified output channel(s). Each call to this method + blocks other method calls until the measurements are returned from the device. + The order of the measurements returned in the array corresponds to the order + on the specified output channel(s). + + Fields in Measurement: + + - **voltage** (float) + - **current** (float) + - **in_compliance** (bool) - Always None + + Note: This method is not supported on all devices. Refer to `Supported Methods by Device `__ for more information about supported devices. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Returns: + measurements (list of Measurement): List of named tuples with fields: + + - **voltage** (float) + - **current** (float) + - **in_compliance** (bool) - Always None + + ''' + import collections + Measurement = collections.namedtuple('Measurement', ['voltage', 'current', 'in_compliance']) + + voltage_measurements, current_measurements = self._measure_multiple() + + return [Measurement(voltage=voltage_measurements[i], current=current_measurements[i], in_compliance=None) for i in range(self._parse_channel_count())] + + @ivi_synchronized + def _fetch_multiple(self, timeout, count): + r'''_fetch_multiple + + Returns an array of voltage measurements, an array of current + measurements, and an array of compliance measurements that were + previously taken and are stored in the NI-DCPower buffer. This method + should not be used when the measure_when property is + set to MeasureWhen.ON_DEMAND. You must first call + initiate before calling this method. + + Refer to the `Acquiring + Measurements `__ + and `Compliance `__ topics in + the *NI DC Power Supplies and SMUs Help* for more information about + configuring this method. + + Note: + This method is not supported on all devices. Refer to `Supported + Methods by + Device `__ + for more information about supported devices. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Args: + timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete, in + seconds. If the method does not complete within this time interval, + NI-DCPower returns an error. + + Note: + When setting the timeout interval, ensure you take into account any + triggers so that the timeout interval is long enough for your + application. + + count (int): Specifies the number of measurements to fetch. + + + Returns: + voltage_measurements (array.array("d")): Returns an array of voltage measurements. Ensure that sufficient space + has been allocated for the returned array. + + current_measurements (array.array("d")): Returns an array of current measurements. Ensure that sufficient space + has been allocated for the returned array. + + in_compliance (list of bool): Returns an array of Boolean values indicating whether the output was in + compliance at the time the measurement was taken. Ensure that sufficient + space has been allocated for the returned array. + + actual_count (int): Indicates the number of measured values actually retrieved from the + device. + + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + timeout_ctype = _converters.convert_timedelta_to_seconds_real64(timeout) # case S140 + count_ctype = _visatype.ViInt32(count) # case S210 + voltage_measurements_size = count # case B600 + voltage_measurements_array = array.array("d", [0] * voltage_measurements_size) # case B600 + voltage_measurements_ctype = get_ctypes_pointer_for_buffer(value=voltage_measurements_array, library_type=_visatype.ViReal64) # case B600 + current_measurements_size = count # case B600 + current_measurements_array = array.array("d", [0] * current_measurements_size) # case B600 + current_measurements_ctype = get_ctypes_pointer_for_buffer(value=current_measurements_array, library_type=_visatype.ViReal64) # case B600 + in_compliance_size = count # case B600 + in_compliance_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViBoolean, size=in_compliance_size) # case B600 + actual_count_ctype = _visatype.ViInt32() # case S220 + error_code = self._library.niDCPower_FetchMultiple(vi_ctype, channel_name_ctype, timeout_ctype, count_ctype, voltage_measurements_ctype, current_measurements_ctype, in_compliance_ctype, None if actual_count_ctype is None else (ctypes.pointer(actual_count_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return voltage_measurements_array, current_measurements_array, [bool(in_compliance_ctype[i]) for i in range(count_ctype.value)] + + @ivi_synchronized + def _get_attribute_vi_boolean(self, attribute_id): + r'''_get_attribute_vi_boolean + + | Queries the value of a ViBoolean property. + | You can use this method to get the values of device-specific + properties and inherent IVI properties. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Args: + attribute_id (int): Specifies the ID of a property. From the method panel window, you + can use this control as follows. + + - In the method panel window, click on the control or press **Enter** + or the spacebar to display a dialog box containing hierarchical list + of the available properties. Help text is shown for each property. + Select a property by double-clicking on it or by selecting it and + then pressing **Enter**. + - A ring control at the top of the dialog box allows you to see all IVI + properties or only the properties of type ViBoolean. If you choose to + see all IVI properties, the data types appear to the right of the + property names in the list box. Properties with data types other + than ViBoolean are dim. If you select a property data type that is + dim, LabWindows/CVI transfers you to the method panel for the + corresponding method that is consistent with the data type. + - If you want to enter a variable name, press **Ctrl**\ +\ **T** to + change this ring control to a manual input box. If the property in + this ring control has named constants as valid values, you can view + the constants by moving to the value control and pressing **Enter**. + + + Returns: + attribute_value (bool): Returns the current value of the property. Passes the address of a + ViBoolean variable. + If the property currently showing in the property ring control has + constants as valid values, you can view a list of the constants by + pressing **Enter** on this control. Select a value by double-clicking on + it or by selecting it and then pressing **Enter**. + + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + attribute_value_ctype = _visatype.ViBoolean() # case S220 + error_code = self._library.niDCPower_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return bool(attribute_value_ctype.value) + + @ivi_synchronized + def _get_attribute_vi_int32(self, attribute_id): + r'''_get_attribute_vi_int32 + + | Queries the value of a ViInt32 property. + | You can use this method to get the values of device-specific + properties and inherent IVI properties. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Args: + attribute_id (int): Specifies the ID of a property. From the method panel window, you + can use this control as follows. + + - In the method panel window, click on the control or press **Enter** + or the spacebar to display a dialog box containing hierarchical list + of the available properties. Help text is shown for each property. + Select a property by double-clicking on it or by selecting it and + then pressing **Enter**. + - A ring control at the top of the dialog box allows you to see all IVI + properties or only the properties of type ViInt32. If you choose to + see all IVI properties, the data types appear to the right of the + property names in the list box. Properties with data types other + than ViInt32 are dim. If you select a property data type that is + dim, LabWindows/CVI transfers you to the method panel for the + corresponding method that is consistent with the data type. + - If you want to enter a variable name, press **Ctrl**\ +\ **T** to + change this ring control to a manual input box. If the property in + this ring control has named constants as valid values, you can view + the constants by moving to the value control and pressing **Enter**. + + + Returns: + attribute_value (int): Returns the current value of the property. Passes the address of a + ViInt32 variable. + If the property currently showing in the property ring control has + constants as valid values, you can view a list of the constants by + pressing **Enter** on this control. Select a value by double-clicking on + it or by selecting it and then pressing **Enter**. + + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + attribute_value_ctype = _visatype.ViInt32() # case S220 + error_code = self._library.niDCPower_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return int(attribute_value_ctype.value) + + @ivi_synchronized + def _get_attribute_vi_int64(self, attribute_id): + r'''_get_attribute_vi_int64 + + | Queries the value of a ViInt64 property. + | You can use this method to get the values of device-specific + properties and inherent IVI properties. Tip: This method requires repeated capabilities. If called directly on the @@ -3382,6 +3742,35 @@ def _get_error(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) return int(code_ctype.value), description_ctype.value.decode(self._encoding) + @ivi_synchronized + def _initiate_with_channels(self): + r'''_initiate_with_channels + + Starts generation or acquisition, causing the NI-DCPower session to + leave the Uncommitted state or Committed state and enter the Running + state. To return to the Uncommitted state call the abort + method. Refer to the `Programming + States `__ topic in + the *NI DC Power Supplies and SMUs Help* for information about the + specific NI-DCPower software states. + + **Related Topics:** + + `Programming + States `__ + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + error_code = self._library.niDCPower_InitiateWithChannels(vi_ctype, channel_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def lock(self): '''lock @@ -3582,13 +3971,10 @@ def query_latched_output_cutoff_state(self, output_cutoff_reason): r'''query_latched_output_cutoff_state Discovers if an output cutoff limit was exceeded for the specified reason. When an output cutoff is engaged, the output of the channel(s) is disconnected. - If a limit was exceeded, the state is latched until you clear it with the clear_latched_output_cutoff_state method or the ResetWithChannels method. + If a limit was exceeded, the state is latched until you clear it with the clear_latched_output_cutoff_state method or the reset method. outputCutoffReason specifies the conditions for which an output is disconnected. - Note: - One or more of the referenced methods are not in the Python API for this driver. - Tip: This method requires repeated capabilities. If called directly on the nidcpower.Session object, then the method will use all repeated capabilities in the session. @@ -3775,6 +4161,83 @@ def query_output_state(self, output_state): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(in_state_ctype.value) + @ivi_synchronized + def reset(self): + r'''reset + + Resets the device to a known state. This method disables power + generation, resets session properties to their default values, commits + the session properties, and leaves the session in the Uncommitted state. + Refer to the `Programming + States `__ topic for + more information about NI-DCPower software states. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + ''' + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + error_code = self._library.niDCPower_ResetWithChannels(vi_ctype, channel_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + @ivi_synchronized + def send_software_edge_trigger(self, trigger): + r'''send_software_edge_trigger + + Asserts the specified trigger. This method can override an external + edge trigger. + + **Related Topics:** + + `Triggers `__ + + Note: + This method is not supported on all devices. Refer to `Supported + Methods by + Device `__ + for more information about supported devices. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Args: + trigger (enums.SendSoftwareEdgeTriggerType): Specifies which trigger to assert. + **Defined Values:** + + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_START_TRIGGER | Asserts the Start trigger. | + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_SOURCE_TRIGGER | Asserts the Source trigger. | + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_MEASURE_TRIGGER | Asserts the Measure trigger. | + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_SEQUENCE_ADVANCE_TRIGGER | Asserts the Sequence Advance trigger. | + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_PULSE_TRIGGER | Asserts the Pulse trigger. | + +----------------------------------------+---------------------------------------+ + | NIDCPOWER_VAL_SHUTDOWN_TRIGGER | Asserts the Shutdown trigger. | + +----------------------------------------+---------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + ''' + if type(trigger) is not enums.SendSoftwareEdgeTriggerType: + raise TypeError('Parameter trigger must be of type ' + str(enums.SendSoftwareEdgeTriggerType)) + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + trigger_ctype = _visatype.ViInt32(trigger.value) # case S130 + error_code = self._library.niDCPower_SendSoftwareEdgeTriggerWithChannels(vi_ctype, channel_name_ctype, trigger_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + @ivi_synchronized def _set_attribute_vi_boolean(self, attribute_id, attribute_value): r'''_set_attribute_vi_boolean @@ -4124,6 +4587,70 @@ def unlock(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) return + @ivi_synchronized + def wait_for_event(self, event_id, timeout=hightime.timedelta(seconds=10.0)): + r'''wait_for_event + + Waits until the device has generated the specified event. + + The session monitors whether each type of event has occurred at least + once since the last time this method or the initiate + method were called. If an event has only been generated once and you + call this method successively, the method times out. Individual + events must be generated between separate calls of this method. + + Note: + Refer to `Supported Methods by + Device `__ + for more information about supported devices. + + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. + + Args: + event_id (enums.Event): Specifies which event to wait for. + **Defined Values:** + + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_SOURCE_COMPLETE_EVENT | Waits for the Source Complete event. | + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_MEASURE_COMPLETE_EVENT | Waits for the Measure Complete event. | + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_SEQUENCE_ITERATION_COMPLETE_EVENT | Waits for the Sequence Iteration Complete event. | + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_SEQUENCE_ENGINE_DONE_EVENT | Waits for the Sequence Engine Done event. | + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_PULSE_COMPLETE_EVENT | Waits for the Pulse Complete event. | + +-------------------------------------------------+--------------------------------------------------+ + | NIDCPOWER_VAL_READY_FOR_PULSE_TRIGGER_EVENT | Waits for the Ready for Pulse Trigger event. | + +-------------------------------------------------+--------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete, in + seconds. If the method does not complete within this time interval, + NI-DCPower returns an error. + + Note: + When setting the timeout interval, ensure you take into account any + triggers so that the timeout interval is long enough for your + application. + + ''' + if type(event_id) is not enums.Event: + raise TypeError('Parameter event_id must be of type ' + str(enums.Event)) + vi_ctype = _visatype.ViSession(self._vi) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + event_id_ctype = _visatype.ViInt32(event_id.value) # case S130 + timeout_ctype = _converters.convert_timedelta_to_seconds_real64(timeout) # case S140 + error_code = self._library.niDCPower_WaitForEventWithChannels(vi_ctype, channel_name_ctype, event_id_ctype, timeout_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def _error_message(self, error_code): r'''_error_message @@ -4233,393 +4760,92 @@ def __init__(self, resource_name, channels=None, reset=False, options={}): +-------------------------+---------+ - Returns: - session (nidcpower.Session): A session object representing the device. - - ''' - super(Session, self).__init__(repeated_capability_list=[], vi=None, library=None, encoding=None, freeze_it=False) - channels = _converters.convert_repeated_capabilities_without_prefix(channels) - options = _converters.convert_init_with_options_dictionary(options) - self._library = _library_singleton.get() - self._encoding = 'windows-1251' - - # Call specified init function - self._vi = 0 # This must be set before calling _initialize_with_channels(). - self._vi = self._initialize_with_channels(resource_name, channels, reset, options) - - # Store the parameter list for later printing in __repr__ - param_list = [] - param_list.append("resource_name=" + pp.pformat(resource_name)) - param_list.append("channels=" + pp.pformat(channels)) - param_list.append("reset=" + pp.pformat(reset)) - param_list.append("options=" + pp.pformat(options)) - self._param_list = ', '.join(param_list) - - self._is_frozen = True - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def initiate(self): - '''initiate - - Starts generation or acquisition, causing the NI-DCPower session to - leave the Uncommitted state or Committed state and enter the Running - state. To return to the Uncommitted state call the abort - method. Refer to the `Programming - States `__ topic in - the *NI DC Power Supplies and SMUs Help* for information about the - specific NI-DCPower software states. - - **Related Topics:** - - `Programming - States `__ - - Note: - This method will return a Python context manager that will initiate on entering and abort on exit. - ''' - return _Acquisition(self) - - def close(self): - '''close - - Closes the session specified in **vi** and deallocates the resources - that NI-DCPower reserves. If power output is enabled when you call this - method, the output channels remain in their existing state and - continue providing power. Use the ConfigureOutputEnabled - method to disable power output on a per channel basis. Use the - reset method to disable power output on all channel(s). - - **Related Topics:** - - `Programming - States `__ - - Note: - One or more of the referenced methods are not in the Python API for this driver. - - Note: - This method is not needed when using the session context manager - ''' - try: - self._close() - except errors.DriverError: - self._vi = 0 - raise - self._vi = 0 - - ''' These are code-generated ''' - - @ivi_synchronized - def abort(self): - r'''abort - - Transitions the NI-DCPower session from the Running state to the - Uncommitted state. If a sequence is running, it is stopped. Any - configuration methods called after this method are not applied until - the initiate method is called. If power output is enabled - when you call the abort method, the output channels remain - in their current state and continue providing power. - - Use the ConfigureOutputEnabled method to disable power - output on a per channel basis. Use the reset method to - disable output on all channels. - - Refer to the `Programming - States `__ topic in - the *NI DC Power Supplies and SMUs Help* for information about the - specific NI-DCPower software states. - - **Related Topics:** - - `Programming - States `__ - - Note: - One or more of the referenced methods are not in the Python API for this driver. - ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code = self._library.niDCPower_Abort(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - @ivi_synchronized - def commit(self): - r'''commit - - Applies previously configured settings to the device. Calling this - method moves the NI-DCPower session from the Uncommitted state into - the Committed state. After calling this method, modifying any - property reverts the NI-DCPower session to the Uncommitted state. Use - the initiate method to transition to the Running state. - Refer to the `Programming - States `__ topic in - the *NI DC Power Supplies and SMUs Help* for details about the specific - NI-DCPower software states. - - **Related Topics:** - - `Programming - States `__ - ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code = self._library.niDCPower_Commit(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - @ivi_synchronized - def _create_advanced_sequence(self, sequence_name, attribute_ids, set_as_active_sequence): - r'''_create_advanced_sequence - - Creates an empty advanced sequence. Call the - create_advanced_sequence_step method to add steps to the - active advanced sequence. - - You can create multiple advanced sequences in a session. - - **Support for this method** - - You must set the source mode to Sequence to use this method. - - Using the set_sequence method with Advanced Sequence - methods is unsupported. - - Use this method in the Uncommitted or Committed programming states. - Refer to the `Programming - States `__ topic in - the *NI DC Power Supplies and SMUs Help* for more information about - NI-DCPower programming states. - - **Related Topics**: - - `Advanced Sequence - Mode `__ - - `Programming - States `__ - - create_advanced_sequence_step - - Note: - This method is not supported on all devices. Refer to `Supported - Methods by - Device `__ - for more information about supported devices. - - Args: - sequence_name (str): Specifies the name of the sequence to create. - - attribute_ids (list of int): Specifies the properties you reconfigure per step in the advanced - sequence. The following table lists which properties can be configured - in an advanced sequence for each NI-DCPower device that supports - advanced sequencing. A Yes indicates that the property can be configured - in advanced sequencing. An No indicates that the property cannot be - configured in advanced sequencing. - - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | Property | PXIe-4135 | PXIe-4136 | PXIe-4137 | PXIe-4138 | PXIe-4139 | PXIe-4140/4142/4144 | PXIe-4141/4143/4145 | PXIe-4162/4163 | - +================================+===========+===========+===========+===========+===========+=====================+=====================+================+ - | dc_noise_rejection | Yes | No | Yes | No | Yes | No | No | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | aperture_time | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | measure_record_length | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | sense | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | ovp_enabled | Yes | Yes | Yes | No | No | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | ovp_limit | Yes | Yes | Yes | No | No | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_delay | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_off_time | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_on_time | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | source_delay | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_compensation_frequency | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_gain_bandwidth | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_pole_zero_ratio | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_compensation_frequency | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_gain_bandwidth | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_pole_zero_ratio | Yes | No | Yes | No | Yes | No | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_level | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_level_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_high | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_low | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_high | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_low | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_level | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_level_range | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_enabled | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_function | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_resistance | Yes | No | Yes | No | Yes | No | Yes | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_level | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_level | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_level_range | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_range | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_level | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_high | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_low | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_range | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_level | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_level_range | Yes | Yes | Yes | Yes | Yes | No | No | No | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | transient_response | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | - +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - - set_as_active_sequence (bool): Specifies that this current sequence is active. + Returns: + session (nidcpower.Session): A session object representing the device. ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - sequence_name_ctype = ctypes.create_string_buffer(sequence_name.encode(self._encoding)) # case C020 - attribute_id_count_ctype = _visatype.ViInt32(0 if attribute_ids is None else len(attribute_ids)) # case S160 - attribute_ids_ctype = get_ctypes_pointer_for_buffer(value=attribute_ids, library_type=_visatype.ViInt32) # case B550 - set_as_active_sequence_ctype = _visatype.ViBoolean(set_as_active_sequence) # case S150 - error_code = self._library.niDCPower_CreateAdvancedSequence(vi_ctype, sequence_name_ctype, attribute_id_count_ctype, attribute_ids_ctype, set_as_active_sequence_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + super(Session, self).__init__(repeated_capability_list=[], vi=None, library=None, encoding=None, freeze_it=False) + channels = _converters.convert_repeated_capabilities_without_prefix(channels) + options = _converters.convert_init_with_options_dictionary(options) + self._library = _library_singleton.get() + self._encoding = 'windows-1251' - @ivi_synchronized - def create_advanced_sequence_step(self, set_as_active_step=True): - r'''create_advanced_sequence_step + # Call specified init function + self._vi = 0 # This must be set before calling _initialize_with_channels(). + self._vi = self._initialize_with_channels(resource_name, channels, reset, options) - Creates a new advanced sequence step in the advanced sequence specified - by the Active advanced sequence. When you create an advanced sequence - step, each property you passed to the _create_advanced_sequence - method is reset to its default value for that step unless otherwise - specified. + # Store the parameter list for later printing in __repr__ + param_list = [] + param_list.append("resource_name=" + pp.pformat(resource_name)) + param_list.append("channels=" + pp.pformat(channels)) + param_list.append("reset=" + pp.pformat(reset)) + param_list.append("options=" + pp.pformat(options)) + self._param_list = ', '.join(param_list) - **Support for this Method** + self._is_frozen = True - You must set the source mode to Sequence to use this method. + def __enter__(self): + return self - Using the set_sequence method with Advanced Sequence - methods is unsupported. + def __exit__(self, exc_type, exc_value, traceback): + self.close() - **Related Topics**: + def initiate(self): + '''initiate - `Advanced Sequence - Mode `__ + Starts generation or acquisition, causing the NI-DCPower session to + leave the Uncommitted state or Committed state and enter the Running + state. To return to the Uncommitted state call the abort + method. Refer to the `Programming + States `__ topic in + the *NI DC Power Supplies and SMUs Help* for information about the + specific NI-DCPower software states. + + **Related Topics:** `Programming States `__ - _create_advanced_sequence - Note: - This method is not supported on all devices. Refer to `Supported - Methods by - Device `__ - for more information about supported devices. - - Args: - set_as_active_step (bool): Specifies that this current step in the active sequence is active. + This method will return a Python context manager that will initiate on entering and abort on exit. + Tip: + This method requires repeated capabilities. If called directly on the + nidcpower.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nidcpower.Session repeated capabilities container, and calling this method on the result. ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - set_as_active_step_ctype = _visatype.ViBoolean(set_as_active_step) # case S150 - error_code = self._library.niDCPower_CreateAdvancedSequenceStep(vi_ctype, set_as_active_step_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - @ivi_synchronized - def delete_advanced_sequence(self, sequence_name): - r'''delete_advanced_sequence - - Deletes a previously created advanced sequence and all the advanced - sequence steps in the advanced sequence. - - **Support for this Method** - - You must set the source mode to Sequence to use this method. + return _Acquisition(self) - Using the set_sequence method with Advanced Sequence - methods is unsupported. + def close(self): + '''close - **Related Topics**: + Closes the session specified in **vi** and deallocates the resources + that NI-DCPower reserves. If power output is enabled when you call this + method, the output channels remain in their existing state and + continue providing power. Use the ConfigureOutputEnabled + method to disable power output on a per channel basis. Use the + reset method to disable power output on all channel(s). - `Advanced Sequence - Mode `__ + **Related Topics:** `Programming States `__ Note: - This method is not supported on all devices. Refer to `Supported - Methods by - Device `__ - for more information about supported devices. - - Args: - sequence_name (str): specifies the name of the sequence to delete. + One or more of the referenced methods are not in the Python API for this driver. + Note: + This method is not needed when using the session context manager ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - sequence_name_ctype = ctypes.create_string_buffer(sequence_name.encode(self._encoding)) # case C020 - error_code = self._library.niDCPower_DeleteAdvancedSequence(vi_ctype, sequence_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + try: + self._close() + except errors.DriverError: + self._vi = 0 + raise + self._vi = 0 + + ''' These are code-generated ''' @ivi_synchronized def disable(self): @@ -4928,7 +5154,7 @@ def create_advanced_sequence(self, sequence_name, property_names, set_as_active_ raise TypeError('{0} is not a valid property: {1}'.format(prop, type(Session.__base__.__dict__[prop]))) attribute_ids_used.add(Session.__base__.__dict__[prop]._attribute_id) - self._create_advanced_sequence(sequence_name, list(attribute_ids_used), set_as_active_sequence) + self._create_advanced_sequence_with_channels(sequence_name, list(attribute_ids_used), set_as_active_sequence) @ivi_synchronized def get_channel_name(self, index): @@ -5325,28 +5551,6 @@ def _initialize_with_channels(self, resource_name, channels=None, reset=False, o errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) - @ivi_synchronized - def _initiate(self): - r'''_initiate - - Starts generation or acquisition, causing the NI-DCPower session to - leave the Uncommitted state or Committed state and enter the Running - state. To return to the Uncommitted state call the abort - method. Refer to the `Programming - States `__ topic in - the *NI DC Power Supplies and SMUs Help* for information about the - specific NI-DCPower software states. - - **Related Topics:** - - `Programming - States `__ - ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code = self._library.niDCPower_Initiate(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - @ivi_synchronized def read_current_temperature(self): r'''read_current_temperature @@ -5404,110 +5608,6 @@ def reset_with_defaults(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - @ivi_synchronized - def send_software_edge_trigger(self, trigger): - r'''send_software_edge_trigger - - Asserts the specified trigger. This method can override an external - edge trigger. - - **Related Topics:** - - `Triggers `__ - - Note: - This method is not supported on all devices. Refer to `Supported - Methods by - Device `__ - for more information about supported devices. - - Args: - trigger (enums.SendSoftwareEdgeTriggerType): Specifies which trigger to assert. - **Defined Values:** - - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_START_TRIGGER | Asserts the Start trigger. | - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_SOURCE_TRIGGER | Asserts the Source trigger. | - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_MEASURE_TRIGGER | Asserts the Measure trigger. | - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_SEQUENCE_ADVANCE_TRIGGER | Asserts the Sequence Advance trigger. | - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_PULSE_TRIGGER | Asserts the Pulse trigger. | - +----------------------------------------+---------------------------------------+ - | NIDCPOWER_VAL_SHUTDOWN_TRIGGER | Asserts the Shutdown trigger. | - +----------------------------------------+---------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - ''' - if type(trigger) is not enums.SendSoftwareEdgeTriggerType: - raise TypeError('Parameter trigger must be of type ' + str(enums.SendSoftwareEdgeTriggerType)) - vi_ctype = _visatype.ViSession(self._vi) # case S110 - trigger_ctype = _visatype.ViInt32(trigger.value) # case S130 - error_code = self._library.niDCPower_SendSoftwareEdgeTrigger(vi_ctype, trigger_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - @ivi_synchronized - def wait_for_event(self, event_id, timeout=hightime.timedelta(seconds=10.0)): - r'''wait_for_event - - Waits until the device has generated the specified event. - - The session monitors whether each type of event has occurred at least - once since the last time this method or the initiate - method were called. If an event has only been generated once and you - call this method successively, the method times out. Individual - events must be generated between separate calls of this method. - - Note: - Refer to `Supported Methods by - Device `__ - for more information about supported devices. - - Args: - event_id (enums.Event): Specifies which event to wait for. - **Defined Values:** - - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_SOURCE_COMPLETE_EVENT | Waits for the Source Complete event. | - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_MEASURE_COMPLETE_EVENT | Waits for the Measure Complete event. | - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_SEQUENCE_ITERATION_COMPLETE_EVENT | Waits for the Sequence Iteration Complete event. | - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_SEQUENCE_ENGINE_DONE_EVENT | Waits for the Sequence Engine Done event. | - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_PULSE_COMPLETE_EVENT | Waits for the Pulse Complete event. | - +-------------------------------------------------+--------------------------------------------------+ - | NIDCPOWER_VAL_READY_FOR_PULSE_TRIGGER_EVENT | Waits for the Ready for Pulse Trigger event. | - +-------------------------------------------------+--------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - timeout (hightime.timedelta, datetime.timedelta, or float in seconds): Specifies the maximum time allowed for this method to complete, in - seconds. If the method does not complete within this time interval, - NI-DCPower returns an error. - - Note: - When setting the timeout interval, ensure you take into account any - triggers so that the timeout interval is long enough for your - application. - - ''' - if type(event_id) is not enums.Event: - raise TypeError('Parameter event_id must be of type ' + str(enums.Event)) - vi_ctype = _visatype.ViSession(self._vi) # case S110 - event_id_ctype = _visatype.ViInt32(event_id.value) # case S130 - timeout_ctype = _converters.convert_timedelta_to_seconds_real64(timeout) # case S140 - error_code = self._library.niDCPower_WaitForEvent(vi_ctype, event_id_ctype, timeout_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def _close(self): r'''_close @@ -5561,22 +5661,6 @@ def self_test(self): raise errors.SelfTestError(code, msg) return None - @ivi_synchronized - def reset(self): - r'''reset - - Resets the device to a known state. This method disables power - generation, resets session properties to their default values, commits - the session properties, and leaves the session in the Uncommitted state. - Refer to the `Programming - States `__ topic for - more information about NI-DCPower software states. - ''' - vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code = self._library.niDCPower_reset(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - @ivi_synchronized def _self_test(self): r'''_self_test diff --git a/generated/nidcpower/nidcpower/unit_tests/_mock_helper.py b/generated/nidcpower/nidcpower/unit_tests/_mock_helper.py index cc084199f..64ede6590 100644 --- a/generated/nidcpower/nidcpower/unit_tests/_mock_helper.py +++ b/generated/nidcpower/nidcpower/unit_tests/_mock_helper.py @@ -16,22 +16,22 @@ def __init__(self, function, param=None): class SideEffectsHelper(object): def __init__(self): self._defaults = {} - self._defaults['Abort'] = {} - self._defaults['Abort']['return'] = 0 + self._defaults['AbortWithChannels'] = {} + self._defaults['AbortWithChannels']['return'] = 0 self._defaults['CalSelfCalibrate'] = {} self._defaults['CalSelfCalibrate']['return'] = 0 self._defaults['ClearLatchedOutputCutoffState'] = {} self._defaults['ClearLatchedOutputCutoffState']['return'] = 0 - self._defaults['Commit'] = {} - self._defaults['Commit']['return'] = 0 + self._defaults['CommitWithChannels'] = {} + self._defaults['CommitWithChannels']['return'] = 0 self._defaults['ConfigureApertureTime'] = {} self._defaults['ConfigureApertureTime']['return'] = 0 - self._defaults['CreateAdvancedSequence'] = {} - self._defaults['CreateAdvancedSequence']['return'] = 0 - self._defaults['CreateAdvancedSequenceStep'] = {} - self._defaults['CreateAdvancedSequenceStep']['return'] = 0 - self._defaults['DeleteAdvancedSequence'] = {} - self._defaults['DeleteAdvancedSequence']['return'] = 0 + self._defaults['CreateAdvancedSequenceStepWithChannels'] = {} + self._defaults['CreateAdvancedSequenceStepWithChannels']['return'] = 0 + self._defaults['CreateAdvancedSequenceWithChannels'] = {} + self._defaults['CreateAdvancedSequenceWithChannels']['return'] = 0 + self._defaults['DeleteAdvancedSequenceWithChannels'] = {} + self._defaults['DeleteAdvancedSequenceWithChannels']['return'] = 0 self._defaults['Disable'] = {} self._defaults['Disable']['return'] = 0 self._defaults['ExportAttributeConfigurationBuffer'] = {} @@ -97,8 +97,8 @@ def __init__(self): self._defaults['InitializeWithChannels'] = {} self._defaults['InitializeWithChannels']['return'] = 0 self._defaults['InitializeWithChannels']['vi'] = None - self._defaults['Initiate'] = {} - self._defaults['Initiate']['return'] = 0 + self._defaults['InitiateWithChannels'] = {} + self._defaults['InitiateWithChannels']['return'] = 0 self._defaults['LockSession'] = {} self._defaults['LockSession']['return'] = 0 self._defaults['LockSession']['callerHasLock'] = None @@ -135,10 +135,12 @@ def __init__(self): self._defaults['ReadCurrentTemperature']['temperature'] = None self._defaults['ResetDevice'] = {} self._defaults['ResetDevice']['return'] = 0 + self._defaults['ResetWithChannels'] = {} + self._defaults['ResetWithChannels']['return'] = 0 self._defaults['ResetWithDefaults'] = {} self._defaults['ResetWithDefaults']['return'] = 0 - self._defaults['SendSoftwareEdgeTrigger'] = {} - self._defaults['SendSoftwareEdgeTrigger']['return'] = 0 + self._defaults['SendSoftwareEdgeTriggerWithChannels'] = {} + self._defaults['SendSoftwareEdgeTriggerWithChannels']['return'] = 0 self._defaults['SetAttributeViBoolean'] = {} self._defaults['SetAttributeViBoolean']['return'] = 0 self._defaults['SetAttributeViInt32'] = {} @@ -154,15 +156,13 @@ def __init__(self): self._defaults['UnlockSession'] = {} self._defaults['UnlockSession']['return'] = 0 self._defaults['UnlockSession']['callerHasLock'] = None - self._defaults['WaitForEvent'] = {} - self._defaults['WaitForEvent']['return'] = 0 + self._defaults['WaitForEventWithChannels'] = {} + self._defaults['WaitForEventWithChannels']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 self._defaults['error_message'] = {} self._defaults['error_message']['return'] = 0 self._defaults['error_message']['errorMessage'] = None - self._defaults['reset'] = {} - self._defaults['reset']['return'] = 0 self._defaults['self_test'] = {} self._defaults['self_test']['return'] = 0 self._defaults['self_test']['selfTestResult'] = None @@ -174,10 +174,10 @@ def __getitem__(self, func): def __setitem__(self, func, val): self._defaults[func] = val - def niDCPower_Abort(self, vi): # noqa: N802 - if self._defaults['Abort']['return'] != 0: - return self._defaults['Abort']['return'] - return self._defaults['Abort']['return'] + def niDCPower_AbortWithChannels(self, vi, channel_name): # noqa: N802 + if self._defaults['AbortWithChannels']['return'] != 0: + return self._defaults['AbortWithChannels']['return'] + return self._defaults['AbortWithChannels']['return'] def niDCPower_CalSelfCalibrate(self, vi, channel_name): # noqa: N802 if self._defaults['CalSelfCalibrate']['return'] != 0: @@ -189,30 +189,30 @@ def niDCPower_ClearLatchedOutputCutoffState(self, vi, channel_name, output_cutof return self._defaults['ClearLatchedOutputCutoffState']['return'] return self._defaults['ClearLatchedOutputCutoffState']['return'] - def niDCPower_Commit(self, vi): # noqa: N802 - if self._defaults['Commit']['return'] != 0: - return self._defaults['Commit']['return'] - return self._defaults['Commit']['return'] + def niDCPower_CommitWithChannels(self, vi, channel_name): # noqa: N802 + if self._defaults['CommitWithChannels']['return'] != 0: + return self._defaults['CommitWithChannels']['return'] + return self._defaults['CommitWithChannels']['return'] def niDCPower_ConfigureApertureTime(self, vi, channel_name, aperture_time, units): # noqa: N802 if self._defaults['ConfigureApertureTime']['return'] != 0: return self._defaults['ConfigureApertureTime']['return'] return self._defaults['ConfigureApertureTime']['return'] - def niDCPower_CreateAdvancedSequence(self, vi, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence): # noqa: N802 - if self._defaults['CreateAdvancedSequence']['return'] != 0: - return self._defaults['CreateAdvancedSequence']['return'] - return self._defaults['CreateAdvancedSequence']['return'] + def niDCPower_CreateAdvancedSequenceStepWithChannels(self, vi, channel_name, set_as_active_step): # noqa: N802 + if self._defaults['CreateAdvancedSequenceStepWithChannels']['return'] != 0: + return self._defaults['CreateAdvancedSequenceStepWithChannels']['return'] + return self._defaults['CreateAdvancedSequenceStepWithChannels']['return'] - def niDCPower_CreateAdvancedSequenceStep(self, vi, set_as_active_step): # noqa: N802 - if self._defaults['CreateAdvancedSequenceStep']['return'] != 0: - return self._defaults['CreateAdvancedSequenceStep']['return'] - return self._defaults['CreateAdvancedSequenceStep']['return'] + def niDCPower_CreateAdvancedSequenceWithChannels(self, vi, channel_name, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence): # noqa: N802 + if self._defaults['CreateAdvancedSequenceWithChannels']['return'] != 0: + return self._defaults['CreateAdvancedSequenceWithChannels']['return'] + return self._defaults['CreateAdvancedSequenceWithChannels']['return'] - def niDCPower_DeleteAdvancedSequence(self, vi, sequence_name): # noqa: N802 - if self._defaults['DeleteAdvancedSequence']['return'] != 0: - return self._defaults['DeleteAdvancedSequence']['return'] - return self._defaults['DeleteAdvancedSequence']['return'] + def niDCPower_DeleteAdvancedSequenceWithChannels(self, vi, channel_name, sequence_name): # noqa: N802 + if self._defaults['DeleteAdvancedSequenceWithChannels']['return'] != 0: + return self._defaults['DeleteAdvancedSequenceWithChannels']['return'] + return self._defaults['DeleteAdvancedSequenceWithChannels']['return'] def niDCPower_Disable(self, vi): # noqa: N802 if self._defaults['Disable']['return'] != 0: @@ -467,10 +467,10 @@ def niDCPower_InitializeWithChannels(self, resource_name, channels, reset, optio vi.contents.value = self._defaults['InitializeWithChannels']['vi'] return self._defaults['InitializeWithChannels']['return'] - def niDCPower_Initiate(self, vi): # noqa: N802 - if self._defaults['Initiate']['return'] != 0: - return self._defaults['Initiate']['return'] - return self._defaults['Initiate']['return'] + def niDCPower_InitiateWithChannels(self, vi, channel_name): # noqa: N802 + if self._defaults['InitiateWithChannels']['return'] != 0: + return self._defaults['InitiateWithChannels']['return'] + return self._defaults['InitiateWithChannels']['return'] def niDCPower_LockSession(self, vi, caller_has_lock): # noqa: N802 if self._defaults['LockSession']['return'] != 0: @@ -604,15 +604,20 @@ def niDCPower_ResetDevice(self, vi): # noqa: N802 return self._defaults['ResetDevice']['return'] return self._defaults['ResetDevice']['return'] + def niDCPower_ResetWithChannels(self, vi, channel_name): # noqa: N802 + if self._defaults['ResetWithChannels']['return'] != 0: + return self._defaults['ResetWithChannels']['return'] + return self._defaults['ResetWithChannels']['return'] + def niDCPower_ResetWithDefaults(self, vi): # noqa: N802 if self._defaults['ResetWithDefaults']['return'] != 0: return self._defaults['ResetWithDefaults']['return'] return self._defaults['ResetWithDefaults']['return'] - def niDCPower_SendSoftwareEdgeTrigger(self, vi, trigger): # noqa: N802 - if self._defaults['SendSoftwareEdgeTrigger']['return'] != 0: - return self._defaults['SendSoftwareEdgeTrigger']['return'] - return self._defaults['SendSoftwareEdgeTrigger']['return'] + def niDCPower_SendSoftwareEdgeTriggerWithChannels(self, vi, channel_name, trigger): # noqa: N802 + if self._defaults['SendSoftwareEdgeTriggerWithChannels']['return'] != 0: + return self._defaults['SendSoftwareEdgeTriggerWithChannels']['return'] + return self._defaults['SendSoftwareEdgeTriggerWithChannels']['return'] def niDCPower_SetAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 if self._defaults['SetAttributeViBoolean']['return'] != 0: @@ -654,10 +659,10 @@ def niDCPower_UnlockSession(self, vi, caller_has_lock): # noqa: N802 caller_has_lock.contents.value = self._defaults['UnlockSession']['callerHasLock'] return self._defaults['UnlockSession']['return'] - def niDCPower_WaitForEvent(self, vi, event_id, timeout): # noqa: N802 - if self._defaults['WaitForEvent']['return'] != 0: - return self._defaults['WaitForEvent']['return'] - return self._defaults['WaitForEvent']['return'] + def niDCPower_WaitForEventWithChannels(self, vi, channel_name, event_id, timeout): # noqa: N802 + if self._defaults['WaitForEventWithChannels']['return'] != 0: + return self._defaults['WaitForEventWithChannels']['return'] + return self._defaults['WaitForEventWithChannels']['return'] def niDCPower_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: @@ -678,11 +683,6 @@ def niDCPower_error_message(self, vi, error_code, error_message): # noqa: N802 error_message[i] = test_value[i] return self._defaults['error_message']['return'] - def niDCPower_reset(self, vi): # noqa: N802 - if self._defaults['reset']['return'] != 0: - return self._defaults['reset']['return'] - return self._defaults['reset']['return'] - def niDCPower_self_test(self, vi, self_test_result, self_test_message): # noqa: N802 if self._defaults['self_test']['return'] != 0: return self._defaults['self_test']['return'] @@ -704,22 +704,22 @@ def niDCPower_self_test(self, vi, self_test_result, self_test_message): # noqa: # Helper function to setup Mock object with default side effects and return values def set_side_effects_and_return_values(self, mock_library): - mock_library.niDCPower_Abort.side_effect = MockFunctionCallError("niDCPower_Abort") - mock_library.niDCPower_Abort.return_value = 0 + mock_library.niDCPower_AbortWithChannels.side_effect = MockFunctionCallError("niDCPower_AbortWithChannels") + mock_library.niDCPower_AbortWithChannels.return_value = 0 mock_library.niDCPower_CalSelfCalibrate.side_effect = MockFunctionCallError("niDCPower_CalSelfCalibrate") mock_library.niDCPower_CalSelfCalibrate.return_value = 0 mock_library.niDCPower_ClearLatchedOutputCutoffState.side_effect = MockFunctionCallError("niDCPower_ClearLatchedOutputCutoffState") mock_library.niDCPower_ClearLatchedOutputCutoffState.return_value = 0 - mock_library.niDCPower_Commit.side_effect = MockFunctionCallError("niDCPower_Commit") - mock_library.niDCPower_Commit.return_value = 0 + mock_library.niDCPower_CommitWithChannels.side_effect = MockFunctionCallError("niDCPower_CommitWithChannels") + mock_library.niDCPower_CommitWithChannels.return_value = 0 mock_library.niDCPower_ConfigureApertureTime.side_effect = MockFunctionCallError("niDCPower_ConfigureApertureTime") mock_library.niDCPower_ConfigureApertureTime.return_value = 0 - mock_library.niDCPower_CreateAdvancedSequence.side_effect = MockFunctionCallError("niDCPower_CreateAdvancedSequence") - mock_library.niDCPower_CreateAdvancedSequence.return_value = 0 - mock_library.niDCPower_CreateAdvancedSequenceStep.side_effect = MockFunctionCallError("niDCPower_CreateAdvancedSequenceStep") - mock_library.niDCPower_CreateAdvancedSequenceStep.return_value = 0 - mock_library.niDCPower_DeleteAdvancedSequence.side_effect = MockFunctionCallError("niDCPower_DeleteAdvancedSequence") - mock_library.niDCPower_DeleteAdvancedSequence.return_value = 0 + mock_library.niDCPower_CreateAdvancedSequenceStepWithChannels.side_effect = MockFunctionCallError("niDCPower_CreateAdvancedSequenceStepWithChannels") + mock_library.niDCPower_CreateAdvancedSequenceStepWithChannels.return_value = 0 + mock_library.niDCPower_CreateAdvancedSequenceWithChannels.side_effect = MockFunctionCallError("niDCPower_CreateAdvancedSequenceWithChannels") + mock_library.niDCPower_CreateAdvancedSequenceWithChannels.return_value = 0 + mock_library.niDCPower_DeleteAdvancedSequenceWithChannels.side_effect = MockFunctionCallError("niDCPower_DeleteAdvancedSequenceWithChannels") + mock_library.niDCPower_DeleteAdvancedSequenceWithChannels.return_value = 0 mock_library.niDCPower_Disable.side_effect = MockFunctionCallError("niDCPower_Disable") mock_library.niDCPower_Disable.return_value = 0 mock_library.niDCPower_ExportAttributeConfigurationBuffer.side_effect = MockFunctionCallError("niDCPower_ExportAttributeConfigurationBuffer") @@ -758,8 +758,8 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niDCPower_ImportAttributeConfigurationFile.return_value = 0 mock_library.niDCPower_InitializeWithChannels.side_effect = MockFunctionCallError("niDCPower_InitializeWithChannels") mock_library.niDCPower_InitializeWithChannels.return_value = 0 - mock_library.niDCPower_Initiate.side_effect = MockFunctionCallError("niDCPower_Initiate") - mock_library.niDCPower_Initiate.return_value = 0 + mock_library.niDCPower_InitiateWithChannels.side_effect = MockFunctionCallError("niDCPower_InitiateWithChannels") + mock_library.niDCPower_InitiateWithChannels.return_value = 0 mock_library.niDCPower_LockSession.side_effect = MockFunctionCallError("niDCPower_LockSession") mock_library.niDCPower_LockSession.return_value = 0 mock_library.niDCPower_Measure.side_effect = MockFunctionCallError("niDCPower_Measure") @@ -784,10 +784,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niDCPower_ReadCurrentTemperature.return_value = 0 mock_library.niDCPower_ResetDevice.side_effect = MockFunctionCallError("niDCPower_ResetDevice") mock_library.niDCPower_ResetDevice.return_value = 0 + mock_library.niDCPower_ResetWithChannels.side_effect = MockFunctionCallError("niDCPower_ResetWithChannels") + mock_library.niDCPower_ResetWithChannels.return_value = 0 mock_library.niDCPower_ResetWithDefaults.side_effect = MockFunctionCallError("niDCPower_ResetWithDefaults") mock_library.niDCPower_ResetWithDefaults.return_value = 0 - mock_library.niDCPower_SendSoftwareEdgeTrigger.side_effect = MockFunctionCallError("niDCPower_SendSoftwareEdgeTrigger") - mock_library.niDCPower_SendSoftwareEdgeTrigger.return_value = 0 + mock_library.niDCPower_SendSoftwareEdgeTriggerWithChannels.side_effect = MockFunctionCallError("niDCPower_SendSoftwareEdgeTriggerWithChannels") + mock_library.niDCPower_SendSoftwareEdgeTriggerWithChannels.return_value = 0 mock_library.niDCPower_SetAttributeViBoolean.side_effect = MockFunctionCallError("niDCPower_SetAttributeViBoolean") mock_library.niDCPower_SetAttributeViBoolean.return_value = 0 mock_library.niDCPower_SetAttributeViInt32.side_effect = MockFunctionCallError("niDCPower_SetAttributeViInt32") @@ -802,13 +804,11 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niDCPower_SetSequence.return_value = 0 mock_library.niDCPower_UnlockSession.side_effect = MockFunctionCallError("niDCPower_UnlockSession") mock_library.niDCPower_UnlockSession.return_value = 0 - mock_library.niDCPower_WaitForEvent.side_effect = MockFunctionCallError("niDCPower_WaitForEvent") - mock_library.niDCPower_WaitForEvent.return_value = 0 + mock_library.niDCPower_WaitForEventWithChannels.side_effect = MockFunctionCallError("niDCPower_WaitForEventWithChannels") + mock_library.niDCPower_WaitForEventWithChannels.return_value = 0 mock_library.niDCPower_close.side_effect = MockFunctionCallError("niDCPower_close") mock_library.niDCPower_close.return_value = 0 mock_library.niDCPower_error_message.side_effect = MockFunctionCallError("niDCPower_error_message") mock_library.niDCPower_error_message.return_value = 0 - mock_library.niDCPower_reset.side_effect = MockFunctionCallError("niDCPower_reset") - mock_library.niDCPower_reset.return_value = 0 mock_library.niDCPower_self_test.side_effect = MockFunctionCallError("niDCPower_self_test") mock_library.niDCPower_self_test.return_value = 0 diff --git a/src/nidcpower/metadata/attributes.py b/src/nidcpower/metadata/attributes.py index d555d8bde..a3b054f98 100644 --- a/src/nidcpower/metadata/attributes.py +++ b/src/nidcpower/metadata/attributes.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-DCPower API metadata version 20.7.0d409 +# This file is generated from NI-DCPower API metadata version 21.0.0d52 attributes = { 1050003: { 'access': 'read-write', @@ -102,7 +102,7 @@ }, 1050511: { 'access': 'read only', - 'channel_based': False, + 'channel_based': True, 'documentation': { 'description': 'Contains the name of the manufacturer for the device you are currently using.' }, @@ -159,7 +159,7 @@ 'access': 'read-write', 'channel_based': False, 'documentation': { - 'description': '\nSpecifies the power source to use. NI-DCPower switches the power source used by the device to the specified value.\nDefault Value: NIDCPOWER_VAL_AUTOMATIC\nis set to NIDCPOWER_VAL_AUTOMATIC. However, if the session is in the Committed or Uncommitted state when you set this attribute, the power source selection only occurs after you call the niDCPower_Initiate function.\n', + 'description': '\nSpecifies the power source to use. NI-DCPower switches the power source used by the device to the specified value.\nDefault Value: NIDCPOWER_VAL_AUTOMATIC\nis set to NIDCPOWER_VAL_AUTOMATIC. However, if the session is in the Committed or Uncommitted state when you set this attribute, the power source selection only occurs after you call the niDCPower_InitiateWithChannels function.\n', 'note': 'Automatic selection is not persistent and occurs only at the time this attribute' }, 'enum': 'PowerSource', @@ -856,7 +856,7 @@ 'access': 'read-write', 'channel_based': True, 'documentation': { - 'description': '\nSpecifies whether to take continuous measurements. Call the niDCPower_Abort function to stop continuous measurements. When this attribute is set to VI_FALSE and the NIDCPOWER_ATTR_SOURCE_MODE attribute is set to NIDCPOWER_VAL_SINGLE_POINT, the NIDCPOWER_ATTR_MEASURE_WHEN attribute must be set to NIDCPOWER_VAL_AUTOMATICALLY_AFTER_SOURCE_COMPLETE or NIDCPOWER_VAL_ON_MEASURE_TRIGGER. When this attribute is set to VI_FALSE and the NIDCPOWER_ATTR_SOURCE_MODE attribute is set to NIDCPOWER_VAL_SEQUENCE, the NIDCPOWER_ATTR_MEASURE_WHEN attribute must be set to NIDCPOWER_VAL_ON_MEASURE_TRIGGER.\nfor information about supported devices.\nDefault Value: VI_TRUE\n', + 'description': '\nSpecifies whether to take continuous measurements. Call the niDCPower_AbortWithChannels function to stop continuous measurements. When this attribute is set to VI_FALSE and the NIDCPOWER_ATTR_SOURCE_MODE attribute is set to NIDCPOWER_VAL_SINGLE_POINT, the NIDCPOWER_ATTR_MEASURE_WHEN attribute must be set to NIDCPOWER_VAL_AUTOMATICALLY_AFTER_SOURCE_COMPLETE or NIDCPOWER_VAL_ON_MEASURE_TRIGGER. When this attribute is set to VI_FALSE and the NIDCPOWER_ATTR_SOURCE_MODE attribute is set to NIDCPOWER_VAL_SEQUENCE, the NIDCPOWER_ATTR_MEASURE_WHEN attribute must be set to NIDCPOWER_VAL_ON_MEASURE_TRIGGER.\nfor information about supported devices.\nDefault Value: VI_TRUE\n', 'note': '\nThis attribute is not available in a session involving multiple channels.\n' }, 'lv_property': 'Measurement:Measure Record Length Is Finite', @@ -965,7 +965,7 @@ }, 1150073: { 'access': 'read-write', - 'channel_based': False, + 'channel_based': True, 'documentation': { 'description': '\nSpecifies whether the values calculated during self-calibration should be written to hardware to be used until the next self-calibration or only used until the niDCPower_ResetDevice function is called or the machine is powered down.\nThis attribute affects the behavior of the niDCPower_CalSelfCalibrate function. When set to NIDCPOWER_VAL_KEEP_IN_MEMORY, the values calculated by the niDCPower_CalSelfCalibrate function are used in the existing session, as well as in all further sessions until you call the niDCPower_ResetDevice function or restart the machine. When you set this property to NIDCPOWER_VAL_WRITE_TO_EEPROM, the values calculated by the niDCPower_CalSelfCalibrate function are written to hardware and used in the existing session and in all subsequent sessions until another call to the niDCPower_CalSelfCalibrate function is made.\nabout supported devices.\nDefault Value: NIDCPOWER_VAL_KEEP_IN_MEMORY\n', 'note': 'This attribute is not supported by all devices. Refer to Supported Attributes by Device for information' @@ -1333,7 +1333,7 @@ }, 1150152: { 'access': 'read only', - 'channel_based': False, + 'channel_based': True, 'documentation': { 'description': 'Contains the serial number for the device you are currently using.' }, @@ -1868,7 +1868,7 @@ 'access': 'read-write', 'channel_based': True, 'documentation': { - 'description': '\nSpecifies whether the output is enabled (VI_TRUE) or disabled (VI_FALSE).\nDepending on the value you specify for the NIDCPOWER_ATTR_OUTPUT_FUNCTION attribute, you also must set the voltage level or current level in addition to enabling the output\nthe niDCPower_Initiate function. Refer to the Programming States topic in the NI DC Power Supplies and SMUs Help for more information about NI-DCPower programming states.\nDefault Value: The default value is VI_TRUE if you use the niDCPower_InitializeWithChannels function to open the session. Otherwise the default value is VI_FALSE, including when you use a calibration session or the deprecated programming model.\n', + 'description': '\nSpecifies whether the output is enabled (VI_TRUE) or disabled (VI_FALSE).\nDepending on the value you specify for the NIDCPOWER_ATTR_OUTPUT_FUNCTION attribute, you also must set the voltage level or current level in addition to enabling the output\nthe niDCPower_InitiateWithChannels function. Refer to the Programming States topic in the NI DC Power Supplies and SMUs Help for more information about NI-DCPower programming states.\nDefault Value: The default value is VI_TRUE if you use the niDCPower_InitializeWithChannels function to open the session. Otherwise the default value is VI_FALSE, including when you use a calibration session or the deprecated programming model.\n', 'note': 'If the session is in the Committed or Uncommitted states, enabling the output does not take effect until you call' }, 'lv_property': 'Source:Output Enabled', diff --git a/src/nidcpower/metadata/config.py b/src/nidcpower/metadata/config.py index 12e71cc97..79afe3724 100644 --- a/src/nidcpower/metadata/config.py +++ b/src/nidcpower/metadata/config.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-DCPower API metadata version 20.7.0d409 +# This file is generated from NI-DCPower API metadata version 21.0.0d52 config = { - 'api_version': '20.7.0d409', + 'api_version': '21.0.0d52', 'c_function_prefix': 'niDCPower_', 'close_function': 'close', 'context_manager_name': { - 'abort_function': 'Abort', - 'initiate_function': 'Initiate', + 'abort_function': 'AbortWithChannels', + 'initiate_function': 'InitiateWithChannels', 'task': 'acquisition' }, 'custom_types': [ diff --git a/src/nidcpower/metadata/enums.py b/src/nidcpower/metadata/enums.py index e99d17a9a..089a74f37 100644 --- a/src/nidcpower/metadata/enums.py +++ b/src/nidcpower/metadata/enums.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-DCPower API metadata version 20.7.0d409 +# This file is generated from NI-DCPower API metadata version 21.0.0d52 enums = { 'ApertureTimeUnits': { 'values': [ diff --git a/src/nidcpower/metadata/functions.py b/src/nidcpower/metadata/functions.py index d29beb281..b77a13f07 100644 --- a/src/nidcpower/metadata/functions.py +++ b/src/nidcpower/metadata/functions.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-DCPower API metadata version 20.7.0d409 +# This file is generated from NI-DCPower API metadata version 21.0.0d52 functions = { - 'Abort': { + 'AbortWithChannels': { 'documentation': { - 'description': '\nTransitions the NI-DCPower session from the Running state to the\nUncommitted state. If a sequence is running, it is stopped. Any\nconfiguration functions called after this function are not applied until\nthe niDCPower_Initiate function is called. If power output is enabled\nwhen you call the niDCPower_Abort function, the output channels remain\nin their current state and continue providing power.\n\nUse the niDCPower_ConfigureOutputEnabled function to disable power\noutput on a per channel basis. Use the niDCPower_reset function to\ndisable output on all channels.\n\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for information about the\nspecific NI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' + 'description': '\nTransitions the NI-DCPower session from the Running state to the\nUncommitted state. If a sequence is running, it is stopped. Any\nconfiguration functions called after this function are not applied until\nthe niDCPower_InitiateWithChannels function is called. If power output is enabled\nwhen you call the niDCPower_AbortWithChannels function, the output channels remain\nin their current state and continue providing power.\n\nUse the niDCPower_ConfigureOutputEnabled function to disable power\noutput on a per channel basis. Use the niDCPower_reset function to\ndisable output on all channels.\n\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for information about the\nspecific NI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' }, 'parameters': [ { @@ -13,8 +13,14 @@ }, 'name': 'vi', 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' } ], + 'python_name': 'abort', 'returns': 'ViStatus' }, 'CalSelfCalibrate': { @@ -114,9 +120,9 @@ ], 'returns': 'ViStatus' }, - 'Commit': { + 'CommitWithChannels': { 'documentation': { - 'description': '\nApplies previously configured settings to the device. Calling this\nfunction moves the NI-DCPower session from the Uncommitted state into\nthe Committed state. After calling this function, modifying any\nattribute reverts the NI-DCPower session to the Uncommitted state. Use\nthe niDCPower_Initiate function to transition to the Running state.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for details about the specific\nNI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' + 'description': '\nApplies previously configured settings to the device. Calling this\nfunction moves the NI-DCPower session from the Uncommitted state into\nthe Committed state. After calling this function, modifying any\nattribute reverts the NI-DCPower session to the Uncommitted state. Use\nthe niDCPower_InitiateWithChannels function to transition to the Running state.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for details about the specific\nNI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' }, 'parameters': [ { @@ -126,8 +132,14 @@ }, 'name': 'vi', 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' } ], + 'python_name': 'commit', 'returns': 'ViStatus' }, 'ConfigureApertureTime': { @@ -183,12 +195,45 @@ ], 'returns': 'ViStatus' }, - 'CreateAdvancedSequence': { + 'CreateAdvancedSequenceStepWithChannels': { + 'documentation': { + 'description': '\nCreates a new advanced sequence step in the advanced sequence specified\nby the Active advanced sequence. When you create an advanced sequence\nstep, each attribute you passed to the niDCPower_CreateAdvancedSequenceWithChannels\nfunction is reset to its default value for that step unless otherwise\nspecified.\n\n**Support for this Function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequenceWithChannels\n', + 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': '\nIdentifies a particular instrument session. **vi** is obtained from the\nniDCPower_InitializeWithChannels function.\n' + }, + 'name': 'vi', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'default_value': True, + 'direction': 'in', + 'documentation': { + 'description': 'Specifies that this current step in the active sequence is active.' + }, + 'name': 'setAsActiveStep', + 'type': 'ViBoolean' + } + ], + 'python_name': 'create_advanced_sequence_step', + 'returns': 'ViStatus' + }, + 'CreateAdvancedSequenceWithChannels': { 'codegen_method': 'private', 'documentation': { - 'description': '\nCreates an empty advanced sequence. Call the\nniDCPower_CreateAdvancedSequenceStep function to add steps to the\nactive advanced sequence.\n\nYou can create multiple advanced sequences in a session.\n\n**Support for this function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\nUse this function in the Uncommitted or Committed programming states.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nNI-DCPower programming states.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequenceStep\n', + 'description': '\nCreates an empty advanced sequence. Call the\nniDCPower_CreateAdvancedSequenceStepWithChannels function to add steps to the\nactive advanced sequence.\n\nYou can create multiple advanced sequences in a session.\n\n**Support for this function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\nUse this function in the Uncommitted or Committed programming states.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nNI-DCPower programming states.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequenceStepWithChannels\n', 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" }, + 'method_name_for_documentation': 'create_advanced_sequence', 'parameters': [ { 'direction': 'in', @@ -198,6 +243,11 @@ 'name': 'vi', 'type': 'ViSession' }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, { 'direction': 'in', 'documentation': { @@ -822,9 +872,9 @@ ], 'returns': 'ViStatus' }, - 'CreateAdvancedSequenceStep': { + 'DeleteAdvancedSequenceWithChannels': { 'documentation': { - 'description': '\nCreates a new advanced sequence step in the advanced sequence specified\nby the Active advanced sequence. When you create an advanced sequence\nstep, each attribute you passed to the niDCPower_CreateAdvancedSequence\nfunction is reset to its default value for that step unless otherwise\nspecified.\n\n**Support for this Function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequence\n', + 'description': '\nDeletes a previously created advanced sequence and all the advanced\nsequence steps in the advanced sequence.\n\n**Support for this Function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n', 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" }, 'parameters': [ @@ -837,30 +887,9 @@ 'type': 'ViSession' }, { - 'default_value': True, 'direction': 'in', - 'documentation': { - 'description': 'Specifies that this current step in the active sequence is active.' - }, - 'name': 'setAsActiveStep', - 'type': 'ViBoolean' - } - ], - 'returns': 'ViStatus' - }, - 'DeleteAdvancedSequence': { - 'documentation': { - 'description': '\nDeletes a previously created advanced sequence and all the advanced\nsequence steps in the advanced sequence.\n\n**Support for this Function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n', - 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" - }, - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': '\nIdentifies a particular instrument session. **vi** is obtained from the\nniDCPower_InitializeWithChannels function.\n' - }, - 'name': 'vi', - 'type': 'ViSession' + 'name': 'channelName', + 'type': 'ViConstString' }, { 'direction': 'in', @@ -871,11 +900,12 @@ 'type': 'ViConstString' } ], + 'python_name': 'delete_advanced_sequence', 'returns': 'ViStatus' }, 'Disable': { 'documentation': { - 'description': '\nThis function performs the same actions as the niDCPower_reset\nfunction, except that this function also immediately sets the\nNIDCPOWER_ATTR_OUTPUT_ENABLED attribute to VI_FALSE.\n\nThis function opens the output relay on devices that have an output\nrelay.\n' + 'description': '\nThis function performs the same actions as the niDCPower_ResetWithChannels\nfunction, except that this function also immediately sets the\nNIDCPOWER_ATTR_OUTPUT_ENABLED attribute to VI_FALSE.\n\nThis function opens the output relay on devices that have an output\nrelay.\n' }, 'parameters': [ { @@ -957,7 +987,7 @@ 'FancyFetchMultiple': { 'codegen_method': 'python-only', 'documentation': { - 'description': '\nReturns a list of named tuples (Measurement) that were\npreviously taken and are stored in the NI-DCPower buffer. This function\nshould not be used when the NIDCPOWER_ATTR_MEASURE_WHEN attribute is\nset to NIDCPOWER_VAL_ON_DEMAND. You must first call\nniDCPower_Initiate before calling this function.\n\nFields in Measurement:\n\n- **voltage** (float)\n- **current** (float)\n- **in_compliance** (bool)\n\n', + 'description': '\nReturns a list of named tuples (Measurement) that were\npreviously taken and are stored in the NI-DCPower buffer. This function\nshould not be used when the NIDCPOWER_ATTR_MEASURE_WHEN attribute is\nset to NIDCPOWER_VAL_ON_DEMAND. You must first call\nniDCPower_InitiateWithChannels before calling this function.\n\nFields in Measurement:\n\n- **voltage** (float)\n- **current** (float)\n- **in_compliance** (bool)\n\n', 'note': 'This function is not supported on all devices. Refer to `Supported Functions by Device `__ for more information about supported devices.' }, 'method_templates': [ @@ -1071,7 +1101,7 @@ 'FetchMultiple': { 'codegen_method': 'private', 'documentation': { - 'description': '\nReturns an array of voltage measurements, an array of current\nmeasurements, and an array of compliance measurements that were\npreviously taken and are stored in the NI-DCPower buffer. This function\nshould not be used when the NIDCPOWER_ATTR_MEASURE_WHEN attribute is\nset to NIDCPOWER_VAL_ON_DEMAND. You must first call\nniDCPower_Initiate before calling this function.\n\nRefer to the `Acquiring\nMeasurements `__\nand `Compliance `__ topics in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nconfiguring this function.\n', + 'description': '\nReturns an array of voltage measurements, an array of current\nmeasurements, and an array of compliance measurements that were\npreviously taken and are stored in the NI-DCPower buffer. This function\nshould not be used when the NIDCPOWER_ATTR_MEASURE_WHEN attribute is\nset to NIDCPOWER_VAL_ON_DEMAND. You must first call\nniDCPower_InitiateWithChannels before calling this function.\n\nRefer to the `Acquiring\nMeasurements `__\nand `Compliance `__ topics in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nconfiguring this function.\n', 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" }, 'method_name_for_documentation': 'fetch_multiple', @@ -1798,7 +1828,7 @@ 'InitializeWithChannels': { 'codegen_method': 'private', 'documentation': { - 'description': '\nCreates and returns a new NI-DCPower session to the power supply or SMU\nspecified in **resource name** to be used in all subsequent NI-DCPower\nfunction calls. With this function, you can optionally set the initial\nstate of the following session attributes:\n\n- NIDCPOWER_ATTR_SIMULATE\n- NIDCPOWER_ATTR_DRIVER_SETUP\n\nAfter calling this function, the session will be in the Uncommitted\nstate. Refer to the `Programming\nStates `__ topic for\ndetails about specific software states.\n\nTo place the device in a known start-up state when creating a new\nsession, set **reset** to VI_TRUE. This action is equivalent to using\nthe niDCPower_reset function immediately after initializing the\nsession.\n\nTo open a session and leave the device in its existing configuration\nwithout passing through a transitional output state, set **reset** to\nVI_FALSE. Then configure the device as in the previous session,\nchanging only the desired settings, and then call the\nniDCPower_Initiate function.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' + 'description': '\nCreates and returns a new NI-DCPower session to the power supply or SMU\nspecified in **resource name** to be used in all subsequent NI-DCPower\nfunction calls. With this function, you can optionally set the initial\nstate of the following session attributes:\n\n- NIDCPOWER_ATTR_SIMULATE\n- NIDCPOWER_ATTR_DRIVER_SETUP\n\nAfter calling this function, the session will be in the Uncommitted\nstate. Refer to the `Programming\nStates `__ topic for\ndetails about specific software states.\n\nTo place the device in a known start-up state when creating a new\nsession, set **reset** to VI_TRUE. This action is equivalent to using\nthe niDCPower_ResetWithChannels function immediately after initializing the\nsession.\n\nTo open a session and leave the device in its existing configuration\nwithout passing through a transitional output state, set **reset** to\nVI_FALSE. Then configure the device as in the previous session,\nchanging only the desired settings, and then call the\nniDCPower_InitiateWithChannels function.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' }, 'method_name_for_documentation': '__init__', 'parameters': [ @@ -1854,10 +1884,10 @@ 'returns': 'ViStatus', 'use_session_lock': False }, - 'Initiate': { + 'InitiateWithChannels': { 'codegen_method': 'private', 'documentation': { - 'description': '\nStarts generation or acquisition, causing the NI-DCPower session to\nleave the Uncommitted state or Committed state and enter the Running\nstate. To return to the Uncommitted state call the niDCPower_Abort\nfunction. Refer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for information about the\nspecific NI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' + 'description': '\nStarts generation or acquisition, causing the NI-DCPower session to\nleave the Uncommitted state or Committed state and enter the Running\nstate. To return to the Uncommitted state call the niDCPower_AbortWithChannels\nfunction. Refer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for information about the\nspecific NI-DCPower software states.\n\n**Related Topics:**\n\n`Programming\nStates `__\n' }, 'method_name_for_documentation': 'initiate', 'parameters': [ @@ -1868,6 +1898,11 @@ }, 'name': 'vi', 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' } ], 'returns': 'ViStatus' @@ -2365,9 +2400,31 @@ ], 'returns': 'ViStatus' }, + 'ResetWithChannels': { + 'documentation': { + 'description': '\nResets the device to a known state. This function disables power\ngeneration, resets session attributes to their default values, commits\nthe session attributes, and leaves the session in the Uncommitted state.\nRefer to the `Programming\nStates `__ topic for\nmore information about NI-DCPower software states.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': '\nIdentifies a particular instrument session. **vi** is obtained from the\nniDCPower_InitializeWithChannels function.\n' + }, + 'name': 'vi', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + } + ], + 'python_name': 'reset', + 'returns': 'ViStatus' + }, 'ResetWithDefaults': { 'documentation': { - 'description': "\nResets the device to a known state. This function disables power\ngeneration, resets session attributes to their default values, commits\nthe session attributes, and leaves the session in the\n`Running `__\nstate. In addition to exhibiting the behavior of the niDCPower_reset\nfunction, this function can assign user-defined default values for\nconfigurable attributes from the IVI configuration.\n" + 'description': "\nResets the device to a known state. This function disables power\ngeneration, resets session attributes to their default values, commits\nthe session attributes, and leaves the session in the\n`Running `__\nstate. In addition to exhibiting the behavior of the niDCPower_ResetWithChannels\nfunction, this function can assign user-defined default values for\nconfigurable attributes from the IVI configuration.\n" }, 'parameters': [ { @@ -2381,7 +2438,7 @@ ], 'returns': 'ViStatus' }, - 'SendSoftwareEdgeTrigger': { + 'SendSoftwareEdgeTriggerWithChannels': { 'documentation': { 'description': '\nAsserts the specified trigger. This function can override an external\nedge trigger.\n\n**Related Topics:**\n\n`Triggers `__\n', 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" @@ -2395,6 +2452,11 @@ 'name': 'vi', 'type': 'ViSession' }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, { 'direction': 'in', 'documentation': { @@ -2431,6 +2493,7 @@ 'type': 'ViInt32' } ], + 'python_name': 'send_software_edge_trigger', 'returns': 'ViStatus' }, 'SetAttributeViBoolean': { @@ -2734,9 +2797,9 @@ 'returns': 'ViStatus', 'use_session_lock': False }, - 'WaitForEvent': { + 'WaitForEventWithChannels': { 'documentation': { - 'description': '\nWaits until the device has generated the specified event.\n\nThe session monitors whether each type of event has occurred at least\nonce since the last time this function or the niDCPower_Initiate\nfunction were called. If an event has only been generated once and you\ncall this function successively, the function times out. Individual\nevents must be generated between separate calls of this function.\n', + 'description': '\nWaits until the device has generated the specified event.\n\nThe session monitors whether each type of event has occurred at least\nonce since the last time this function or the niDCPower_InitiateWithChannels\nfunction were called. If an event has only been generated once and you\ncall this function successively, the function times out. Individual\nevents must be generated between separate calls of this function.\n', 'note': "\nRefer to `Supported Functions by\nDevice `__\nfor more information about supported devices.\n" }, 'parameters': [ @@ -2748,6 +2811,11 @@ 'name': 'vi', 'type': 'ViSession' }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, { 'direction': 'in', 'documentation': { @@ -2796,12 +2864,13 @@ 'type_in_documentation': 'hightime.timedelta, datetime.timedelta, or float in seconds' } ], + 'python_name': 'wait_for_event', 'returns': 'ViStatus' }, 'close': { 'codegen_method': 'private', 'documentation': { - 'description': '\nCloses the session specified in **vi** and deallocates the resources\nthat NI-DCPower reserves. If power output is enabled when you call this\nfunction, the output channels remain in their existing state and\ncontinue providing power. Use the niDCPower_ConfigureOutputEnabled\nfunction to disable power output on a per channel basis. Use the\nniDCPower_reset function to disable power output on all channel(s).\n\n**Related Topics:**\n\n`Programming\nStates `__\n' + 'description': '\nCloses the session specified in **vi** and deallocates the resources\nthat NI-DCPower reserves. If power output is enabled when you call this\nfunction, the output channels remain in their existing state and\ncontinue providing power. Use the niDCPower_ConfigureOutputEnabled\nfunction to disable power output on a per channel basis. Use the\nniDCPower_ResetWithChannels function to disable power output on all channel(s).\n\n**Related Topics:**\n\n`Programming\nStates `__\n' }, 'parameters': [ { @@ -2859,7 +2928,7 @@ 'fancy_self_test': { 'codegen_method': 'python-only', 'documentation': { - 'description': '\nPerforms the device self-test routine and returns the test result(s).\nCalling this function implicitly calls the niDCPower_reset function.\n\nWhen calling niDCPower_self_test with the PXIe-4162/4163, specify all\nchannels of your PXIe-4162/4163 with the channels input of\nniDCPower_InitializeWithChannels. You cannot self test a subset of\nPXIe-4162/4163 channels.\n\nRaises `SelfTestError` on self test failure. Attributes on exception object:\n\n- code - failure code from driver\n- message - status message from driver\n', + 'description': '\nPerforms the device self-test routine and returns the test result(s).\nCalling this function implicitly calls the niDCPower_ResetWithChannels function.\n\nWhen calling niDCPower_self_test with the PXIe-4162/4163, specify all\nchannels of your PXIe-4162/4163 with the channels input of\nniDCPower_InitializeWithChannels. You cannot self test a subset of\nPXIe-4162/4163 channels.\n\nRaises `SelfTestError` on self test failure. Attributes on exception object:\n\n- code - failure code from driver\n- message - status message from driver\n', 'table_body': [ [ '0', @@ -2895,26 +2964,10 @@ 'python_name': 'self_test', 'returns': 'ViStatus' }, - 'reset': { - 'documentation': { - 'description': '\nResets the device to a known state. This function disables power\ngeneration, resets session attributes to their default values, commits\nthe session attributes, and leaves the session in the Uncommitted state.\nRefer to the `Programming\nStates `__ topic for\nmore information about NI-DCPower software states.\n' - }, - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': '\nIdentifies a particular instrument session. **vi** is obtained from the\nniDCPower_InitializeWithChannels function.\n' - }, - 'name': 'vi', - 'type': 'ViSession' - } - ], - 'returns': 'ViStatus' - }, 'self_test': { 'codegen_method': 'private', 'documentation': { - 'description': '\nPerforms the device self-test routine and returns the test result(s).\nCalling this function implicitly calls the niDCPower_reset function.\n\nWhen calling niDCPower_self_test with the PXIe-4162/4163, specify all\nchannels of your PXIe-4162/4163 with the channels input of\nniDCPower_InitializeWithChannels. You cannot self test a subset of\nPXIe-4162/4163 channels.\n' + 'description': '\nPerforms the device self-test routine and returns the test result(s).\nCalling this function implicitly calls the niDCPower_ResetWithChannels function.\n\nWhen calling niDCPower_self_test with the PXIe-4162/4163, specify all\nchannels of your PXIe-4162/4163 with the channels input of\nniDCPower_InitializeWithChannels. You cannot self test a subset of\nPXIe-4162/4163 channels.\n' }, 'method_name_for_documentation': 'self_test', 'parameters': [ diff --git a/src/nidcpower/metadata/functions_addon.py b/src/nidcpower/metadata/functions_addon.py index 17c17deb5..cae44f73d 100644 --- a/src/nidcpower/metadata/functions_addon.py +++ b/src/nidcpower/metadata/functions_addon.py @@ -632,7 +632,7 @@ ], 'documentation': { - 'description': '\nCreates an empty advanced sequence. Call the\nniDCPower_CreateAdvancedSequenceStep function to add steps to the\nactive advanced sequence.\n\nYou can create multiple advanced sequences in a session.\n\n**Support for this function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\nUse this function in the Uncommitted or Committed programming states.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nNI-DCPower programming states.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequenceStep\n', + 'description': '\nCreates an empty advanced sequence. Call the\nniDCPower_CreateAdvancedSequenceStepWithChannels function to add steps to the\nactive advanced sequence.\n\nYou can create multiple advanced sequences in a session.\n\n**Support for this function**\n\nYou must set the source mode to Sequence to use this function.\n\nUsing the niDCPower_SetSequence function with Advanced Sequence\nfunctions is unsupported.\n\nUse this function in the Uncommitted or Committed programming states.\nRefer to the `Programming\nStates `__ topic in\nthe *NI DC Power Supplies and SMUs Help* for more information about\nNI-DCPower programming states.\n\n**Related Topics**:\n\n`Advanced Sequence\nMode `__\n\n`Programming\nStates `__\n\nniDCPower_CreateAdvancedSequenceStepWithChannels\n', 'note': "\nThis function is not supported on all devices. Refer to `Supported\nFunctions by\nDevice `__\nfor more information about supported devices.\n" }, }, diff --git a/src/nidcpower/templates/session.py/fancy_advanced_sequence.py.mako b/src/nidcpower/templates/session.py/fancy_advanced_sequence.py.mako index f1e8eb139..4c3c0cf97 100644 --- a/src/nidcpower/templates/session.py/fancy_advanced_sequence.py.mako +++ b/src/nidcpower/templates/session.py/fancy_advanced_sequence.py.mako @@ -24,5 +24,5 @@ raise TypeError('{0} is not a valid property: {1}'.format(prop, type(Session.__base__.__dict__[prop]))) attribute_ids_used.add(Session.__base__.__dict__[prop]._attribute_id) - self._create_advanced_sequence(sequence_name, list(attribute_ids_used), set_as_active_sequence) + self._create_advanced_sequence_with_channels(sequence_name, list(attribute_ids_used), set_as_active_sequence)