diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index 71068b9f0..6739af1b7 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -83,6 +83,7 @@ def _add_buffer_info(parameter): parameter['is_buffer'] = True if (t.find('[ ]') > 0) or (t.find('[]') > 0): + assert 'is_buffer' not in parameter or parameter['is_buffer'] is True, 'Conflicting metadata - [] found but is_buffer already set to False.' parameter['type'] = t.replace('[ ]', '').replace('[]', '') parameter['original_type'] = t parameter['is_buffer'] = True diff --git a/docs/nifgen/functions.rst b/docs/nifgen/functions.rst index 25fe9347d..d6d89d20f 100644 --- a/docs/nifgen/functions.rst +++ b/docs/nifgen/functions.rst @@ -117,235 +117,6 @@ nifgen.Session methods -.. function:: check_attribute_vi_boolean(attribute_id, attribute_value) - - Checks the validity of a value you specify for a ViBoolean attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_boolean(attribute_id, attribute_value) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - :param attribute_value: - - - Specifies the value to which you want to set the attribute. **Default - Value**: None - - - - .. note:: Some of the values might not be valid depending on the current - settings of the instrument session. - - - :type attribute_value: bool - -.. function:: check_attribute_vi_int32(attribute_id, attribute_value) - - Checks the validity of a value you specify for a ViInt32 attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_int32(attribute_id, attribute_value) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - :param attribute_value: - - - Specifies the value to which you want to set the attribute. **Default - Value**: None - - - - .. note:: Some of the values might not be valid depending on the current - settings of the instrument session. - - - :type attribute_value: int - -.. function:: check_attribute_vi_int64(attribute_id, attribute_value) - - Checks the validity of a value you specify for a ViInt64 attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_int64(attribute_id, attribute_value) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - :param attribute_value: - - - Specifies the value to which you want to set the attribute. **Default - Value**: None - - - - .. note:: Some of the values might not be valid depending on the current - settings of the instrument session. - - - :type attribute_value: int - -.. function:: check_attribute_vi_real64(attribute_id, attribute_value) - - Checks the validity of a value you specify for a ViReal64 attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_real64(attribute_id, attribute_value) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - :param attribute_value: - - - Specifies the value to which you want to set the attribute. **Default - Value**: None - - - - .. note:: Some of the values might not be valid depending on the current - settings of the instrument session. - - - :type attribute_value: float - -.. function:: check_attribute_vi_session(attribute_id) - - Checks the validity of a value you specify for a ViSession attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_session(attribute_id) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - -.. function:: check_attribute_vi_string(attribute_id, attribute_value) - - Checks the validity of a value you specify for a ViString attribute. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].check_attribute_vi_string(attribute_id, attribute_value) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - :param attribute_value: - - - Specifies the value which you want to verify as a valid value for the - attribute. - - **Default Value**: None - - - - .. note:: Some of the values might not be valid depending on the current - settings of the instrument session. - - - :type attribute_value: string - .. function:: clear_arb_memory() Removes all previously created arbitrary waveforms, sequences, and @@ -415,7 +186,7 @@ nifgen.Session methods - :py:func:`nifgen.create_waveform_i16` - :py:func:`nifgen.create_waveform_from_file_i16` - :py:func:`nifgen.create_waveform_from_file_f64` - - :py:func:`nifgen.create_waveform_from_file_hws` + - :py:func:`nifgen.CreateWaveformFromFileHWS` **Defined Value**: @@ -507,48 +278,6 @@ nifgen.Session methods -.. function:: configure_amplitude(amplitude) - - Configures the amplitude of the standard waveform that you want the - signal generator to produce. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_amplitude(amplitude) - - - :param amplitude: - - - Specifies the amplitude of the standard waveform that you want the - signal generator to produce. This value is the amplitude at the output - terminal. NI-FGEN sets the :py:data:`nifgen.FUNC\_AMPLITUDE` attribute to - this value. - - For example, to produce a waveform ranging from –5.00 V to +5.00 V, set - the amplitude to 10.00 V. - - **Units**: peak-to-peak voltage - - **Default Value**: None - - - - .. note:: This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` - function to NIFGEN\_VAL\_WFM\_DC. - - - :type amplitude: float - .. function:: configure_arb_sequence(sequence_handle, gain, offset) Configures the signal generator attributes that affect arbitrary @@ -663,7 +392,7 @@ nifgen.Session methods - :py:func:`nifgen.create_waveform_i16` - :py:func:`nifgen.create_waveform_from_file_i16` - :py:func:`nifgen.create_waveform_from_file_f64` - - :py:func:`nifgen.create_waveform_from_file_hws` + - :py:func:`nifgen.CreateWaveformFromFileHWS` These functions return a handle that you use to identify the waveform. @@ -714,75 +443,7 @@ nifgen.Session methods :type offset: float -.. function:: configure_channels(channels) - - Configures the channels to use with the instrument specified in the - **vi** parameter. If you call this function, you must call it - immediately after initializing your session and before configuring - attributes or writing data. - - - - - - :param channels: - - - Specifies the channel on which all subsequent channel-based attributes - in the session are set. Valid values are non-negative integers. For - example, 0 is the only valid value on devices with one channel, while - devices with two channels support values of 0 and 1. You can specify - more than one channel by inserting commas between values (for example, - 0,1). - - - - - :type channels: string - -.. function:: configure_clock_mode(clock_mode) - - Selects the clock mode for the signal generator. - - Some signal generators allow you to switch the Sample Clock to - High-Resolution or Automatic Sampling mode with this function. - - When you select NIFGEN\_VAL\_DIVIDE\_DOWN, NI-FGEN rounds the sample - rate to a frequency that can be achieved by dividing down the board - clock (Sample Clock timebase). However, if you select - NIFGEN\_VAL\_HIGH\_RESOLUTION, you can set the sample rate to any value. - If you select NIFGEN\_VAL\_AUTOMATIC, NI-FGEN selects the clock mode - based on the sample rate, using divide-down sampling when possible. - - - - .. note:: The signal generator must not be in the Generating state when you call - this function. - - - - :param clock_mode: - - - Sets the clock mode of the signal generator. - - ****Defined Values**** - - **Default Value**: NIFGEN\_VAL\_HIGH\_RESOLUTION (NI 5450, NI 5451), - NIFGEN\_VAL\_DIVIDE\_DOWN (all other devices) - - +-------------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_DIVIDE\_DOWN | **Divide down sampling**—Sample rates are generated by dividing the source frequency. | - +-------------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_HIGH\_RESOLUTION | **High resolution sampling**—Sample rate is generated by a high-resolution clock source. | - +-------------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_AUTOMATIC | **Automatic Selection**—NI-FGEN selects between the divide-down and high-resolution clocking modes. | - +-------------------------------+-----------------------------------------------------------------------------------------------------+ - - - :type clock_mode: int - -.. function:: configure_custom_fir_filter_coefficients(number_of_coefficients, coefficients_array) +.. function:: configure_custom_fir_filter_coefficients(coefficients_array) Sets the FIR filter coefficients used by the onboard signal processing block. The values are coerced to the closest settings achievable by the @@ -805,7 +466,7 @@ nifgen.Session methods .. code:: python - session['0,1'].configure_custom_fir_filter_coefficients(number_of_coefficients, coefficients_array) + session['0,1'].configure_custom_fir_filter_coefficients(coefficients_array) :param number_of_coefficients: @@ -832,7 +493,7 @@ nifgen.Session methods :type coefficients_array: list of float -.. function:: configure_digital_edge_script_trigger(trigger_id, source, edge) +.. function:: configure_digital_edge_script_trigger(trigger_id, source, edge=nifgen.ScriptTriggerDigitalEdgeEdge.RISING_EDGE) Configures the specified Script Trigger for digital edge triggering. @@ -924,9 +585,9 @@ nifgen.Session methods +----------------------------+------------------------------------------------------------------+ - :type edge: int + :type edge: :py:data:`nifgen.ScriptTriggerDigitalEdgeEdge` -.. function:: configure_digital_edge_start_trigger(source, edge) +.. function:: configure_digital_edge_start_trigger(source, edge=nifgen.StartTriggerDigitalEdgeEdge.RISING_EDGE) Configures the Start Trigger for digital edge triggering. @@ -997,7 +658,7 @@ nifgen.Session methods +----------------------------+------------------------------------------------------------------+ - :type edge: int + :type edge: :py:data:`nifgen.StartTriggerDigitalEdgeEdge` .. function:: configure_digital_level_script_trigger(trigger_id, source, trigger_when) @@ -1094,7 +755,7 @@ nifgen.Session methods :type trigger_when: int -.. function:: configure_freq_list(frequency_list_handle, amplitude, dc_offset, start_phase) +.. function:: configure_freq_list(frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0) Configures the attributes of the signal generator that affect frequency list generation (the :py:data:`nifgen.FREQ\_LIST\_HANDLE`, @@ -1114,7 +775,7 @@ nifgen.Session methods .. code:: python - session['0,1'].configure_freq_list(frequency_list_handle, amplitude, dc_offset, start_phase) + session['0,1'].configure_freq_list(frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0) :param frequency_list_handle: @@ -1196,13 +857,23 @@ nifgen.Session methods :type start_phase: float -.. function:: configure_frequency(frequency) +.. function:: configure_standard_waveform(waveform, amplitude, start_phase, dc_offset=0.0, frequency=0.0) + + Configures the following attributes of the signal generator that affect + standard waveform generation: - Configures the frequency of the standard waveform that you want the - signal generator to produce. + - :py:data:`nifgen.FUNC\_WAVEFORM` + - :py:data:`nifgen.FUNC\_AMPLITUDE` + - :py:data:`nifgen.FUNC\_DC\_OFFSET` + - :py:data:`nifgen.FUNC\_FREQUENCY` + - :py:data:`nifgen.FUNC\_START\_PHASE` + .. note:: You must call the :py:func:`nifgen.ConfigureOutputMode` function with the + **outputMode** parameter set to NIFGEN\_VAL\_OUTPUT\_FUNC before calling + this function. + .. tip:: This method requires repeated capabilities (usually channels). If called directly on the nifgen.Session object, then the method will use all repeated capabilities in the session. @@ -1211,548 +882,17 @@ nifgen.Session methods .. code:: python - session['0,1'].configure_frequency(frequency) + session['0,1'].configure_standard_waveform(waveform, amplitude, start_phase, dc_offset=0.0, frequency=0.0) - :param frequency: + :param waveform: - | Specifies the frequency of the standard waveform that you want the - signal generator to produce. NI-FGEN sets the - :py:data:`nifgen.FUNC\_FREQUENCY` attribute to this value. + Specifies the standard waveform that you want the signal generator to + produce. NI-FGEN sets the :py:data:`nifgen.FUNC\_WAVEFORM` attribute to this + value. - **Units**: hertz - - **Default Value**: None - - - - .. note:: This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` - function to NIFGEN\_VAL\_WFM\_DC. - - - :type frequency: float - -.. function:: configure_gain(gain) - - Configures the amount of gain to apply to the waveform. - - - - .. note:: The signal generator must not be in the Generating state when you call - this function. - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_gain(gain) - - - :param gain: - - - Specifies the factor by which the signal generator scales the arbitrary - waveforms in the sequence. When you create an arbitrary waveform, you - must first normalize the data points to a range of –1.00 to +1.00. You - can use this parameter to scale the waveform to other ranges. The gain - is applied before the offset is added. - - For example, to configure the output signal to range from –2.00 to - +2.00 V, set **gain** to 2.00. - - **Units**: unitless - - **Default Value**: None - - - - - :type gain: float - -.. function:: configure_operation_mode(operation_mode) - - Determines how the signal generator produces waveforms. NI signal - generators support only Continuous operation mode. To control trigger - mode, use the nifgen\_ConfigureTriggerMode function. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_operation_mode(operation_mode) - - - :param operation_mode: - - - Specifies the operation mode you want the signal generator to use. - NI-FGEN sets the :py:data:`nifgen.OPERATION\_MODE` attribute to this value. - NI-FGEN supports only one value. - - **Defined Value**: NIFGEN\_VAL\_OPERATE\_CONTINUOUS - - - - - :type operation_mode: int - -.. function:: configure_output_enabled(enabled) - - Configures the signal generator to generate a signal at the channel - output connector. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_output_enabled(enabled) - - - :param enabled: - - - Specifies whether you want to enable or disable the output. NI-FGEN uses - this value to set the :py:data:`nifgen.OUTPUT\_ENABLED` attribute. - - ****Defined Values**** - - **Default Value**: VI\_TRUE - - +-----------+---------------------+ - | VI\_TRUE | Enable the output. | - +-----------+---------------------+ - | VI\_FALSE | Disable the output. | - +-----------+---------------------+ - - - :type enabled: bool - -.. function:: configure_output_impedance(impedance) - - Configures the output impedance for the channel you specify. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_output_impedance(impedance) - - - :param impedance: - - - Specifies the impedance value that you want the signal generator to use. - NI-FGEN sets the :py:data:`nifgen.OUTPUT\_IMPEDANCE` attribute to this - value. - - **Units**: Ω (ohms) - - ****Defined Values****: - - **Default Value**: NIFGEN\_VAL\_50\_OHMS - - +-----------------------+------------------------------------------+ - | NIFGEN\_VAL\_50\_OHMS | Specifies that 50 Ω of impedance is used | - +-----------------------+------------------------------------------+ - | NIFGEN\_VAL\_75\_OHMS | Specifies that 75 Ω of impedance is used | - +-----------------------+------------------------------------------+ - - - :type impedance: float - -.. function:: configure_output_mode(output_mode) - - Configures the output mode of the signal generator. The output mode - determines how the signal generator produces waveforms. For example, you - can select to generate a standard waveform, an arbitrary waveform, or a - sequence of arbitrary waveforms. - - - - .. note:: The signal generator must not be in the Generating state when you - call this function. - - - - :param output_mode: - - - Specifies the output mode that you want the signal generator to use. The - value you specify determines which functions and attributes you can use - to configure the waveform the signal generator produces. - Refer to the :py:data:`nifgen.OUTPUT\_MODE` attribute for more information - about setting this parameter. - ****Defined Values**** - **Default Value**: NIFGEN\_VAL\_OUTPUT\_FUNC - - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUTPUT\_FUNC | **Standard Function mode**—Generates standard function waveforms such as sine, square, triangle, and so on. | - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUTPUT\_FREQ\_LIST | **Frequency List mode**—Generates a standard function using a list of frequencies you define. | - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUTPUT\_ARB | **Arbitrary waveform mode**—Generates waveforms from user-created/provided waveform arrays of numeric data. | - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUTPUT\_SEQ | **Arbitrary sequence mode**—Generates downloaded waveforms in an order your specify. | - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUTPUT\_SCRIPT | **Script mode**—Allows you to use scripting to link and loop multiple waveforms in complex combinations. | - +---------------------------------+-------------------------------------------------------------------------------------------------------------+ - - - :type output_mode: int - -.. function:: configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) - - Configures the Start Trigger for to detect peer-to-peer endpoint - fullness. Generation begins when the number of samples in the - peer-to-peer endpoint reaches the threshold indicated by the - **p2pEndpointFullnessLevel** parameter. - - - - .. note:: Because there is an additional internal FIFO in the signal generator, - the writer peer must actually write 2,304 bytes more than the quantity - of data specified by this function to satisfy the trigger level. - - - - :param p2p_endpoint_fullness_level: - - - Specifies the quantity of data in the FIFO endpoint that asserts the - trigger. The value –1 specifies that NI-FGEN uses a default value based - on your endpoint configuration. - - **Units**: samples per channel - - - - - :type p2p_endpoint_fullness_level: int - -.. function:: configure_ref_clock_frequency(reference_clock_frequency) - - Configures the signal generator reference clock frequency. The signal - generator uses the reference clock to derive frequencies and sample - rates when generating waveforms. - - - - .. note:: The signal generator must not be in the Generating state when you - call this function. - - - - :param reference_clock_frequency: - - - The reference clock frequency in Hz. - - **Default Value**: 10000000 - - - - - :type reference_clock_frequency: float - -.. function:: configure_ref_clock_source(reference_clock_source) - - Configures the signal generator reference clock source. The signal - generator uses the reference clock to derive frequencies and sample - rates when generating waveforms. - - - - - - :param reference_clock_source: - - - Specifies the reference clock source that you want the signal generator - to use. NI-FGEN sets the :py:data:`nifgen.REF\_CLOCK\_SOURCE` attribute to - this value. - - The signal generator derives the frequencies and sample rates that it - uses to generate waveforms from the source you specify. - - For example, when you set this parameter to - NIFGEN\_VAL\_REF\_CLOCK\_EXTERNAL, the signal generator uses the signal - it receives at its external clock terminal as the reference clock. - - ****Defined Values**** - - **Default Value**: NIFGEN\_VAL\_REF\_CLOCK\_INTERNAL - - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_INTERNAL | Internal clock source | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_EXTERNAL | External clock source | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_RTSI\_CLOCK | RTSI clock | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_TTL7 | TTL 7 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_PXI\_CLK10 | PXI 10 MHz clock | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_REF\_IN | External clock source | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | RTSI 0 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | RTSI 1 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | RTSI 2 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | RTSI 3 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | RTSI 4 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | RTSI 5 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | RTSI 6 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_RTSI\_7 | RTSI 7 | - +--------------------------------------+------------------------------+ - | NIFGEN\_VAL\_CLK\_IN | CLK IN front panel connector | - +--------------------------------------+------------------------------+ - - - :type reference_clock_source: int - -.. function:: configure_reference_clock(reference_clock_source, reference_clock_frequency) - - Configures the signal generator Reference Clock source and frequency. - The signal generator uses the Reference Clock to tune the Sample Clock - timebase of the signal generator so that the frequency stability and - accuracy of the Sample Clock timebase matches that of the Reference - Clock. - - - - - - :param reference_clock_source: - - - Specifies the source for the Reference Clock. For example, when you set - this parameter to "ClkIn," the signal generator uses the signal it - receives at its CLK IN front panel connector as the Reference Clock. The - Reference Clock phase-locks with the signal generator Sample Clock - timebase to allow the frequency stability and accuracy of the Sample - Clock timebase to match that of the Reference Clock. - ****Defined Values**** - **Default Value**: "None" - - +-------------------------+----------------------------------+ - | "None" | No Reference Clock | - +-------------------------+----------------------------------+ - | "PXI\_Clk" | 10 MHz backplane Reference Clock | - +-------------------------+----------------------------------+ - | "ClkIn" | CLK IN front panel connector | - +-------------------------+----------------------------------+ - | "OnboardReferenceClock" | Onboard Reference Clock | - +-------------------------+----------------------------------+ - | "RTSI7" | RTSI line 7 | - +-------------------------+----------------------------------+ - | "RefIn" | REF IN front panel connector | - +-------------------------+----------------------------------+ - - .. note:: The following **Defined Values** are examples of possible Reference - Clock sources. For a complete list of the Reference Clock sources - available on your device, refer to the Routes topic for your device or - the **Device Routes** tab in MAX. - - - :type reference_clock_source: string - :param reference_clock_frequency: - - - The Reference Clock frequency in hertz. - - **Default Value**: 10000000 - - - - - :type reference_clock_frequency: float - -.. function:: configure_sample_clock_source(sample_clock_source) - - Sets the source of the Sample Clock (Update Clock) of the signal - generator. - - - - - - :param sample_clock_source: - - - Specifies the Sample Clock source the signal generator uses. - ****Defined Values**** - **Default Value**: "OnboardClock" - - +----------------+-----------------------------------+ - | "OnboardClock" | Onboard Clock | - +----------------+-----------------------------------+ - | "ClkIn" | CLK IN front panel connector | - +----------------+-----------------------------------+ - | "PXI\_Star" | PXI star trigger line | - +----------------+-----------------------------------+ - | "PXI\_Trig0" | PXI trigger line 0 or RTSI line 0 | - +----------------+-----------------------------------+ - | "PXI\_Trig1" | PXI trigger line 1 or RTSI line 1 | - +----------------+-----------------------------------+ - | "PXI\_Trig2" | PXI trigger line 2 or RTSI line 2 | - +----------------+-----------------------------------+ - | "PXI\_Trig3" | PXI trigger line 3 or RTSI line 3 | - +----------------+-----------------------------------+ - | "PXI\_Trig4" | PXI trigger line 4 or RTSI line 4 | - +----------------+-----------------------------------+ - | "PXI\_Trig5" | PXI trigger line 5 or RTSI line 5 | - +----------------+-----------------------------------+ - | "PXI\_Trig6" | PXI trigger line 6 or RTSI line 6 | - +----------------+-----------------------------------+ - | "PXI\_Trig7" | PXI trigger line 7 or RTSI line 7 | - +----------------+-----------------------------------+ - | "DDC\_ClkIn" | Sample Clock from DDC connector | - +----------------+-----------------------------------+ - - .. note:: The following **Defined Values** are examples of possible Sample - Clock sources. For a complete list of the Sample Clock sources available - on your device, refer to the Routes topic for your device or the - **Device Routes** tab in MAX. - - - :type sample_clock_source: string - -.. function:: configure_sample_rate(sample_rate) - - Configures the :py:data:`nifgen.ARB\_SAMPLE\_RATE` attribute, which - determines the rate at which the signal generator produces arbitrary - waveforms. When you configure the signal generator to produce an - arbitrary sequence, this value is the sample rate for all arbitrary - waveforms in the sequence. - - - - .. note:: The signal generator must not be in the Generating state when you call - this function. - - - - :param sample_rate: - - - Specifies the sample rate at which you want the signal generator to - generate arbitrary waveforms. NI-FGEN sets the - :py:data:`nifgen.ARB\_SAMPLE\_RATE` attribute to this value. - - **Units**: Samples/s - - **Default Value**: None - - - - - :type sample_rate: float - -.. function:: configure_software_edge_script_trigger(trigger_id) - - Configures the specified Script Trigger for software edge triggering. - - - - - - :param trigger_id: - - - Specifies the Script Trigger used for triggering. - - **Defined Values** - - **Default Value**: "ScriptTrigger0" - - +------------------+------------------+ - | "ScriptTrigger0" | Script Trigger 0 | - +------------------+------------------+ - | "ScriptTrigger1" | Script Trigger 1 | - +------------------+------------------+ - | "ScriptTrigger2" | Script Trigger 2 | - +------------------+------------------+ - | "ScriptTrigger3" | Script Trigger 3 | - +------------------+------------------+ - - - :type trigger_id: string - -.. function:: configure_software_edge_start_trigger() - - Configures the Start Trigger for software edge triggering. - - - - - -.. function:: configure_standard_waveform(waveform, amplitude, dc_offset, frequency, start_phase) - - Configures the following attributes of the signal generator that affect - standard waveform generation: - - - :py:data:`nifgen.FUNC\_WAVEFORM` - - :py:data:`nifgen.FUNC\_AMPLITUDE` - - :py:data:`nifgen.FUNC\_DC\_OFFSET` - - :py:data:`nifgen.FUNC\_FREQUENCY` - - :py:data:`nifgen.FUNC\_START\_PHASE` - - - - .. note:: You must call the :py:func:`nifgen.configure_output_mode` function with the - **outputMode** parameter set to NIFGEN\_VAL\_OUTPUT\_FUNC before calling - this function. - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_standard_waveform(waveform, amplitude, dc_offset, frequency, start_phase) - - - :param waveform: - - - Specifies the standard waveform that you want the signal generator to - produce. NI-FGEN sets the :py:data:`nifgen.FUNC\_WAVEFORM` attribute to this - value. - - ****Defined Values**** + ****Defined Values**** **Default Value**: NIFGEN\_VAL\_WFM\_SINE @@ -1765,350 +905,102 @@ nifgen.Session methods +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | NIFGEN\_VAL\_WFM\_RAMP\_UP | Specifies that the signal generator produces a positive ramp waveform. | +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_WFM\_RAMP\_DOWN | Specifies that the signal generator produces a negative ramp waveform. | - +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_WFM\_DC | Specifies that the signal generator produces a constant voltage. | - +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_WFM\_NOISE | Specifies that the signal generator produces white noise. | - +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_WFM\_USER | Specifies that the signal generator produces a user-defined waveform as defined with the nifgen\_DefineUserStandardWaveform function. | - +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - - - :type waveform: int - :param amplitude: - - - Specifies the amplitude of the standard waveform that you want the - signal generator to produce. This value is the amplitude at the output - terminal. NI-FGEN sets the :py:data:`nifgen.FUNC\_AMPLITUDE` attribute to - this value. - - For example, to produce a waveform ranging from –5.00 V to +5.00 V, set - the amplitude to 10.00 V. - - **Units**: peak-to-peak voltage - - **Default Value**: None - - - - .. note:: This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` - function to NIFGEN\_VAL\_WFM\_DC. - - - :type amplitude: float - :param dc_offset: - - - Specifies the DC offset of the standard waveform that you want the - signal generator to produce. The value is the offset from ground to the - center of the waveform you specify with the **waveform** parameter, - observed at the output terminal. For example, to configure a waveform - with an amplitude of 10.00 V to range from 0.00 V to +10.00 V, set the - **dcOffset** to 5.00 V. NI-FGEN sets the :py:data:`nifgen.FUNC\_DC\_OFFSET` - attribute to this value. - - **Units**: volts - - **Default Value**: None - - - - - :type dc_offset: float - :param frequency: - - - | Specifies the frequency of the standard waveform that you want the - signal generator to produce. NI-FGEN sets the - :py:data:`nifgen.FUNC\_FREQUENCY` attribute to this value. - - **Units**: hertz - - **Default Value**: None - - - - .. note:: This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` - function to NIFGEN\_VAL\_WFM\_DC. - - - :type frequency: float - :param start_phase: - - - Specifies the horizontal offset of the standard waveform that you want - the signal generator to produce. Specify this parameter in degrees of - one waveform cycle. NI-FGEN sets the :py:data:`nifgen.FUNC\_START\_PHASE` - attribute to this value. A start phase of 180 degrees means output - generation begins halfway through the waveform. A start phase of 360 - degrees offsets the output by an entire waveform cycle, which is - identical to a start phase of 0 degrees. - - **Units**: degrees of one cycle - - **Default Value**: 0.00 - - - - .. note:: This parameter does not affect signal generator behavior when you set - the **waveform** parameter to NIFGEN\_VAL\_WFM\_DC. - - - :type start_phase: float - -.. function:: configure_synchronization(synchronization_source) - - Sets the signal generator to receive a synchronization signal to - synchronize two or more NI 5401/5411/5431 signal generators. One signal - generator should route a SYNC signal to a RTSI line by calling the - nifgen\_ExportSignal function (use the nifgen\_RouteSignalOut function - for the NI 5404), and other signal generators should receive the signal - by calling the :py:func:`nifgen.configure_synchronization` function. - - - - .. note:: The signal generator must not be in the Generating state when you call - this function. - Only the NI 5401/5411/5431 signal generators require this function to be - called for proper synchronization. - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].configure_synchronization(synchronization_source) - - - :param synchronization_source: - - - Specify the source of the synchronization signal you want to use. - - ****Defined Values**** - - **Default Value**: NIFGEN\_VAL\_NONE - - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_NONE | Specifies that no synchronization source is used. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | Specifies that RTSI 0 or PXI\_Trig 0 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | Specifies that RTSI 1 or PXI\_Trig 1 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | Specifies that RTSI 2 or PXI\_Trig 2 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | Specifies that RTSI 3 or PXI\_Trig 3 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | Specifies that RTSI 4 or PXI\_Trig 4 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | Specifies that RTSI 5 or PXI\_Trig 5 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | Specifies that RTSI 6 or PXI\_Trig 6 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL0 | Specifies that TTL 0 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL1 | Specifies that TTL 1 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL2 | Specifies that TTL 2 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL3 | Specifies that TTL 3 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL4 | Specifies that TTL 4 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL5 | Specifies that TTL 5 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - | NIFGEN\_VAL\_TTL6 | Specifies that TTL 6 is used as the synchronization source. | - +----------------------+-----------------------------------------------------------------------------+ - - - :type synchronization_source: int - -.. function:: configure_trigger_mode(trigger_mode) - - Sets the trigger mode for your device. Refer to the *Trigger Modes* - topic for your device in the *NI Signal Generators Help* for - descriptions of the specific behavior for supported trigger modes. - - - - .. note:: The signal generator must not be in the Generating state when you call - this function. - In Frequency List output mode, Stepped trigger mode is the same as Burst - trigger mode. + | NIFGEN\_VAL\_WFM\_RAMP\_DOWN | Specifies that the signal generator produces a negative ramp waveform. | + +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + | NIFGEN\_VAL\_WFM\_DC | Specifies that the signal generator produces a constant voltage. | + +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + | NIFGEN\_VAL\_WFM\_NOISE | Specifies that the signal generator produces white noise. | + +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + | NIFGEN\_VAL\_WFM\_USER | Specifies that the signal generator produces a user-defined waveform as defined with the nifgen\_DefineUserStandardWaveform function. | + +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: + :type waveform: int + :param amplitude: - .. code:: python - session['0,1'].configure_trigger_mode(trigger_mode) + Specifies the amplitude of the standard waveform that you want the + signal generator to produce. This value is the amplitude at the output + terminal. NI-FGEN sets the :py:data:`nifgen.FUNC\_AMPLITUDE` attribute to + this value. + For example, to produce a waveform ranging from –5.00 V to +5.00 V, set + the amplitude to 10.00 V. - :param trigger_mode: + **Units**: peak-to-peak voltage + **Default Value**: None - Specifies the trigger mode. + - ****Defined Values**** + .. note:: This parameter does not affect signal generator behavior when you set + the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` + function to NIFGEN\_VAL\_WFM\_DC. - **Default Value**: NIFGEN\_VAL\_CONTINUOUS - +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_SINGLE | The waveform that you describe in the sequence list generates only once by going through the entire staging list. Only one trigger is required to start the waveform generation. You can use Single trigger mode in any output mode. After a trigger is received, the waveform generation starts from the first stage and continues through to the last stage. | - +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_CONTINUOUS | The waveform that you describe in the staging list generates infinitely by repeatedly cycling through the staging list. After a trigger is received, the waveform generation starts from the first stage and continues through to the last stage. After the last stage is completed, the waveform generation loops back to the start of the first stage and continues until it is stopped. Only one trigger is required to start the waveform generation. | - +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_STEPPED | After a Start Trigger is received, the waveform described by the first stage generates. Then, the device waits for the next trigger signal. On the next trigger, the waveform described by the second stage generates, and so on. After the staging list is exhausted, the waveform generation returns to the first stage and continues to repeat the cycle. | - +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_BURST | After a Start Trigger is received, the waveform described by the first stage generates until another trigger is received. At the next trigger, the buffer of the previous stage completes, then the waveform described by the second stage generates. After the staging list is exhausted, the waveform generation returns to the first stage and continues to repeat the cycle. In Frequency List mode, the duration instruction is ignored, and the trigger switches the frequency to the next frequency in the list. | - +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + :type amplitude: float + :param dc_offset: - :type trigger_mode: int + Specifies the DC offset of the standard waveform that you want the + signal generator to produce. The value is the offset from ground to the + center of the waveform you specify with the **waveform** parameter, + observed at the output terminal. For example, to configure a waveform + with an amplitude of 10.00 V to range from 0.00 V to +10.00 V, set the + **dcOffset** to 5.00 V. NI-FGEN sets the :py:data:`nifgen.FUNC\_DC\_OFFSET` + attribute to this value. -.. function:: configure_trigger_source(trigger_source) + **Units**: volts - Configures the trigger source. The signal generator responds to a - trigger depending on the operation mode in which the signal generator is - operating. + **Default Value**: None - + - .. note:: The signal generator must not be in the Generating state when you - call this function. + :type dc_offset: float + :param frequency: - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - .. code:: python + | Specifies the frequency of the standard waveform that you want the + signal generator to produce. NI-FGEN sets the + :py:data:`nifgen.FUNC\_FREQUENCY` attribute to this value. - session['0,1'].configure_trigger_source(trigger_source) + **Units**: hertz + **Default Value**: None - :param trigger_source: + + .. note:: This parameter does not affect signal generator behavior when you set + the **waveform** parameter of the :py:func:`nifgen.configure_standard_waveform` + function to NIFGEN\_VAL\_WFM\_DC. - Controls which trigger source the signal generator uses. - ****Defined Values**** + :type frequency: float + :param start_phase: - **Default Value**: NIFGEN\_VAL\_IMMEDIATE - - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_IMMEDIATE | Immediate | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_EXTERNAL | External (maps to PFI 0) | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_SOFTWARE\_TRIG | Software trigger | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_PXI\_STAR | PXI star | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | RTSI 0 or PXI\_Trig 0 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | RTSI 1 or PXI\_Trig 1 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | RTSI 2 or PXI\_Trig 2 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | RTSI 3 or PXI\_Trig 3 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | RTSI 4 or PXI\_Trig 4 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | RTSI 5 or PXI\_Trig 5 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | RTSI 6 or PXI\_Trig 6 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_RTSI\_7 | RTSI 7 or PXI\_Trig 7 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL0 | TTL 0 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL1 | TTL 1 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL2 | TTL 2 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL3 | TTL 3 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL4 | TTL 4 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL5 | TTL 5 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_TTL6 | TTL 6 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_PFI\_0 | PFI 0 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_PFI\_1 | PFI 1 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_PFI\_2 | PFI 2 | - +-----------------------------+--------------------------+ - | NIFGEN\_VAL\_PFI\_3 | PFI 3 | - +-----------------------------+--------------------------+ - - - :type trigger_source: int - -.. function:: configure_update_clock_source(update_clock_source) - - Sets the source of the update clock of the signal generator. The source - can be internal or external. - + Specifies the horizontal offset of the standard waveform that you want + the signal generator to produce. Specify this parameter in degrees of + one waveform cycle. NI-FGEN sets the :py:data:`nifgen.FUNC\_START\_PHASE` + attribute to this value. A start phase of 180 degrees means output + generation begins halfway through the waveform. A start phase of 360 + degrees offsets the output by an entire waveform cycle, which is + identical to a start phase of 0 degrees. + **Units**: degrees of one cycle + **Default Value**: 0.00 - :param update_clock_source: + + .. note:: This parameter does not affect signal generator behavior when you set + the **waveform** parameter to NIFGEN\_VAL\_WFM\_DC. - Specifies the update clock source. - ****Defined Values**** + :type start_phase: float - **Default Value**: NIFGEN\_VAL\_INTERNAL - - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_INTERNAL | Internal clock source | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_EXTERNAL | External clock source | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_PXI\_STAR | PXI star | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | RTSI 0 or PXI\_Trig 0 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | RTSI 1 or PXI\_Trig 1 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | RTSI 2 or PXI\_Trig 2 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | RTSI 3 or PXI\_Trig 3 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | RTSI 4 or PXI\_Trig 4 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | RTSI 5 or PXI\_Trig 5 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | RTSI 6 or PXI\_Trig 6 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_RTSI\_7 | RTSI 7 or PXI\_Trig 7 | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_CLK\_IN | CLK IN front panel connector | - +---------------------------+---------------------------------+ - | NIFGEN\_VAL\_DDC\_CLK\_IN | Digital Data & Control clock in | - +---------------------------+---------------------------------+ - - - :type update_clock_source: int - -.. function:: create_advanced_arb_sequence(sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array) +.. function:: create_advanced_arb_sequence(waveform_handles_array, loop_counts_array, sample_counts_array=None, marker_location_array=None) Creates an arbitrary sequence from an array of waveform handles and an array of corresponding loop counts. This function returns a handle that @@ -2358,144 +1250,7 @@ nifgen.Session methods -.. function:: create_arb_waveform(waveform_size, waveform_data_array) - - [OBSOLETE] This function is obsolete. Use the nifgen\_CreateWaveformF64, - nifgen\_CreateWaveformI16, or nifgen\_CreateWaveformComplexF64 function - instead of this function. - - Creates an arbitrary waveform and returns a handle that identifies that - waveform. You can pass this handle to the nifgen\_ConfigureArbWaveform - function to produce that waveform. You can also use the handles this - function returns to specify a sequence of arbitrary waveforms with the - nifgen\_CreateArbSequence function. - - - - .. note:: You must scale the data between –1.00 and +1.00. Use the **arbGain** - parameter to generate different output voltages. - - - - :param waveform_size: - - - | Specifies the size of the arbitrary waveform that you want created. - | The size must meet the following restrictions: - - - The size must be less than or equal to the maximum waveform size that - the device allows. - - The size must be greater than or equal to the minimum waveform size - that the device allows. - - The size must be an integer multiple of the device waveform quantum. - - | - | You can obtain these values from the **maximumWaveformSize**, - **minimumWaveformSize**, and **waveformQuantum** parameters in the - nifgen\_QueryArbWfmCapabilities function. - | ****Default Value**:** None - - - - - :type waveform_size: int - :param waveform_data_array: - - - Specifies the array of data you want to use for the new arbitrary - waveform. The array must have at least as many elements as the value - that you specify in **waveformSize**. - - You must normalize the data points in the array to be between –1.00 and - +1.00. - - **Default Value**: None - - - - - :type waveform_data_array: list of float - - :rtype: int - :return: - - - The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - - - - - -.. function:: create_binary16_arb_waveform(waveform_size, waveform_data_array) - - [OBSOLETE] This function is obsolete. Use the nifgen\_CreateWaveformI16 - function instead of this function. - - Creates an arbitrary waveform from binary data and returns a handle that - identifies that waveform. You can pass this handle to the - nifgen\_ConfigureArbWaveform function to produce that waveform. You can - also use the handles this function returns to specify a sequence of - arbitrary waveforms with the nifgen\_CreateArbSequence function. - - - - .. note:: You must set the output mode to NIFGEN\_VAL\_OUTPUT\_ARB or - NIFGEN\_VAL\_OUTPUT\_SEQ before calling this function. - - - - :param waveform_size: - - - | Specifies the size of the arbitrary waveform that you want created. - | The size must meet the following restrictions: - - - The size must be less than or equal to the maximum waveform size that - the device allows. - - The size must be greater than or equal to the minimum waveform size - that the device allows. - - The size must be an integer multiple of the device waveform quantum. - - | - | You can obtain these values from the **maximumWaveformSize**, - **minimumWaveformSize**, and **waveformQuantum** parameters in - nifgen\_QueryArbWfmCapabilities. - | ****Default Value**:** None - - - - - :type waveform_size: int - :param waveform_data_array: - - - Specifies the array of data you want to use for the new arbitrary - waveform. The array must have at least as many elements as the value - that you specify in **waveformSize**. - - You must normalize the data points in the array to be between –32768 and - 32767. - - **Default Value**: None - - - - - :type waveform_data_array: list of int - - :rtype: int - :return: - - - The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - - - - - -.. function:: create_freq_list(waveform, frequency_list_length, frequency_array, duration_array) +.. function:: create_freq_list(waveform, frequency_array, duration_array) Creates a frequency list from an array of frequencies (**frequencyArray**) and an array of durations (**durationArray**). The @@ -2547,7 +1302,7 @@ nifgen.Session methods +------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - :type waveform: int + :type waveform: :py:data:`nifgen.Waveform` :param frequency_list_length: @@ -2614,7 +1369,7 @@ nifgen.Session methods -.. function:: create_waveform_f64(waveform_size, waveform_data_array) +.. function:: create_waveform_f64(waveform_data_array) Creates an onboard waveform from binary F64 (floating point double) data for use in Arbitrary Waveform output mode or Arbitrary Sequence output @@ -2636,7 +1391,7 @@ nifgen.Session methods .. code:: python - session['0,1'].create_waveform_f64(waveform_size, waveform_data_array) + session['0,1'].create_waveform_f64(waveform_data_array) :param waveform_size: @@ -2715,137 +1470,39 @@ nifgen.Session methods session['0,1'].create_waveform_from_file_f64(file_name, byte_order) - :param file_name: - - - The full path and name of the file where the waveform data resides. - - - - - :type file_name: string - :param byte_order: - - - Specifies the byte order of the data in the file. - - ****Defined Values**** - - | - | ****Default Value**:** NIFGEN\_VAL\_LITTLE\_ENDIAN - - +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_LITTLE\_ENDIAN | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | - +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_BIG\_ENDIAN | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | - +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ - - .. note:: Data written by most applications in Windows (including - LabWindows™/CVI™) is in Little Endian format. Data written to a file - from LabVIEW is in Big Endian format by default on all platforms. Big - Endian and Little Endian refer to the way data is stored in memory, - which can differ on different processors. - - - :type byte_order: int - - :rtype: int - :return: - - - The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - - - - - -.. function:: create_waveform_from_file_hws(file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform) - - | Takes the waveform data from the specified HWS (Hierarchical Waveform - Storage) file and creates an onboard waveform for use in Arbitrary - Waveform or Arbitrary Sequence output mode. The **waveformHandle** - returned by this function can be used later for setting the active - waveform, changing the data in the waveform, building sequences of - waveforms, or deleting the waveform when it is no longer needed. - | When the Analog Waveform Editor saves data in an HWS file, it also - stores the rate, gain, and offset with the data. If the - **useRateFromWaveform** and **useGain&OffsetFromWaveform;** parameters - are set to VI\_TRUE, this function also sets those properties. - - | - - - - .. note:: If you choose to have this function set the gain and offset properties - for you, you should **not** use the :py:func:`nifgen.configure_arb_waveform` or - :py:func:`nifgen.configure_arb_sequence` functions, as they also set the gain and - offset, thereby overriding the values set by this function. Instead, use - the :py:data:`nifgen.ARB\_WAVEFORM\_HANDLE` or - :py:data:`nifgen.ARB\_SEQUENCE\_HANDLE` attributes. - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].create_waveform_from_file_hws(file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform) - - - :param file_name: - - - The full path and name of the file where the waveform data resides. - - - - - :type file_name: string - :param use_rate_from_waveform: - - - | If you set this parameter input to VI\_TRUE and if onboard signal - processing (OSP) is enabled, the rate from the waveform is interpreted - as the data rate, and FGEN sets the data rate attribute for you. In - all other cases, it is interpreted as the sample rate, and FGEN sets - the sample rate attribute for you. + :param file_name: - ****Defined Values**** - | - | ****Default Value**:** VI\_TRUE + The full path and name of the file where the waveform data resides. - +-----------+--------------------------------+ - | VI\_TRUE | Use rate from waveform. | - +-----------+--------------------------------+ - | VI\_FALSE | Do not use rate from waveform. | - +-----------+--------------------------------+ + - :type use_rate_from_waveform: bool - :param use_gain_and_offset_from_waveform: + :type file_name: string + :param byte_order: - | If this input is set to VI\_TRUE, NI-FGEN retrieves the gain and - offset values from the specified HWS file and applies them to the - NI-FGEN driver. + Specifies the byte order of the data in the file. ****Defined Values**** | - | ****Default Value**:** VI\_TRUE + | ****Default Value**:** NIFGEN\_VAL\_LITTLE\_ENDIAN + + +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + | NIFGEN\_VAL\_LITTLE\_ENDIAN | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | + +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + | NIFGEN\_VAL\_BIG\_ENDIAN | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | + +-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ - +-----------+-------------------------------------------+ - | VI\_TRUE | Use gain and offset from waveform. | - +-----------+-------------------------------------------+ - | VI\_FALSE | Do not use gain and offset from waveform. | - +-----------+-------------------------------------------+ + .. note:: Data written by most applications in Windows (including + LabWindows™/CVI™) is in Little Endian format. Data written to a file + from LabVIEW is in Big Endian format by default on all platforms. Big + Endian and Little Endian refer to the way data is stored in memory, + which can differ on different processors. - :type use_gain_and_offset_from_waveform: bool + :type byte_order: :py:data:`nifgen.ByteOrder` :rtype: int :return: @@ -2916,7 +1573,7 @@ nifgen.Session methods which can differ on different processors. - :type byte_order: int + :type byte_order: :py:data:`nifgen.ByteOrder` :rtype: int :return: @@ -2929,7 +1586,7 @@ nifgen.Session methods -.. function:: create_waveform_i16(waveform_size, waveform_data_array) +.. function:: create_waveform_i16(waveform_data_array) Creates an onboard waveform from binary 16-bit signed integer (I16) data for use in Arbitrary Waveform or Arbitrary Sequence output mode. The @@ -2951,7 +1608,7 @@ nifgen.Session methods .. code:: python - session['0,1'].create_waveform_i16(waveform_size, waveform_data_array) + session['0,1'].create_waveform_i16(waveform_data_array) :param waveform_size: @@ -3003,7 +1660,7 @@ nifgen.Session methods -.. function:: define_user_standard_waveform(waveform_size, waveform_data_array) +.. function:: define_user_standard_waveform(waveform_data_array) Defines a user waveform for use in either Standard Function or Frequency List output mode. @@ -3030,7 +1687,7 @@ nifgen.Session methods .. code:: python - session['0,1'].define_user_standard_waveform(waveform_size, waveform_data_array) + session['0,1'].define_user_standard_waveform(waveform_data_array) :param waveform_size: @@ -3129,218 +1786,6 @@ nifgen.Session methods -.. function:: disable_analog_filter() - - Disables the analog filter. This function sets the - :py:data:`nifgen.ANALOG\_FILTER\_ENABLED` attribute to VI\_FALSE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].disable_analog_filter() - - -.. function:: disable_digital_filter() - - Disables the digital filter. This function sets the - :py:data:`nifgen.DIGITAL\_FILTER\_ENABLED` attribute to VI\_FALSE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].disable_digital_filter() - - -.. function:: disable_digital_patterning() - - Disables digital pattern output on the signal generator. This function - sets the :py:data:`nifgen.DIGITAL\_PATTERN\_ENABLED` attribute to VI\_FALSE. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].disable_digital_patterning() - - -.. function:: disable_script_trigger(trigger_id) - - Disables the specified Script Trigger. - - - - - - :param trigger_id: - - - Specifies the Script Trigger used for triggering. - - **Defined Values** - - **Default Value**: "ScriptTrigger0" - - +------------------+------------------+ - | "ScriptTrigger0" | Script Trigger 0 | - +------------------+------------------+ - | "ScriptTrigger1" | Script Trigger 1 | - +------------------+------------------+ - | "ScriptTrigger2" | Script Trigger 2 | - +------------------+------------------+ - | "ScriptTrigger3" | Script Trigger 3 | - +------------------+------------------+ - - - :type trigger_id: string - -.. function:: disable_start_trigger() - - Disables the Start Trigger. - - - - - -.. function:: enable_analog_filter(filter_correction_frequency) - - Configures the analog filter for the device. This function sets the - :py:data:`nifgen.ANALOG\_FILTER\_ENABLED` attribute to VI\_TRUE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].enable_analog_filter(filter_correction_frequency) - - - :param filter_correction_frequency: - - - Specifies the filter correction frequency of the analog filter. On the - NI 5411 and NI 5431, NI-FGEN adjusts signal amplitude to compensate for - the filter attenuation at that frequency. To disable amplitude - correction, set **filterCorrectionFrequency** to 0. For Standard - Function output mode, **filterCorrectionFrequency** typically should be - set to the same value as the frequency of the standard waveform. - - **Units**: hertz - - **Default Value**: 0 - - - - - :type filter_correction_frequency: float - -.. function:: enable_digital_filter() - - Enables the digital filter by setting the - :py:data:`nifgen.DIGITAL\_FILTER\_ENABLED` attribute to VI\_TRUE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].enable_digital_filter() - - -.. function:: enable_digital_patterning() - - Enables digital pattern output on the signal generator. This function - sets the :py:data:`nifgen.DIGITAL\_PATTERN\_ENABLED` attribute to VI\_TRUE. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].enable_digital_patterning() - - -.. function:: error_handler(error_code) - - Converts a status code returned by an NI-FGEN function into a - user-readable string and returns any error elaborations. - - - - - - :param error_code: - - - Specifies the **status** parameter that is returned from any of the - NI-FGEN functions. - - **Default Value**: 0 (VI\_SUCCESS) - - - - - :type error_code: int - - :rtype: string - :return: - - - Returns the error message string read from the instrument error message - queue. - - You must pass a ViChar array with at least 256 bytes. - - - - - .. function:: export_signal(signal, signal_identifier, output_terminal) Routes signals (clocks, triggers, and events) to the output terminal you @@ -3393,7 +1838,7 @@ nifgen.Session methods +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ - :type signal: int + :type signal: :py:data:`nifgen.Signal` :param signal_identifier: @@ -3470,15 +1915,111 @@ nifgen.Session methods | "PXI\_Star" | PXI star trigger line | +-------------------+------------------------------+ - .. note:: The following **Defined Values** are examples of possible output - terminals. For a complete list of the output terminals available on your - device, refer to the Routes topic for your device or the **Device - Routes** tab in MAX. + .. note:: The following **Defined Values** are examples of possible output + terminals. For a complete list of the output terminals available on your + device, refer to the Routes topic for your device or the **Device + Routes** tab in MAX. + + + :type output_terminal: string + +.. function:: get_ext_cal_last_date_and_time() + + Returns the date and time of the last successful external calibration. + The time returned is 24-hour (military) local time; for example, if the + device was calibrated at 2:30 PM, this function returns 14 for the + **hour** parameter and 30 for the **minute** parameter. + + + + + + :rtype: tuple (year, month, day, hour, minute) + + WHERE + + year (int): + + + Specifies the year of the last successful calibration. + + + + + month (int): + + + Specifies the month of the last successful calibration. + + + + + day (int): + + + Specifies the day of the last successful calibration. + + + + + hour (int): + + + Specifies the hour of the last successful calibration. + + + + + minute (int): + + + Specifies the minute of the last successful calibration. + + + + + +.. function:: get_ext_cal_last_temp() + + Returns the temperature at the last successful external calibration. The + temperature is returned in degrees Celsius. + + + + + + :rtype: float + :return: + + + Specifies the temperature at the last successful calibration in degrees + Celsius. + + + + + +.. function:: get_ext_cal_recommended_interval() + + Returns the recommended interval between external calibrations in + months. + + + + + :rtype: int + :return: - :type output_terminal: string -.. function:: get_fir_filter_coefficients(array_size, coefficients_array, number_of_coefficients_read) + Specifies the recommended interval between external calibrations in + months. + + + + + +.. function:: get_fir_filter_coefficients() | Returns the FIR filter coefficients used by the onboard signal processing block. These coefficients are determined by NI-FGEN and @@ -3512,7 +2053,7 @@ nifgen.Session methods .. code:: python - session['0,1'].get_fir_filter_coefficients(array_size, coefficients_array, number_of_coefficients_read) + session['0,1'].get_fir_filter_coefficients() :param array_size: @@ -3524,30 +2065,17 @@ nifgen.Session methods :type array_size: int - :param coefficients_array: - - - Specifies the array of data the onboard signal processor uses for the - FIR filter coefficients. For the NI 5441, provide a symmetric array of - 95 coefficients to this parameter. The array must have at least as many - elements as the value that you specify in the **numberOfCoefficients** - parameter in this function. - The coefficients should range between –1.00 and +1.00. - - - - :type coefficients_array: list of float - :param number_of_coefficients_read: + :rtype: int + :return: - Specifies the array of data containing the number of coefficients you - want to read. + Specifies the array of data containing the number of coefficients you + want to read. - + - :type number_of_coefficients_read: list of int .. function:: get_hardware_state() @@ -3560,7 +2088,7 @@ nifgen.Session methods - :rtype: int + :rtype: :py:data:`nifgen.HardwareState` :return: @@ -3689,198 +2217,6 @@ nifgen.Session methods -.. function:: initialize_analog_output_calibration() - - Sets up the device to start the analog output calibration. - - - - - -.. function:: initialize_cal_adc_calibration() - - Initializes an external calibration session for ADC calibration. For the - NI 5421/5422/5441, ADC calibration involves characterizing the gain and - offset of the onboard ADC. - - - - - -.. function:: initialize_flatness_calibration() - - Initializes an external calibration session to calibrate flatness. - - - - - -.. function:: initialize_oscillator_frequency_calibration() - - Sets up the device to start the VCXO calibration. - - The session handle should be the handle returned by the - nifgen\_InitExtCal function. - - - - - -.. function:: initialize_with_channels(resource_name, reset_device, option_string) - - Creates and returns a new NI-FGEN session to the specified channel of a - waveform generator that is used in all subsequent NI-FGEN function - calls. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].initialize_with_channels(resource_name, reset_device, option_string) - - - :param resource_name: - - - .. caution:: Traditional NI-DAQ and NI-DAQmx device names are not case-sensitive. - However, all IVI names, such as logical names, are case-sensitive. If - you use logical names, driver session names, or virtual names in your - program, you must ensure that the name you use matches the name in the - IVI Configuration Store file exactly, without any variations in the case - of the characters. - - | Specifies the resource name of the device to initialize. - - For Traditional NI-DAQ devices, the syntax is DAQ::\ *n*, where *n* is - the device number assigned by MAX, as shown in Example 1. - - For NI-DAQmx devices, the syntax is just the device name specified in - MAX, as shown in Example 2. Typical default names for NI-DAQmx devices - in MAX are Dev1 or PXI1Slot1. You can rename an NI-DAQmx device by - right-clicking on the name in MAX and entering a new name. - - An alternate syntax for NI-DAQmx devices consists of DAQ::\ *NI-DAQmx - device name*, as shown in Example 3. This naming convention allows for - the use of an NI-DAQmx device in an application that was originally - designed for a Traditional NI-DAQ device. For example, if the - application expects DAQ::1, you can rename the NI-DAQmx device to 1 in - MAX and pass in DAQ::1 for the resource name, as shown in Example 4. - - If you use the DAQ::\ *n* syntax and an NI-DAQmx device name already - exists with that same name, the NI-DAQmx device is matched first. - - You can also pass in the name of an IVI logical name or an IVI virtual - name configured with the IVI Configuration utility, as shown in Example - 5. A logical name identifies a particular virtual instrument. A virtual - name identifies a specific device and specifies the initial settings for - the session. - - +-----------+--------------------------------------+------------------------+---------------------------------+ - | Example # | Device Type | Syntax | Variable | - +===========+======================================+========================+=================================+ - | 1 | Traditional NI-DAQ device | DAQ::\ *1* | (*1* = device number) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 2 | NI-DAQmx device | *myDAQmxDevice* | (*myDAQmxDevice* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 3 | NI-DAQmx device | DAQ::\ *myDAQmxDevice* | (*myDAQmxDevice* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 4 | NI-DAQmx device | DAQ::\ *2* | (*2* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 5 | IVI logical name or IVI virtual name | *myLogicalName* | (*myLogicalName* = name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - - - :type resource_name: string - :param reset_device: - - - Specifies whether you want to reset the device during the initialization - procedure. VI\_TRUE specifies that the device is reset and performs the - same function as the nifgen\_Reset function. - - ****Defined Values**** - - **Default Value**: VI\_FALSE - - +-----------+---------------------+ - | VI\_TRUE | Reset device | - +-----------+---------------------+ - | VI\_FALSE | Do not reset device | - +-----------+---------------------+ - - - :type reset_device: bool - :param option_string: - - - Sets the initial value of certain session attributes. - - The syntax for **optionString** is - - <*attributeName*> = <*value*> - - where - - *attributeName* is the name of the attribute and *value* is the value to - which the attribute is set - - To set multiple attributes, separate them with a comma. - - If you pass NULL or an empty string for this parameter, the session uses - the default values for these attributes. You can override the default - values by assigning a value explicitly in a string that you pass for - this parameter. - - You do not have to specify all of the attributes and may leave any of - them out. However, if you do not specify one of the attributes, its - default value is used. - - If simulation is enabled (Simulate=1), you may specify the device that - you want to simulate. To specify a device, enter the following syntax in - **optionString**. - - DriverSetup=Model:<*driver model number*>;Channels:<*channel - names*>;BoardType:<*module type*>;MemorySize:<*size of onboard memory in - bytes*> - - **Syntax Examples** - - **Attributes and **Defined Values**** - - **Default Values**: "Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1" - - +------------------+---------------------------------------------+---------------------+ - | Attribute Name | Attribute | Values | - +==================+=============================================+=====================+ - | RangeCheck | :py:data:`nifgen.RANGE\_CHECK` | VI\_TRUE, VI\_FALSE | - +------------------+---------------------------------------------+---------------------+ - | QueryInstrStatus | :py:data:`nifgen.QUERY\_INSTRUMENT\_STATUS` | VI\_TRUE, VI\_FALSE | - +------------------+---------------------------------------------+---------------------+ - | Cache | :py:data:`nifgen.cache` | VI\_TRUE, VI\_FALSE | - +------------------+---------------------------------------------+---------------------+ - | Simulate | :py:data:`nifgen.simulate` | VI\_TRUE, VI\_FALSE | - +------------------+---------------------------------------------+---------------------+ - - - :type option_string: string - - :rtype: int - :return: - - - Returns a session handle that you can use to identify the device in all - subsequent NI-FGEN function calls. - - - - - .. function:: is_done() Determines whether the current generation is complete. This function @@ -3910,27 +2246,6 @@ nifgen.Session methods -.. function:: manual_enable_p2_p_stream(endpoint_name) - - Enables a peer-to-peer data stream using manual flow control. - - - - - - :param endpoint_name: - - - Specifies the stream endpoint FIFO to configure. Refer to the - `Peer-to-Peer Data - Streaming `__ - documentation in the *NI Signal Generators Help* for more information. - - - - - :type endpoint_name: string - .. function:: query_arb_seq_capabilities() Returns the attributes of the signal generator that are related to @@ -4131,55 +2446,6 @@ nifgen.Session methods -.. function:: read_cal_adc(number_of_reads_to_average, return_calibrated_value) - - Takes one or more voltage measurements from the onboard calibration ADC - and returns the value or the average value. The signal that the ADC - actually measures can be specified using the - :py:data:`nifgen.CAL\_ADC\_INPUT` attribute. The ADC has some inherent gain - and offset. These values can be determined during an external - calibration session and stored in the calibration EEPROM. - - If the **returnCalibratedValue** parameter is VI\_TRUE, NI-FGEN adjusts - the value that is returned to account for the gain and offset of the - ADC. Otherwise, the raw voltage value reported by the ADC is returned. - - - - - - :param number_of_reads_to_average: - - - Specifies the number of measurements to be taken and averaged to - determine the return value. - - - - - :type number_of_reads_to_average: int - :param return_calibrated_value: - - - Specifies whether the voltage returned from the ADC should be adjusted - to account for the gain and offset of the ADC. - - - - - :type return_calibrated_value: bool - - :rtype: float - :return: - - - Specifies the average of the voltage measurements taken from the onboard - calibration ADC. - - - - - .. function:: read_current_temperature() Reads the current onboard temperature of the device. The temperature is @@ -4200,33 +2466,6 @@ nifgen.Session methods -.. function:: reset_attribute(attribute_id) - - Resets the attribute to its default value. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].reset_attribute(attribute_id) - - - :param attribute_id: - - - Specifies the ID of an attribute. - - - - - :type attribute_id: int - .. function:: reset_device() Performs a hard reset on the device. Generation is stopped, all routes @@ -4249,134 +2488,6 @@ nifgen.Session methods -.. function:: route_signal_out(route_signal_from, route_signal_to) - - Routes various signals in the signal generator to the RTSI lines and - front panel terminals. - - +---+----------------------------------------------------------------------------------------------------+ - | | You can clear a previously routed signal by routing NIFGEN\_VAL\_NONE to the destination terminal. | - +---+----------------------------------------------------------------------------------------------------+ - | | You can clear a previously routed signal by routing NIFGEN\_VAL\_NONE to the destination terminal. | - +---+----------------------------------------------------------------------------------------------------+ - - .. note:: The signal generator must not be in the Generating state when you call - this function. - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].route_signal_out(route_signal_from, route_signal_to) - - - :param route_signal_from: - - - Various signals can be routed out the RTSI lines. - - ****Defined Values**** - - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_NONE | Nothing Sending this value clears the line. | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_MARKER | Marker Event | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_SYNC\_OUT | SYNC signal This signal normally appears on the SYNC OUT front panel connector. | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUT\_START\_TRIGGER | Start Trigger The Start Trigger is normally generated at the start of the sequence. Call the nifgen\_ConfigureTriggerSource function to receive this trigger. | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_BOARD\_CLOCK | Signal generator board clock The signal generator board clock is 20 MHz for the NI PCI-5401/5411/5431. The NI PXI-5404 has a 20 MHz board clock, and the NI PXI-5421 has integer divisors of 100 MHz. The NI PXI-5401/5411/5431 does not support routing a Board Clock to RTSI lines or front panel connectors. | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_SYNCHRONIZATION | Synchronization strobe A synchronization strobe is used to guarantee absolute synchronization between two or more signal generators. Call the nifgen\_ConfigureSynchronization function to receive the strobe. | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_SOFTWARE\_TRIG | Software trigger | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_OUT\_UPDATE | — | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_REF\_OUT | Reference Clock out front panel connector | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_PXI\_CLK10 | PXI 10 MHz backplane Reference Clock | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_PXI\_STAR | PXI star trigger line | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_PFI\_0 | PFI 0 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | RTSI 0 or PXI\_Trig 0 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | RTSI 1 or PXI\_Trig 1 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | RTSI 2 or PXI\_Trig 2 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | RTSI 3 or PXI\_Trig 3 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | RTSI 4 or PXI\_Trig 4 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | RTSI 5 or PXI\_Trig 5 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | RTSI 6 or PXI\_Trig 6 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_7 | RTSI 7 or PXI\_Trig 7 | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_RTSI\_CLOCK | RTSI clock | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_ONBOARD\_REFERENCE\_CLOCK | Onboard Reference Clock | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_UPDATE\_CLOCK | Sample Clock | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN\_VAL\_PLL\_REF\_SOURCE | PLL Reference Clock | - +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - - - :type route_signal_from: int - :param route_signal_to: - - - The possible RTSI lines to which you can route a signal. - - ****Defined Values**** - - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_0 | RTSI 0 or PXI\_Trig 0 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_1 | RTSI 1 or PXI\_Trig 1 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_2 | RTSI 2 or PXI\_Trig 2 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_3 | RTSI 3 or PXI\_Trig 3 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_4 | RTSI 4 or PXI\_Trig 4 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_5 | RTSI 5 or PXI\_Trig 5 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_6 | RTSI 6 or PXI\_Trig 6 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_RTSI\_7 | RTSI 7 or PXI\_Trig 7 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_REF\_CLOCK\_RTSI\_CLOCK | RTSI clock | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_REF\_OUT | Reference Clock out front panel connector | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PFI\_0 | PFI 0 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PFI\_1 | PFI 1 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PFI\_4 | PFI 4 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PFI\_5 | PFI 5 | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PXI\_STAR | PXI star trigger line | - +--------------------------------------+-------------------------------------------+ - | NIFGEN\_VAL\_PXI\_CLK10 | PXI 10 MHz backplane Reference Clock | - +--------------------------------------+-------------------------------------------+ - - - :type route_signal_to: int - .. function:: self_cal() Performs a full internal self-calibration on the device. If the @@ -4415,23 +2526,11 @@ nifgen.Session methods +-------------------------------+ - :type trigger: int + :type trigger: :py:data:`nifgen.Trigger` :param trigger_id: :type trigger_id: string -.. function:: send_software_trigger() - - Sends a command to trigger the signal generator. - - - - .. note:: This function can act as an override for an external edge trigger. - However, the NI 5401/5411/5431 do not support overriding an external - digital edge trigger. - - - .. function:: set_named_waveform_next_write_position(waveform_name, relative_to, offset) Sets the position in the waveform to which data is written at the next @@ -4487,7 +2586,7 @@ nifgen.Session methods +----------------------------------------------+-------------------------------------------------------------------------+ - :type relative_to: int + :type relative_to: :py:data:`nifgen.RelativeTo` :param offset: @@ -4555,7 +2654,7 @@ nifgen.Session methods +----------------------------------------------+-------------------------------------------------------------------------+ - :type relative_to: int + :type relative_to: :py:data:`nifgen.RelativeTo` :param offset: @@ -4567,7 +2666,7 @@ nifgen.Session methods :type offset: int -.. function:: wait_until_done(max_time) +.. function:: wait_until_done(max_time=10000) Waits until the device is done generating or until the maximum time has expired. @@ -4586,37 +2685,7 @@ nifgen.Session methods :type max_time: int -.. function:: write_binary16_analog_static_value(value) - - | Writes the 16-bit value to the DAC, which could be output as a DC - Voltage. - | This function writes to the DAC only when in an external calibration - session. - - - - - .. tip:: This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - .. code:: python - - session['0,1'].write_binary16_analog_static_value(value) - - - :param value: - - - The value to write. - - - - - :type value: int - -.. function:: write_binary16_waveform(waveform_handle, size, data) +.. function:: write_binary16_waveform(waveform_handle, data) Writes binary data to the waveform in onboard memory. The waveform handle passed must have been created by a call to the @@ -4641,7 +2710,7 @@ nifgen.Session methods .. code:: python - session['0,1'].write_binary16_waveform(waveform_handle, size, data) + session['0,1'].write_binary16_waveform(waveform_handle, data) :param waveform_handle: @@ -4677,7 +2746,7 @@ nifgen.Session methods :type data: list of int -.. function:: write_named_waveform_f64(waveform_name, size, data) +.. function:: write_named_waveform_f64(waveform_name, data) Writes floating-point data to the waveform in onboard memory. The waveform handle passed in must have been created by a call to the @@ -4709,7 +2778,7 @@ nifgen.Session methods .. code:: python - session['0,1'].write_named_waveform_f64(waveform_name, size, data) + session['0,1'].write_named_waveform_f64(waveform_name, data) :param waveform_name: @@ -4743,7 +2812,7 @@ nifgen.Session methods :type data: list of float -.. function:: write_named_waveform_i16(waveform_name, size, data) +.. function:: write_named_waveform_i16(waveform_name, data) Writes binary data to the named waveform in onboard memory. @@ -4766,7 +2835,7 @@ nifgen.Session methods .. code:: python - session['0,1'].write_named_waveform_i16(waveform_name, size, data) + session['0,1'].write_named_waveform_i16(waveform_name, data) :param waveform_name: @@ -4800,46 +2869,6 @@ nifgen.Session methods :type data: list of int -.. function:: write_p2_p_endpoint_i16(endpoint_name, number_of_samples, endpoint_data) - - Writes I16 data to the peer-to-peer endpoint. Use this function to write - initial data from the host to the endpoint before starting generation to - avoid an underflow at start. - - - - - - :param endpoint_name: - - - Specifies the name of the FIFO endpoint. Data is written to the endpoint - FIFO. - - - - - :type endpoint_name: string - :param number_of_samples: - - - Specifies the number of samples to write into the endpoint FIFO. - - - - - :type number_of_samples: int - :param endpoint_data: - - - Specifies the array of data to write into the endpoint FIFO. The binary - data is left-justified. - - - - - :type endpoint_data: list of int - .. function:: write_script(script) Writes a string containing one or more scripts that govern the @@ -4871,7 +2900,7 @@ nifgen.Session methods :type script: string -.. function:: write_waveform(waveform_handle, size, data) +.. function:: write_waveform(waveform_handle, data) Writes floating-point data to the waveform in onboard memory. The waveform handle passed in must have been created by a call to the @@ -4903,7 +2932,7 @@ nifgen.Session methods .. code:: python - session['0,1'].write_waveform(waveform_handle, size, data) + session['0,1'].write_waveform(waveform_handle, data) :param waveform_handle: diff --git a/docs/nifgen/session.rst b/docs/nifgen/session.rst index a6d064dd6..5db432d40 100644 --- a/docs/nifgen/session.rst +++ b/docs/nifgen/session.rst @@ -435,216 +435,120 @@ nifgen.Session **Public methods** - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | Method | Parameters | - +===========================================================+========================================================================================================+ - | :py:func:`adjust_sample_clock_relative_delay` | adjustment_time | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`allocate_named_waveform` | waveform_name, waveform_size | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`allocate_waveform` | waveform_size | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_boolean` | attribute_id, attribute_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_int32` | attribute_id, attribute_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_int64` | attribute_id, attribute_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_real64` | attribute_id, attribute_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_session` | attribute_id | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`check_attribute_vi_string` | attribute_id, attribute_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`clear_arb_memory` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`clear_arb_sequence` | sequence_handle | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`clear_arb_waveform` | waveform_handle | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`clear_freq_list` | frequency_list_handle | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`clear_user_standard_waveform` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`commit` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_amplitude` | amplitude | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_arb_sequence` | sequence_handle, gain, offset | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_arb_waveform` | waveform_handle, gain, offset | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_channels` | channels | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_clock_mode` | clock_mode | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_custom_fir_filter_coefficients` | number_of_coefficients, coefficients_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_digital_edge_script_trigger` | trigger_id, source, edge | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_digital_edge_start_trigger` | source, edge | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_digital_level_script_trigger` | trigger_id, source, trigger_when | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_freq_list` | frequency_list_handle, amplitude, dc_offset, start_phase | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_frequency` | frequency | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_gain` | gain | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_operation_mode` | operation_mode | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_output_enabled` | enabled | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_output_impedance` | impedance | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_output_mode` | output_mode | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_p2_p_endpoint_fullness_start_trigger` | p2p_endpoint_fullness_level | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_ref_clock_frequency` | reference_clock_frequency | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_ref_clock_source` | reference_clock_source | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_reference_clock` | reference_clock_source, reference_clock_frequency | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_sample_clock_source` | sample_clock_source | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_sample_rate` | sample_rate | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_software_edge_script_trigger` | trigger_id | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_software_edge_start_trigger` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_standard_waveform` | waveform, amplitude, dc_offset, frequency, start_phase | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_synchronization` | synchronization_source | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_trigger_mode` | trigger_mode | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_trigger_source` | trigger_source | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`configure_update_clock_source` | update_clock_source | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_advanced_arb_sequence` | sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_arb_sequence` | sequence_length, waveform_handles_array, loop_counts_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_arb_waveform` | waveform_size, waveform_data_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_binary16_arb_waveform` | waveform_size, waveform_data_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_freq_list` | waveform, frequency_list_length, frequency_array, duration_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_waveform_f64` | waveform_size, waveform_data_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_waveform_from_file_f64` | file_name, byte_order | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_waveform_from_file_hws` | file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_waveform_from_file_i16` | file_name, byte_order | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`create_waveform_i16` | waveform_size, waveform_data_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`define_user_standard_waveform` | waveform_size, waveform_data_array | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`delete_named_waveform` | waveform_name | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`delete_script` | script_name | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable_analog_filter` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable_digital_filter` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable_digital_patterning` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable_script_trigger` | trigger_id | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`disable_start_trigger` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`enable_analog_filter` | filter_correction_frequency | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`enable_digital_filter` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`enable_digital_patterning` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`error_handler` | error_code | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`export_signal` | signal, signal_identifier, output_terminal | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`get_fir_filter_coefficients` | array_size, coefficients_array, number_of_coefficients_read | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`get_hardware_state` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`get_self_cal_last_date_and_time` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`get_self_cal_last_temp` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`get_self_cal_supported` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`initialize_analog_output_calibration` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`initialize_cal_adc_calibration` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`initialize_flatness_calibration` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`initialize_oscillator_frequency_calibration` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`initialize_with_channels` | resource_name, reset_device, option_string | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`is_done` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`manual_enable_p2_p_stream` | endpoint_name | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`query_arb_seq_capabilities` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`query_arb_wfm_capabilities` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`query_freq_list_capabilities` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`read_cal_adc` | number_of_reads_to_average, return_calibrated_value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`read_current_temperature` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`reset_attribute` | attribute_id | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`reset_device` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`reset_with_defaults` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`route_signal_out` | route_signal_from, route_signal_to | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`self_cal` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`send_software_edge_trigger` | trigger, trigger_id | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`send_software_trigger` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`set_named_waveform_next_write_position` | waveform_name, relative_to, offset | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`set_waveform_next_write_position` | waveform_handle, relative_to, offset | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`wait_until_done` | max_time | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_binary16_analog_static_value` | value | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_binary16_waveform` | waveform_handle, size, data | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_named_waveform_f64` | waveform_name, size, data | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_named_waveform_i16` | waveform_name, size, data | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_p2_p_endpoint_i16` | endpoint_name, number_of_samples, endpoint_data | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_script` | script | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`write_waveform` | waveform_handle, size, data | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`reset` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ - | :py:func:`self_test` | | - +-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Method | Parameters | + +=====================================================+=================================================================================================+ + | :py:func:`adjust_sample_clock_relative_delay` | adjustment_time | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`allocate_named_waveform` | waveform_name, waveform_size | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`allocate_waveform` | waveform_size | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`clear_arb_memory` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`clear_arb_sequence` | sequence_handle | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`clear_arb_waveform` | waveform_handle | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`clear_freq_list` | frequency_list_handle | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`clear_user_standard_waveform` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`commit` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_arb_sequence` | sequence_handle, gain, offset | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_arb_waveform` | waveform_handle, gain, offset | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_custom_fir_filter_coefficients` | coefficients_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_digital_edge_script_trigger` | trigger_id, source, edge=nifgen.ScriptTriggerDigitalEdgeEdge.RISING_EDGE | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_digital_edge_start_trigger` | source, edge=nifgen.StartTriggerDigitalEdgeEdge.RISING_EDGE | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_digital_level_script_trigger` | trigger_id, source, trigger_when | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_freq_list` | frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0 | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`configure_standard_waveform` | waveform, amplitude, start_phase, dc_offset=0.0, frequency=0.0 | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_advanced_arb_sequence` | waveform_handles_array, loop_counts_array, sample_counts_array=None, marker_location_array=None | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_arb_sequence` | sequence_length, waveform_handles_array, loop_counts_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_freq_list` | waveform, frequency_array, duration_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_waveform_f64` | waveform_data_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_waveform_from_file_f64` | file_name, byte_order | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_waveform_from_file_i16` | file_name, byte_order | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`create_waveform_i16` | waveform_data_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`define_user_standard_waveform` | waveform_data_array | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`delete_named_waveform` | waveform_name | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`delete_script` | script_name | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`disable` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`export_signal` | signal, signal_identifier, output_terminal | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_ext_cal_last_date_and_time` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_ext_cal_last_temp` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_ext_cal_recommended_interval` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_fir_filter_coefficients` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_hardware_state` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_self_cal_last_date_and_time` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_self_cal_last_temp` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`get_self_cal_supported` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`is_done` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`query_arb_seq_capabilities` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`query_arb_wfm_capabilities` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`query_freq_list_capabilities` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`read_current_temperature` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`reset_device` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`reset_with_defaults` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`self_cal` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`send_software_edge_trigger` | trigger, trigger_id | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`set_named_waveform_next_write_position` | waveform_name, relative_to, offset | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`set_waveform_next_write_position` | waveform_handle, relative_to, offset | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`wait_until_done` | max_time=10000 | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`write_binary16_waveform` | waveform_handle, data | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`write_named_waveform_f64` | waveform_name, data | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`write_named_waveform_i16` | waveform_name, data | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`write_script` | script | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`write_waveform` | waveform_handle, data | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`reset` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | :py:func:`self_test` | | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+ diff --git a/generated/nifgen/library.py b/generated/nifgen/library.py index 44d340f5a..c8df83691 100644 --- a/generated/nifgen/library.py +++ b/generated/nifgen/library.py @@ -20,70 +20,31 @@ def __init__(self, library_name, library_type): self.niFgen_AdjustSampleClockRelativeDelay_cfunc = None self.niFgen_AllocateNamedWaveform_cfunc = None self.niFgen_AllocateWaveform_cfunc = None - self.niFgen_CheckAttributeViBoolean_cfunc = None - self.niFgen_CheckAttributeViInt32_cfunc = None - self.niFgen_CheckAttributeViInt64_cfunc = None - self.niFgen_CheckAttributeViReal64_cfunc = None - self.niFgen_CheckAttributeViSession_cfunc = None - self.niFgen_CheckAttributeViString_cfunc = None self.niFgen_ClearArbMemory_cfunc = None self.niFgen_ClearArbSequence_cfunc = None self.niFgen_ClearArbWaveform_cfunc = None self.niFgen_ClearFreqList_cfunc = None self.niFgen_ClearUserStandardWaveform_cfunc = None self.niFgen_Commit_cfunc = None - self.niFgen_ConfigureAmplitude_cfunc = None self.niFgen_ConfigureArbSequence_cfunc = None self.niFgen_ConfigureArbWaveform_cfunc = None - self.niFgen_ConfigureChannels_cfunc = None - self.niFgen_ConfigureClockMode_cfunc = None self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc = None self.niFgen_ConfigureDigitalEdgeScriptTrigger_cfunc = None self.niFgen_ConfigureDigitalEdgeStartTrigger_cfunc = None self.niFgen_ConfigureDigitalLevelScriptTrigger_cfunc = None self.niFgen_ConfigureFreqList_cfunc = None - self.niFgen_ConfigureFrequency_cfunc = None - self.niFgen_ConfigureGain_cfunc = None - self.niFgen_ConfigureOperationMode_cfunc = None - self.niFgen_ConfigureOutputEnabled_cfunc = None - self.niFgen_ConfigureOutputImpedance_cfunc = None - self.niFgen_ConfigureOutputMode_cfunc = None - self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc = None - self.niFgen_ConfigureRefClockFrequency_cfunc = None - self.niFgen_ConfigureRefClockSource_cfunc = None - self.niFgen_ConfigureReferenceClock_cfunc = None - self.niFgen_ConfigureSampleClockSource_cfunc = None - self.niFgen_ConfigureSampleRate_cfunc = None - self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc = None - self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc = None self.niFgen_ConfigureStandardWaveform_cfunc = None - self.niFgen_ConfigureSynchronization_cfunc = None - self.niFgen_ConfigureTriggerMode_cfunc = None - self.niFgen_ConfigureTriggerSource_cfunc = None - self.niFgen_ConfigureUpdateClockSource_cfunc = None self.niFgen_CreateAdvancedArbSequence_cfunc = None self.niFgen_CreateArbSequence_cfunc = None - self.niFgen_CreateArbWaveform_cfunc = None - self.niFgen_CreateBinary16ArbWaveform_cfunc = None self.niFgen_CreateFreqList_cfunc = None self.niFgen_CreateWaveformF64_cfunc = None self.niFgen_CreateWaveformFromFileF64_cfunc = None - self.niFgen_CreateWaveformFromFileHWS_cfunc = None self.niFgen_CreateWaveformFromFileI16_cfunc = None self.niFgen_CreateWaveformI16_cfunc = None self.niFgen_DefineUserStandardWaveform_cfunc = None self.niFgen_DeleteNamedWaveform_cfunc = None self.niFgen_DeleteScript_cfunc = None self.niFgen_Disable_cfunc = None - self.niFgen_DisableAnalogFilter_cfunc = None - self.niFgen_DisableDigitalFilter_cfunc = None - self.niFgen_DisableDigitalPatterning_cfunc = None - self.niFgen_DisableScriptTrigger_cfunc = None - self.niFgen_DisableStartTrigger_cfunc = None - self.niFgen_EnableAnalogFilter_cfunc = None - self.niFgen_EnableDigitalFilter_cfunc = None - self.niFgen_EnableDigitalPatterning_cfunc = None - self.niFgen_ErrorHandler_cfunc = None self.niFgen_ExportSignal_cfunc = None self.niFgen_GetAttributeViBoolean_cfunc = None self.niFgen_GetAttributeViInt32_cfunc = None @@ -91,32 +52,25 @@ def __init__(self, library_name, library_type): self.niFgen_GetAttributeViReal64_cfunc = None self.niFgen_GetAttributeViString_cfunc = None self.niFgen_GetError_cfunc = None + self.niFgen_GetExtCalLastDateAndTime_cfunc = None + self.niFgen_GetExtCalLastTemp_cfunc = None + self.niFgen_GetExtCalRecommendedInterval_cfunc = None self.niFgen_GetFIRFilterCoefficients_cfunc = None self.niFgen_GetHardwareState_cfunc = None self.niFgen_GetSelfCalLastDateAndTime_cfunc = None self.niFgen_GetSelfCalLastTemp_cfunc = None self.niFgen_GetSelfCalSupported_cfunc = None - self.niFgen_InitWithOptions_cfunc = None - self.niFgen_InitializeAnalogOutputCalibration_cfunc = None - self.niFgen_InitializeCalADCCalibration_cfunc = None - self.niFgen_InitializeFlatnessCalibration_cfunc = None - self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc = None self.niFgen_InitializeWithChannels_cfunc = None self.niFgen_InitiateGeneration_cfunc = None self.niFgen_IsDone_cfunc = None - self.niFgen_ManualEnableP2PStream_cfunc = None self.niFgen_QueryArbSeqCapabilities_cfunc = None self.niFgen_QueryArbWfmCapabilities_cfunc = None self.niFgen_QueryFreqListCapabilities_cfunc = None - self.niFgen_ReadCalADC_cfunc = None self.niFgen_ReadCurrentTemperature_cfunc = None - self.niFgen_ResetAttribute_cfunc = None self.niFgen_ResetDevice_cfunc = None self.niFgen_ResetWithDefaults_cfunc = None - self.niFgen_RouteSignalOut_cfunc = None self.niFgen_SelfCal_cfunc = None self.niFgen_SendSoftwareEdgeTrigger_cfunc = None - self.niFgen_SendSoftwareTrigger_cfunc = None self.niFgen_SetAttributeViBoolean_cfunc = None self.niFgen_SetAttributeViInt32_cfunc = None self.niFgen_SetAttributeViInt64_cfunc = None @@ -125,11 +79,9 @@ def __init__(self, library_name, library_type): self.niFgen_SetNamedWaveformNextWritePosition_cfunc = None self.niFgen_SetWaveformNextWritePosition_cfunc = None self.niFgen_WaitUntilDone_cfunc = None - self.niFgen_WriteBinary16AnalogStaticValue_cfunc = None self.niFgen_WriteBinary16Waveform_cfunc = None self.niFgen_WriteNamedWaveformF64_cfunc = None self.niFgen_WriteNamedWaveformI16_cfunc = None - self.niFgen_WriteP2PEndpointI16_cfunc = None self.niFgen_WriteScript_cfunc = None self.niFgen_WriteWaveform_cfunc = None self.niFgen_close_cfunc = None @@ -175,54 +127,6 @@ def niFgen_AllocateWaveform(self, vi, channel_name, waveform_size, waveform_hand self.niFgen_AllocateWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_AllocateWaveform_cfunc(vi, channel_name, waveform_size, waveform_handle) - def niFgen_CheckAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViBoolean_cfunc is None: - self.niFgen_CheckAttributeViBoolean_cfunc = self._library.niFgen_CheckAttributeViBoolean - self.niFgen_CheckAttributeViBoolean_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViBoolean] # noqa: F405 - self.niFgen_CheckAttributeViBoolean_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViBoolean_cfunc(vi, channel_name, attribute_id, attribute_value) - - def niFgen_CheckAttributeViInt32(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViInt32_cfunc is None: - self.niFgen_CheckAttributeViInt32_cfunc = self._library.niFgen_CheckAttributeViInt32 - self.niFgen_CheckAttributeViInt32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViInt32] # noqa: F405 - self.niFgen_CheckAttributeViInt32_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViInt32_cfunc(vi, channel_name, attribute_id, attribute_value) - - def niFgen_CheckAttributeViInt64(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViInt64_cfunc is None: - self.niFgen_CheckAttributeViInt64_cfunc = self._library.niFgen_CheckAttributeViInt64 - self.niFgen_CheckAttributeViInt64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViInt64] # noqa: F405 - self.niFgen_CheckAttributeViInt64_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViInt64_cfunc(vi, channel_name, attribute_id, attribute_value) - - def niFgen_CheckAttributeViReal64(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViReal64_cfunc is None: - self.niFgen_CheckAttributeViReal64_cfunc = self._library.niFgen_CheckAttributeViReal64 - self.niFgen_CheckAttributeViReal64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViReal64] # noqa: F405 - self.niFgen_CheckAttributeViReal64_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViReal64_cfunc(vi, channel_name, attribute_id, attribute_value) - - def niFgen_CheckAttributeViSession(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViSession_cfunc is None: - self.niFgen_CheckAttributeViSession_cfunc = self._library.niFgen_CheckAttributeViSession - self.niFgen_CheckAttributeViSession_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViSession] # noqa: F405 - self.niFgen_CheckAttributeViSession_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViSession_cfunc(vi, channel_name, attribute_id, attribute_value) - - def niFgen_CheckAttributeViString(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - with self._func_lock: - if self.niFgen_CheckAttributeViString_cfunc is None: - self.niFgen_CheckAttributeViString_cfunc = self._library.niFgen_CheckAttributeViString - self.niFgen_CheckAttributeViString_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_CheckAttributeViString_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CheckAttributeViString_cfunc(vi, channel_name, attribute_id, attribute_value) - def niFgen_ClearArbMemory(self, vi): # noqa: N802 with self._func_lock: if self.niFgen_ClearArbMemory_cfunc is None: @@ -271,14 +175,6 @@ def niFgen_Commit(self, vi): # noqa: N802 self.niFgen_Commit_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_Commit_cfunc(vi) - def niFgen_ConfigureAmplitude(self, vi, channel_name, amplitude): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureAmplitude_cfunc is None: - self.niFgen_ConfigureAmplitude_cfunc = self._library.niFgen_ConfigureAmplitude - self.niFgen_ConfigureAmplitude_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_ConfigureAmplitude_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureAmplitude_cfunc(vi, channel_name, amplitude) - def niFgen_ConfigureArbSequence(self, vi, channel_name, sequence_handle, gain, offset): # noqa: N802 with self._func_lock: if self.niFgen_ConfigureArbSequence_cfunc is None: @@ -295,22 +191,6 @@ def niFgen_ConfigureArbWaveform(self, vi, channel_name, waveform_handle, gain, o self.niFgen_ConfigureArbWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_ConfigureArbWaveform_cfunc(vi, channel_name, waveform_handle, gain, offset) - def niFgen_ConfigureChannels(self, vi, channels): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureChannels_cfunc is None: - self.niFgen_ConfigureChannels_cfunc = self._library.niFgen_ConfigureChannels - self.niFgen_ConfigureChannels_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_ConfigureChannels_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureChannels_cfunc(vi, channels) - - def niFgen_ConfigureClockMode(self, vi, clock_mode): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureClockMode_cfunc is None: - self.niFgen_ConfigureClockMode_cfunc = self._library.niFgen_ConfigureClockMode - self.niFgen_ConfigureClockMode_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niFgen_ConfigureClockMode_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureClockMode_cfunc(vi, clock_mode) - def niFgen_ConfigureCustomFIRFilterCoefficients(self, vi, channel_name, number_of_coefficients, coefficients_array): # noqa: N802 with self._func_lock: if self.niFgen_ConfigureCustomFIRFilterCoefficients_cfunc is None: @@ -351,118 +231,6 @@ def niFgen_ConfigureFreqList(self, vi, channel_name, frequency_list_handle, ampl self.niFgen_ConfigureFreqList_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_ConfigureFreqList_cfunc(vi, channel_name, frequency_list_handle, amplitude, dc_offset, start_phase) - def niFgen_ConfigureFrequency(self, vi, channel_name, frequency): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureFrequency_cfunc is None: - self.niFgen_ConfigureFrequency_cfunc = self._library.niFgen_ConfigureFrequency - self.niFgen_ConfigureFrequency_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_ConfigureFrequency_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureFrequency_cfunc(vi, channel_name, frequency) - - def niFgen_ConfigureGain(self, vi, channel_name, gain): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureGain_cfunc is None: - self.niFgen_ConfigureGain_cfunc = self._library.niFgen_ConfigureGain - self.niFgen_ConfigureGain_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_ConfigureGain_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureGain_cfunc(vi, channel_name, gain) - - def niFgen_ConfigureOperationMode(self, vi, channel_name, operation_mode): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureOperationMode_cfunc is None: - self.niFgen_ConfigureOperationMode_cfunc = self._library.niFgen_ConfigureOperationMode - self.niFgen_ConfigureOperationMode_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32] # noqa: F405 - self.niFgen_ConfigureOperationMode_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureOperationMode_cfunc(vi, channel_name, operation_mode) - - def niFgen_ConfigureOutputEnabled(self, vi, channel_name, enabled): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureOutputEnabled_cfunc is None: - self.niFgen_ConfigureOutputEnabled_cfunc = self._library.niFgen_ConfigureOutputEnabled - self.niFgen_ConfigureOutputEnabled_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViBoolean] # noqa: F405 - self.niFgen_ConfigureOutputEnabled_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureOutputEnabled_cfunc(vi, channel_name, enabled) - - def niFgen_ConfigureOutputImpedance(self, vi, channel_name, impedance): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureOutputImpedance_cfunc is None: - self.niFgen_ConfigureOutputImpedance_cfunc = self._library.niFgen_ConfigureOutputImpedance - self.niFgen_ConfigureOutputImpedance_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_ConfigureOutputImpedance_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureOutputImpedance_cfunc(vi, channel_name, impedance) - - def niFgen_ConfigureOutputMode(self, vi, output_mode): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureOutputMode_cfunc is None: - self.niFgen_ConfigureOutputMode_cfunc = self._library.niFgen_ConfigureOutputMode - self.niFgen_ConfigureOutputMode_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niFgen_ConfigureOutputMode_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureOutputMode_cfunc(vi, output_mode) - - def niFgen_ConfigureP2PEndpointFullnessStartTrigger(self, vi, p2p_endpoint_fullness_level): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc is None: - self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc = self._library.niFgen_ConfigureP2PEndpointFullnessStartTrigger - self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureP2PEndpointFullnessStartTrigger_cfunc(vi, p2p_endpoint_fullness_level) - - def niFgen_ConfigureRefClockFrequency(self, vi, reference_clock_frequency): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureRefClockFrequency_cfunc is None: - self.niFgen_ConfigureRefClockFrequency_cfunc = self._library.niFgen_ConfigureRefClockFrequency - self.niFgen_ConfigureRefClockFrequency_cfunc.argtypes = [ViSession, ViReal64] # noqa: F405 - self.niFgen_ConfigureRefClockFrequency_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureRefClockFrequency_cfunc(vi, reference_clock_frequency) - - def niFgen_ConfigureRefClockSource(self, vi, reference_clock_source): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureRefClockSource_cfunc is None: - self.niFgen_ConfigureRefClockSource_cfunc = self._library.niFgen_ConfigureRefClockSource - self.niFgen_ConfigureRefClockSource_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niFgen_ConfigureRefClockSource_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureRefClockSource_cfunc(vi, reference_clock_source) - - def niFgen_ConfigureReferenceClock(self, vi, reference_clock_source, reference_clock_frequency): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureReferenceClock_cfunc is None: - self.niFgen_ConfigureReferenceClock_cfunc = self._library.niFgen_ConfigureReferenceClock - self.niFgen_ConfigureReferenceClock_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_ConfigureReferenceClock_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureReferenceClock_cfunc(vi, reference_clock_source, reference_clock_frequency) - - def niFgen_ConfigureSampleClockSource(self, vi, sample_clock_source): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureSampleClockSource_cfunc is None: - self.niFgen_ConfigureSampleClockSource_cfunc = self._library.niFgen_ConfigureSampleClockSource - self.niFgen_ConfigureSampleClockSource_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_ConfigureSampleClockSource_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureSampleClockSource_cfunc(vi, sample_clock_source) - - def niFgen_ConfigureSampleRate(self, vi, sample_rate): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureSampleRate_cfunc is None: - self.niFgen_ConfigureSampleRate_cfunc = self._library.niFgen_ConfigureSampleRate - self.niFgen_ConfigureSampleRate_cfunc.argtypes = [ViSession, ViReal64] # noqa: F405 - self.niFgen_ConfigureSampleRate_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureSampleRate_cfunc(vi, sample_rate) - - def niFgen_ConfigureSoftwareEdgeScriptTrigger(self, vi, trigger_id): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc is None: - self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc = self._library.niFgen_ConfigureSoftwareEdgeScriptTrigger - self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureSoftwareEdgeScriptTrigger_cfunc(vi, trigger_id) - - def niFgen_ConfigureSoftwareEdgeStartTrigger(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc is None: - self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc = self._library.niFgen_ConfigureSoftwareEdgeStartTrigger - self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureSoftwareEdgeStartTrigger_cfunc(vi) - def niFgen_ConfigureStandardWaveform(self, vi, channel_name, waveform, amplitude, dc_offset, frequency, start_phase): # noqa: N802 with self._func_lock: if self.niFgen_ConfigureStandardWaveform_cfunc is None: @@ -471,38 +239,6 @@ def niFgen_ConfigureStandardWaveform(self, vi, channel_name, waveform, amplitude self.niFgen_ConfigureStandardWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_ConfigureStandardWaveform_cfunc(vi, channel_name, waveform, amplitude, dc_offset, frequency, start_phase) - def niFgen_ConfigureSynchronization(self, vi, channel_name, synchronization_source): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureSynchronization_cfunc is None: - self.niFgen_ConfigureSynchronization_cfunc = self._library.niFgen_ConfigureSynchronization - self.niFgen_ConfigureSynchronization_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32] # noqa: F405 - self.niFgen_ConfigureSynchronization_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureSynchronization_cfunc(vi, channel_name, synchronization_source) - - def niFgen_ConfigureTriggerMode(self, vi, channel_name, trigger_mode): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureTriggerMode_cfunc is None: - self.niFgen_ConfigureTriggerMode_cfunc = self._library.niFgen_ConfigureTriggerMode - self.niFgen_ConfigureTriggerMode_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32] # noqa: F405 - self.niFgen_ConfigureTriggerMode_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureTriggerMode_cfunc(vi, channel_name, trigger_mode) - - def niFgen_ConfigureTriggerSource(self, vi, channel_name, trigger_source): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureTriggerSource_cfunc is None: - self.niFgen_ConfigureTriggerSource_cfunc = self._library.niFgen_ConfigureTriggerSource - self.niFgen_ConfigureTriggerSource_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32] # noqa: F405 - self.niFgen_ConfigureTriggerSource_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureTriggerSource_cfunc(vi, channel_name, trigger_source) - - def niFgen_ConfigureUpdateClockSource(self, vi, update_clock_source): # noqa: N802 - with self._func_lock: - if self.niFgen_ConfigureUpdateClockSource_cfunc is None: - self.niFgen_ConfigureUpdateClockSource_cfunc = self._library.niFgen_ConfigureUpdateClockSource - self.niFgen_ConfigureUpdateClockSource_cfunc.argtypes = [ViSession, ViInt32] # noqa: F405 - self.niFgen_ConfigureUpdateClockSource_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ConfigureUpdateClockSource_cfunc(vi, update_clock_source) - def niFgen_CreateAdvancedArbSequence(self, vi, sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array, coerced_markers_array, sequence_handle): # noqa: N802 with self._func_lock: if self.niFgen_CreateAdvancedArbSequence_cfunc is None: @@ -519,22 +255,6 @@ def niFgen_CreateArbSequence(self, vi, sequence_length, waveform_handles_array, self.niFgen_CreateArbSequence_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_CreateArbSequence_cfunc(vi, sequence_length, waveform_handles_array, loop_counts_array, sequence_handle) - def niFgen_CreateArbWaveform(self, vi, waveform_size, waveform_data_array, waveform_handle): # noqa: N802 - with self._func_lock: - if self.niFgen_CreateArbWaveform_cfunc is None: - self.niFgen_CreateArbWaveform_cfunc = self._library.niFgen_CreateArbWaveform - self.niFgen_CreateArbWaveform_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ViReal64), ctypes.POINTER(ViInt32)] # noqa: F405 - self.niFgen_CreateArbWaveform_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CreateArbWaveform_cfunc(vi, waveform_size, waveform_data_array, waveform_handle) - - def niFgen_CreateBinary16ArbWaveform(self, vi, waveform_size, waveform_data_array, waveform_handle): # noqa: N802 - with self._func_lock: - if self.niFgen_CreateBinary16ArbWaveform_cfunc is None: - self.niFgen_CreateBinary16ArbWaveform_cfunc = self._library.niFgen_CreateBinary16ArbWaveform - self.niFgen_CreateBinary16ArbWaveform_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ViInt16), ctypes.POINTER(ViInt32)] # noqa: F405 - self.niFgen_CreateBinary16ArbWaveform_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CreateBinary16ArbWaveform_cfunc(vi, waveform_size, waveform_data_array, waveform_handle) - def niFgen_CreateFreqList(self, vi, waveform, frequency_list_length, frequency_array, duration_array, frequency_list_handle): # noqa: N802 with self._func_lock: if self.niFgen_CreateFreqList_cfunc is None: @@ -559,14 +279,6 @@ def niFgen_CreateWaveformFromFileF64(self, vi, channel_name, file_name, byte_ord self.niFgen_CreateWaveformFromFileF64_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_CreateWaveformFromFileF64_cfunc(vi, channel_name, file_name, byte_order, waveform_handle) - def niFgen_CreateWaveformFromFileHWS(self, vi, channel_name, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform, waveform_handle): # noqa: N802 - with self._func_lock: - if self.niFgen_CreateWaveformFromFileHWS_cfunc is None: - self.niFgen_CreateWaveformFromFileHWS_cfunc = self._library.niFgen_CreateWaveformFromFileHWS - self.niFgen_CreateWaveformFromFileHWS_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ctypes.POINTER(ViChar), ViBoolean, ViBoolean, ctypes.POINTER(ViInt32)] # noqa: F405 - self.niFgen_CreateWaveformFromFileHWS_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_CreateWaveformFromFileHWS_cfunc(vi, channel_name, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform, waveform_handle) - def niFgen_CreateWaveformFromFileI16(self, vi, channel_name, file_name, byte_order, waveform_handle): # noqa: N802 with self._func_lock: if self.niFgen_CreateWaveformFromFileI16_cfunc is None: @@ -615,78 +327,6 @@ def niFgen_Disable(self, vi): # noqa: N802 self.niFgen_Disable_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_Disable_cfunc(vi) - def niFgen_DisableAnalogFilter(self, vi, channel_name): # noqa: N802 - with self._func_lock: - if self.niFgen_DisableAnalogFilter_cfunc is None: - self.niFgen_DisableAnalogFilter_cfunc = self._library.niFgen_DisableAnalogFilter - self.niFgen_DisableAnalogFilter_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_DisableAnalogFilter_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_DisableAnalogFilter_cfunc(vi, channel_name) - - def niFgen_DisableDigitalFilter(self, vi, channel_name): # noqa: N802 - with self._func_lock: - if self.niFgen_DisableDigitalFilter_cfunc is None: - self.niFgen_DisableDigitalFilter_cfunc = self._library.niFgen_DisableDigitalFilter - self.niFgen_DisableDigitalFilter_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_DisableDigitalFilter_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_DisableDigitalFilter_cfunc(vi, channel_name) - - def niFgen_DisableDigitalPatterning(self, vi, channel_name): # noqa: N802 - with self._func_lock: - if self.niFgen_DisableDigitalPatterning_cfunc is None: - self.niFgen_DisableDigitalPatterning_cfunc = self._library.niFgen_DisableDigitalPatterning - self.niFgen_DisableDigitalPatterning_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_DisableDigitalPatterning_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_DisableDigitalPatterning_cfunc(vi, channel_name) - - def niFgen_DisableScriptTrigger(self, vi, trigger_id): # noqa: N802 - with self._func_lock: - if self.niFgen_DisableScriptTrigger_cfunc is None: - self.niFgen_DisableScriptTrigger_cfunc = self._library.niFgen_DisableScriptTrigger - self.niFgen_DisableScriptTrigger_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_DisableScriptTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_DisableScriptTrigger_cfunc(vi, trigger_id) - - def niFgen_DisableStartTrigger(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_DisableStartTrigger_cfunc is None: - self.niFgen_DisableStartTrigger_cfunc = self._library.niFgen_DisableStartTrigger - self.niFgen_DisableStartTrigger_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_DisableStartTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_DisableStartTrigger_cfunc(vi) - - def niFgen_EnableAnalogFilter(self, vi, channel_name, filter_correction_frequency): # noqa: N802 - with self._func_lock: - if self.niFgen_EnableAnalogFilter_cfunc is None: - self.niFgen_EnableAnalogFilter_cfunc = self._library.niFgen_EnableAnalogFilter - self.niFgen_EnableAnalogFilter_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64] # noqa: F405 - self.niFgen_EnableAnalogFilter_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_EnableAnalogFilter_cfunc(vi, channel_name, filter_correction_frequency) - - def niFgen_EnableDigitalFilter(self, vi, channel_name): # noqa: N802 - with self._func_lock: - if self.niFgen_EnableDigitalFilter_cfunc is None: - self.niFgen_EnableDigitalFilter_cfunc = self._library.niFgen_EnableDigitalFilter - self.niFgen_EnableDigitalFilter_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_EnableDigitalFilter_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_EnableDigitalFilter_cfunc(vi, channel_name) - - def niFgen_EnableDigitalPatterning(self, vi, channel_name): # noqa: N802 - with self._func_lock: - if self.niFgen_EnableDigitalPatterning_cfunc is None: - self.niFgen_EnableDigitalPatterning_cfunc = self._library.niFgen_EnableDigitalPatterning - self.niFgen_EnableDigitalPatterning_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_EnableDigitalPatterning_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_EnableDigitalPatterning_cfunc(vi, channel_name) - - def niFgen_ErrorHandler(self, vi, error_code, error_message): # noqa: N802 - with self._func_lock: - if self.niFgen_ErrorHandler_cfunc is None: - self.niFgen_ErrorHandler_cfunc = self._library.niFgen_ErrorHandler - self.niFgen_ErrorHandler_cfunc.argtypes = [ViSession, ViStatus, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_ErrorHandler_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ErrorHandler_cfunc(vi, error_code, error_message) - def niFgen_ExportSignal(self, vi, signal, signal_identifier, output_terminal): # noqa: N802 with self._func_lock: if self.niFgen_ExportSignal_cfunc is None: @@ -743,6 +383,30 @@ def niFgen_GetError(self, vi, error_code, error_description_buffer_size, error_d self.niFgen_GetError_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_GetError_cfunc(vi, error_code, error_description_buffer_size, error_description) + def niFgen_GetExtCalLastDateAndTime(self, vi, year, month, day, hour, minute): # noqa: N802 + with self._func_lock: + if self.niFgen_GetExtCalLastDateAndTime_cfunc is None: + self.niFgen_GetExtCalLastDateAndTime_cfunc = self._library.niFgen_GetExtCalLastDateAndTime + self.niFgen_GetExtCalLastDateAndTime_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt32), ctypes.POINTER(ViInt32), ctypes.POINTER(ViInt32), ctypes.POINTER(ViInt32), ctypes.POINTER(ViInt32)] # noqa: F405 + self.niFgen_GetExtCalLastDateAndTime_cfunc.restype = ViStatus # noqa: F405 + return self.niFgen_GetExtCalLastDateAndTime_cfunc(vi, year, month, day, hour, minute) + + def niFgen_GetExtCalLastTemp(self, vi, temperature): # noqa: N802 + with self._func_lock: + if self.niFgen_GetExtCalLastTemp_cfunc is None: + self.niFgen_GetExtCalLastTemp_cfunc = self._library.niFgen_GetExtCalLastTemp + self.niFgen_GetExtCalLastTemp_cfunc.argtypes = [ViSession, ctypes.POINTER(ViReal64)] # noqa: F405 + self.niFgen_GetExtCalLastTemp_cfunc.restype = ViStatus # noqa: F405 + return self.niFgen_GetExtCalLastTemp_cfunc(vi, temperature) + + def niFgen_GetExtCalRecommendedInterval(self, vi, months): # noqa: N802 + with self._func_lock: + if self.niFgen_GetExtCalRecommendedInterval_cfunc is None: + self.niFgen_GetExtCalRecommendedInterval_cfunc = self._library.niFgen_GetExtCalRecommendedInterval + self.niFgen_GetExtCalRecommendedInterval_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt32)] # noqa: F405 + self.niFgen_GetExtCalRecommendedInterval_cfunc.restype = ViStatus # noqa: F405 + return self.niFgen_GetExtCalRecommendedInterval_cfunc(vi, months) + def niFgen_GetFIRFilterCoefficients(self, vi, channel_name, array_size, coefficients_array, number_of_coefficients_read): # noqa: N802 with self._func_lock: if self.niFgen_GetFIRFilterCoefficients_cfunc is None: @@ -783,46 +447,6 @@ def niFgen_GetSelfCalSupported(self, vi, self_cal_supported): # noqa: N802 self.niFgen_GetSelfCalSupported_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_GetSelfCalSupported_cfunc(vi, self_cal_supported) - def niFgen_InitWithOptions(self, resource_name, id_query, reset_device, option_string, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_InitWithOptions_cfunc is None: - self.niFgen_InitWithOptions_cfunc = self._library.niFgen_InitWithOptions - self.niFgen_InitWithOptions_cfunc.argtypes = [ctypes.POINTER(ViChar), ViBoolean, ViBoolean, ctypes.POINTER(ViChar), ctypes.POINTER(ViSession)] # noqa: F405 - self.niFgen_InitWithOptions_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_InitWithOptions_cfunc(resource_name, id_query, reset_device, option_string, vi) - - def niFgen_InitializeAnalogOutputCalibration(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_InitializeAnalogOutputCalibration_cfunc is None: - self.niFgen_InitializeAnalogOutputCalibration_cfunc = self._library.niFgen_InitializeAnalogOutputCalibration - self.niFgen_InitializeAnalogOutputCalibration_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_InitializeAnalogOutputCalibration_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_InitializeAnalogOutputCalibration_cfunc(vi) - - def niFgen_InitializeCalADCCalibration(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_InitializeCalADCCalibration_cfunc is None: - self.niFgen_InitializeCalADCCalibration_cfunc = self._library.niFgen_InitializeCalADCCalibration - self.niFgen_InitializeCalADCCalibration_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_InitializeCalADCCalibration_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_InitializeCalADCCalibration_cfunc(vi) - - def niFgen_InitializeFlatnessCalibration(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_InitializeFlatnessCalibration_cfunc is None: - self.niFgen_InitializeFlatnessCalibration_cfunc = self._library.niFgen_InitializeFlatnessCalibration - self.niFgen_InitializeFlatnessCalibration_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_InitializeFlatnessCalibration_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_InitializeFlatnessCalibration_cfunc(vi) - - def niFgen_InitializeOscillatorFrequencyCalibration(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc is None: - self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc = self._library.niFgen_InitializeOscillatorFrequencyCalibration - self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_InitializeOscillatorFrequencyCalibration_cfunc(vi) - def niFgen_InitializeWithChannels(self, resource_name, channel_name, reset_device, option_string, vi): # noqa: N802 with self._func_lock: if self.niFgen_InitializeWithChannels_cfunc is None: @@ -847,14 +471,6 @@ def niFgen_IsDone(self, vi, done): # noqa: N802 self.niFgen_IsDone_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_IsDone_cfunc(vi, done) - def niFgen_ManualEnableP2PStream(self, vi, endpoint_name): # noqa: N802 - with self._func_lock: - if self.niFgen_ManualEnableP2PStream_cfunc is None: - self.niFgen_ManualEnableP2PStream_cfunc = self._library.niFgen_ManualEnableP2PStream - self.niFgen_ManualEnableP2PStream_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405 - self.niFgen_ManualEnableP2PStream_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ManualEnableP2PStream_cfunc(vi, endpoint_name) - def niFgen_QueryArbSeqCapabilities(self, vi, maximum_number_of_sequences, minimum_sequence_length, maximum_sequence_length, maximum_loop_count): # noqa: N802 with self._func_lock: if self.niFgen_QueryArbSeqCapabilities_cfunc is None: @@ -879,14 +495,6 @@ def niFgen_QueryFreqListCapabilities(self, vi, maximum_number_of_freq_lists, min self.niFgen_QueryFreqListCapabilities_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_QueryFreqListCapabilities_cfunc(vi, maximum_number_of_freq_lists, minimum_frequency_list_length, maximum_frequency_list_length, minimum_frequency_list_duration, maximum_frequency_list_duration, frequency_list_duration_quantum) - def niFgen_ReadCalADC(self, vi, number_of_reads_to_average, return_calibrated_value, cal_adc_value): # noqa: N802 - with self._func_lock: - if self.niFgen_ReadCalADC_cfunc is None: - self.niFgen_ReadCalADC_cfunc = self._library.niFgen_ReadCalADC - self.niFgen_ReadCalADC_cfunc.argtypes = [ViSession, ViInt32, ViBoolean, ctypes.POINTER(ViReal64)] # noqa: F405 - self.niFgen_ReadCalADC_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ReadCalADC_cfunc(vi, number_of_reads_to_average, return_calibrated_value, cal_adc_value) - def niFgen_ReadCurrentTemperature(self, vi, temperature): # noqa: N802 with self._func_lock: if self.niFgen_ReadCurrentTemperature_cfunc is None: @@ -895,14 +503,6 @@ def niFgen_ReadCurrentTemperature(self, vi, temperature): # noqa: N802 self.niFgen_ReadCurrentTemperature_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_ReadCurrentTemperature_cfunc(vi, temperature) - def niFgen_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802 - with self._func_lock: - if self.niFgen_ResetAttribute_cfunc is None: - self.niFgen_ResetAttribute_cfunc = self._library.niFgen_ResetAttribute - self.niFgen_ResetAttribute_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr] # noqa: F405 - self.niFgen_ResetAttribute_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_ResetAttribute_cfunc(vi, channel_name, attribute_id) - def niFgen_ResetDevice(self, vi): # noqa: N802 with self._func_lock: if self.niFgen_ResetDevice_cfunc is None: @@ -919,14 +519,6 @@ def niFgen_ResetWithDefaults(self, vi): # noqa: N802 self.niFgen_ResetWithDefaults_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_ResetWithDefaults_cfunc(vi) - def niFgen_RouteSignalOut(self, vi, channel_name, route_signal_from, route_signal_to): # noqa: N802 - with self._func_lock: - if self.niFgen_RouteSignalOut_cfunc is None: - self.niFgen_RouteSignalOut_cfunc = self._library.niFgen_RouteSignalOut - self.niFgen_RouteSignalOut_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViInt32] # noqa: F405 - self.niFgen_RouteSignalOut_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_RouteSignalOut_cfunc(vi, channel_name, route_signal_from, route_signal_to) - def niFgen_SelfCal(self, vi): # noqa: N802 with self._func_lock: if self.niFgen_SelfCal_cfunc is None: @@ -943,14 +535,6 @@ def niFgen_SendSoftwareEdgeTrigger(self, vi, trigger, trigger_id): # noqa: N802 self.niFgen_SendSoftwareEdgeTrigger_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_SendSoftwareEdgeTrigger_cfunc(vi, trigger, trigger_id) - def niFgen_SendSoftwareTrigger(self, vi): # noqa: N802 - with self._func_lock: - if self.niFgen_SendSoftwareTrigger_cfunc is None: - self.niFgen_SendSoftwareTrigger_cfunc = self._library.niFgen_SendSoftwareTrigger - self.niFgen_SendSoftwareTrigger_cfunc.argtypes = [ViSession] # noqa: F405 - self.niFgen_SendSoftwareTrigger_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_SendSoftwareTrigger_cfunc(vi) - def niFgen_SetAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 with self._func_lock: if self.niFgen_SetAttributeViBoolean_cfunc is None: @@ -1015,14 +599,6 @@ def niFgen_WaitUntilDone(self, vi, max_time): # noqa: N802 self.niFgen_WaitUntilDone_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_WaitUntilDone_cfunc(vi, max_time) - def niFgen_WriteBinary16AnalogStaticValue(self, vi, channel_name, value): # noqa: N802 - with self._func_lock: - if self.niFgen_WriteBinary16AnalogStaticValue_cfunc is None: - self.niFgen_WriteBinary16AnalogStaticValue_cfunc = self._library.niFgen_WriteBinary16AnalogStaticValue - self.niFgen_WriteBinary16AnalogStaticValue_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt16] # noqa: F405 - self.niFgen_WriteBinary16AnalogStaticValue_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_WriteBinary16AnalogStaticValue_cfunc(vi, channel_name, value) - def niFgen_WriteBinary16Waveform(self, vi, channel_name, waveform_handle, size, data): # noqa: N802 with self._func_lock: if self.niFgen_WriteBinary16Waveform_cfunc is None: @@ -1047,14 +623,6 @@ def niFgen_WriteNamedWaveformI16(self, vi, channel_name, waveform_name, size, da self.niFgen_WriteNamedWaveformI16_cfunc.restype = ViStatus # noqa: F405 return self.niFgen_WriteNamedWaveformI16_cfunc(vi, channel_name, waveform_name, size, data) - def niFgen_WriteP2PEndpointI16(self, vi, endpoint_name, number_of_samples, endpoint_data): # noqa: N802 - with self._func_lock: - if self.niFgen_WriteP2PEndpointI16_cfunc is None: - self.niFgen_WriteP2PEndpointI16_cfunc = self._library.niFgen_WriteP2PEndpointI16 - self.niFgen_WriteP2PEndpointI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViInt16)] # noqa: F405 - self.niFgen_WriteP2PEndpointI16_cfunc.restype = ViStatus # noqa: F405 - return self.niFgen_WriteP2PEndpointI16_cfunc(vi, endpoint_name, number_of_samples, endpoint_data) - def niFgen_WriteScript(self, vi, channel_name, script): # noqa: N802 with self._func_lock: if self.niFgen_WriteScript_cfunc is None: diff --git a/generated/nifgen/session.py b/generated/nifgen/session.py index 9ec4cd82b..27b9a298d 100644 --- a/generated/nifgen/session.py +++ b/generated/nifgen/session.py @@ -2165,182 +2165,6 @@ def allocate_waveform(self, waveform_size): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) - def check_attribute_vi_boolean(self, attribute_id, attribute_value): - '''check_attribute_vi_boolean - - Checks the validity of a value you specify for a ViBoolean attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_boolean(attribute_id, attribute_value) - - Args: - attribute_id (int): Specifies the ID of an attribute. - attribute_value (bool): Specifies the value to which you want to set the attribute. **Default - Value**: None - - Note: - Some of the values might not be valid depending on the current - settings of the instrument session. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = visatype.ViBoolean(attribute_value) # case 8 - error_code = self._library.niFgen_CheckAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def check_attribute_vi_int32(self, attribute_id, attribute_value): - '''check_attribute_vi_int32 - - Checks the validity of a value you specify for a ViInt32 attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_int32(attribute_id, attribute_value) - - Args: - attribute_id (int): Specifies the ID of an attribute. - attribute_value (int): Specifies the value to which you want to set the attribute. **Default - Value**: None - - Note: - Some of the values might not be valid depending on the current - settings of the instrument session. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = visatype.ViInt32(attribute_value) # case 8 - error_code = self._library.niFgen_CheckAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def check_attribute_vi_int64(self, attribute_id, attribute_value): - '''check_attribute_vi_int64 - - Checks the validity of a value you specify for a ViInt64 attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_int64(attribute_id, attribute_value) - - Args: - attribute_id (int): Specifies the ID of an attribute. - attribute_value (int): Specifies the value to which you want to set the attribute. **Default - Value**: None - - Note: - Some of the values might not be valid depending on the current - settings of the instrument session. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = visatype.ViInt64(attribute_value) # case 8 - error_code = self._library.niFgen_CheckAttributeViInt64(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def check_attribute_vi_real64(self, attribute_id, attribute_value): - '''check_attribute_vi_real64 - - Checks the validity of a value you specify for a ViReal64 attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_real64(attribute_id, attribute_value) - - Args: - attribute_id (int): Specifies the ID of an attribute. - attribute_value (float): Specifies the value to which you want to set the attribute. **Default - Value**: None - - Note: - Some of the values might not be valid depending on the current - settings of the instrument session. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = visatype.ViReal64(attribute_value) # case 8 - error_code = self._library.niFgen_CheckAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def check_attribute_vi_session(self, attribute_id): - '''check_attribute_vi_session - - Checks the validity of a value you specify for a ViSession attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_session(attribute_id) - - Args: - attribute_id (int): Specifies the ID of an attribute. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = visatype.ViSession(self._attribute_value) # case 1 - error_code = self._library.niFgen_CheckAttributeViSession(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def check_attribute_vi_string(self, attribute_id, attribute_value): - '''check_attribute_vi_string - - Checks the validity of a value you specify for a ViString attribute. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].check_attribute_vi_string(attribute_id, attribute_value) - - Args: - attribute_id (int): Specifies the ID of an attribute. - attribute_value (string): Specifies the value which you want to verify as a valid value for the - attribute. - - **Default Value**: None - - Note: - Some of the values might not be valid depending on the current - settings of the instrument session. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - attribute_value_ctype = ctypes.create_string_buffer(attribute_value.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_CheckAttributeViString(vi_ctype, channel_name_ctype, attribute_id_ctype, attribute_value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def clear_user_standard_waveform(self): '''clear_user_standard_waveform @@ -2361,45 +2185,6 @@ def clear_user_standard_waveform(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_amplitude(self, amplitude): - '''configure_amplitude - - Configures the amplitude of the standard waveform that you want the - signal generator to produce. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_amplitude(amplitude) - - Args: - amplitude (float): Specifies the amplitude of the standard waveform that you want the - signal generator to produce. This value is the amplitude at the output - terminal. NI-FGEN sets the FUNC_AMPLITUDE attribute to - this value. - - For example, to produce a waveform ranging from –5.00 V to +5.00 V, set - the amplitude to 10.00 V. - - **Units**: peak-to-peak voltage - - **Default Value**: None - - Note: - This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the configure_standard_waveform - function to NIFGEN_VAL_WFM_DC. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - amplitude_ctype = visatype.ViReal64(amplitude) # case 8 - error_code = self._library.niFgen_ConfigureAmplitude(vi_ctype, channel_name_ctype, amplitude_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def configure_arb_sequence(self, sequence_handle, gain, offset): '''configure_arb_sequence @@ -2492,7 +2277,7 @@ def configure_arb_waveform(self, waveform_handle, gain, offset): - create_waveform_i16 - create_waveform_from_file_i16 - create_waveform_from_file_f64 - - create_waveform_from_file_hws + - CreateWaveformFromFileHWS These functions return a handle that you use to identify the waveform. @@ -2531,7 +2316,7 @@ def configure_arb_waveform(self, waveform_handle, gain, offset): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_custom_fir_filter_coefficients(self, number_of_coefficients, coefficients_array): + def configure_custom_fir_filter_coefficients(self, coefficients_array): '''configure_custom_fir_filter_coefficients Sets the FIR filter coefficients used by the onboard signal processing @@ -2552,7 +2337,7 @@ def configure_custom_fir_filter_coefficients(self, number_of_coefficients, coeff You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].configure_custom_fir_filter_coefficients(number_of_coefficients, coefficients_array) + session['0,1'].configure_custom_fir_filter_coefficients(coefficients_array) Args: number_of_coefficients (int): Specifies the number of coefficients. The NI 5441 requires 95. @@ -2565,13 +2350,13 @@ def configure_custom_fir_filter_coefficients(self, number_of_coefficients, coeff ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - number_of_coefficients_ctype = visatype.ViInt32(number_of_coefficients) # case 8 + number_of_coefficients_ctype = visatype.ViInt32(len(coefficients_array)) # case 5 coefficients_array_ctype = (visatype.ViReal64 * len(coefficients_array))(*coefficients_array) # case 4 error_code = self._library.niFgen_ConfigureCustomFIRFilterCoefficients(vi_ctype, channel_name_ctype, number_of_coefficients_ctype, coefficients_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_freq_list(self, frequency_list_handle, amplitude, dc_offset, start_phase): + def configure_freq_list(self, frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0): '''configure_freq_list Configures the attributes of the signal generator that affect frequency @@ -2589,7 +2374,7 @@ def configure_freq_list(self, frequency_list_handle, amplitude, dc_offset, start You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].configure_freq_list(frequency_list_handle, amplitude, dc_offset, start_phase) + session['0,1'].configure_freq_list(frequency_list_handle, amplitude, dc_offset=0.0, start_phase=0.0) Args: frequency_list_handle (int): Specifies the handle of the frequency list that you want the signal @@ -2651,181 +2436,7 @@ def configure_freq_list(self, frequency_list_handle, amplitude, dc_offset, start errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_frequency(self, frequency): - '''configure_frequency - - Configures the frequency of the standard waveform that you want the - signal generator to produce. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_frequency(frequency) - - Args: - frequency (float): | Specifies the frequency of the standard waveform that you want the - signal generator to produce. NI-FGEN sets the - FUNC_FREQUENCY attribute to this value. - - **Units**: hertz - - **Default Value**: None - - Note: - This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the configure_standard_waveform - function to NIFGEN_VAL_WFM_DC. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - frequency_ctype = visatype.ViReal64(frequency) # case 8 - error_code = self._library.niFgen_ConfigureFrequency(vi_ctype, channel_name_ctype, frequency_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_gain(self, gain): - '''configure_gain - - Configures the amount of gain to apply to the waveform. - - Note: - The signal generator must not be in the Generating state when you call - this function. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_gain(gain) - - Args: - gain (float): Specifies the factor by which the signal generator scales the arbitrary - waveforms in the sequence. When you create an arbitrary waveform, you - must first normalize the data points to a range of –1.00 to +1.00. You - can use this parameter to scale the waveform to other ranges. The gain - is applied before the offset is added. - - For example, to configure the output signal to range from –2.00 to - +2.00 V, set **gain** to 2.00. - - **Units**: unitless - - **Default Value**: None - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - gain_ctype = visatype.ViReal64(gain) # case 8 - error_code = self._library.niFgen_ConfigureGain(vi_ctype, channel_name_ctype, gain_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_operation_mode(self, operation_mode): - '''configure_operation_mode - - Determines how the signal generator produces waveforms. NI signal - generators support only Continuous operation mode. To control trigger - mode, use the nifgen_ConfigureTriggerMode function. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_operation_mode(operation_mode) - - Args: - operation_mode (int): Specifies the operation mode you want the signal generator to use. - NI-FGEN sets the OPERATION_MODE attribute to this value. - NI-FGEN supports only one value. - - **Defined Value**: NIFGEN_VAL_OPERATE_CONTINUOUS - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - operation_mode_ctype = visatype.ViInt32(operation_mode) # case 8 - error_code = self._library.niFgen_ConfigureOperationMode(vi_ctype, channel_name_ctype, operation_mode_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_output_enabled(self, enabled): - '''configure_output_enabled - - Configures the signal generator to generate a signal at the channel - output connector. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_output_enabled(enabled) - - Args: - enabled (bool): Specifies whether you want to enable or disable the output. NI-FGEN uses - this value to set the OUTPUT_ENABLED attribute. - - ****Defined Values**** - - **Default Value**: VI_TRUE - - +----------+---------------------+ - | VI_TRUE | Enable the output. | - +----------+---------------------+ - | VI_FALSE | Disable the output. | - +----------+---------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - enabled_ctype = visatype.ViBoolean(enabled) # case 8 - error_code = self._library.niFgen_ConfigureOutputEnabled(vi_ctype, channel_name_ctype, enabled_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_output_impedance(self, impedance): - '''configure_output_impedance - - Configures the output impedance for the channel you specify. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_output_impedance(impedance) - - Args: - impedance (float): Specifies the impedance value that you want the signal generator to use. - NI-FGEN sets the OUTPUT_IMPEDANCE attribute to this - value. - - **Units**: Ω (ohms) - - ****Defined Values****: - - **Default Value**: NIFGEN_VAL_50_OHMS - - +--------------------+------------------------------------------+ - | NIFGEN_VAL_50_OHMS | Specifies that 50 Ω of impedance is used | - +--------------------+------------------------------------------+ - | NIFGEN_VAL_75_OHMS | Specifies that 75 Ω of impedance is used | - +--------------------+------------------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - impedance_ctype = visatype.ViReal64(impedance) # case 8 - error_code = self._library.niFgen_ConfigureOutputImpedance(vi_ctype, channel_name_ctype, impedance_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_standard_waveform(self, waveform, amplitude, dc_offset, frequency, start_phase): + def configure_standard_waveform(self, waveform, amplitude, start_phase, dc_offset=0.0, frequency=0.0): '''configure_standard_waveform Configures the following attributes of the signal generator that affect @@ -2838,7 +2449,7 @@ def configure_standard_waveform(self, waveform, amplitude, dc_offset, frequency, - FUNC_START_PHASE Note: - You must call the configure_output_mode function with the + You must call the ConfigureOutputMode function with the **outputMode** parameter set to NIFGEN_VAL_OUTPUT_FUNC before calling this function. @@ -2848,7 +2459,7 @@ def configure_standard_waveform(self, waveform, amplitude, dc_offset, frequency, You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].configure_standard_waveform(waveform, amplitude, dc_offset, frequency, start_phase) + session['0,1'].configure_standard_waveform(waveform, amplitude, start_phase, dc_offset=0.0, frequency=0.0) Args: waveform (int): Specifies the standard waveform that you want the signal generator to @@ -2909,236 +2520,40 @@ def configure_standard_waveform(self, waveform, amplitude, dc_offset, frequency, **Units**: hertz - **Default Value**: None - - Note: - This parameter does not affect signal generator behavior when you set - the **waveform** parameter of the configure_standard_waveform - function to NIFGEN_VAL_WFM_DC. - start_phase (float): Specifies the horizontal offset of the standard waveform that you want - the signal generator to produce. Specify this parameter in degrees of - one waveform cycle. NI-FGEN sets the FUNC_START_PHASE - attribute to this value. A start phase of 180 degrees means output - generation begins halfway through the waveform. A start phase of 360 - degrees offsets the output by an entire waveform cycle, which is - identical to a start phase of 0 degrees. - - **Units**: degrees of one cycle - - **Default Value**: 0.00 - - Note: - This parameter does not affect signal generator behavior when you set - the **waveform** parameter to NIFGEN_VAL_WFM_DC. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - waveform_ctype = visatype.ViInt32(waveform) # case 8 - amplitude_ctype = visatype.ViReal64(amplitude) # case 8 - dc_offset_ctype = visatype.ViReal64(dc_offset) # case 8 - frequency_ctype = visatype.ViReal64(frequency) # case 8 - start_phase_ctype = visatype.ViReal64(start_phase) # case 8 - error_code = self._library.niFgen_ConfigureStandardWaveform(vi_ctype, channel_name_ctype, waveform_ctype, amplitude_ctype, dc_offset_ctype, frequency_ctype, start_phase_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_synchronization(self, synchronization_source): - '''configure_synchronization - - Sets the signal generator to receive a synchronization signal to - synchronize two or more NI 5401/5411/5431 signal generators. One signal - generator should route a SYNC signal to a RTSI line by calling the - nifgen_ExportSignal function (use the nifgen_RouteSignalOut function - for the NI 5404), and other signal generators should receive the signal - by calling the configure_synchronization function. - - Note: - The signal generator must not be in the Generating state when you call - this function. - Only the NI 5401/5411/5431 signal generators require this function to be - called for proper synchronization. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_synchronization(synchronization_source) - - Args: - synchronization_source (int): Specify the source of the synchronization signal you want to use. - - ****Defined Values**** - - **Default Value**: NIFGEN_VAL_NONE - - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_NONE | Specifies that no synchronization source is used. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_0 | Specifies that RTSI 0 or PXI_Trig 0 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_1 | Specifies that RTSI 1 or PXI_Trig 1 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_2 | Specifies that RTSI 2 or PXI_Trig 2 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_3 | Specifies that RTSI 3 or PXI_Trig 3 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_4 | Specifies that RTSI 4 or PXI_Trig 4 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_5 | Specifies that RTSI 5 or PXI_Trig 5 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_6 | Specifies that RTSI 6 or PXI_Trig 6 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL0 | Specifies that TTL 0 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL1 | Specifies that TTL 1 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL2 | Specifies that TTL 2 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL3 | Specifies that TTL 3 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL4 | Specifies that TTL 4 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL5 | Specifies that TTL 5 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - | NIFGEN_VAL_TTL6 | Specifies that TTL 6 is used as the synchronization source. | - +-------------------+----------------------------------------------------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - synchronization_source_ctype = visatype.ViInt32(synchronization_source) # case 8 - error_code = self._library.niFgen_ConfigureSynchronization(vi_ctype, channel_name_ctype, synchronization_source_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_trigger_mode(self, trigger_mode): - '''configure_trigger_mode - - Sets the trigger mode for your device. Refer to the *Trigger Modes* - topic for your device in the *NI Signal Generators Help* for - descriptions of the specific behavior for supported trigger modes. - - Note: - The signal generator must not be in the Generating state when you call - this function. - In Frequency List output mode, Stepped trigger mode is the same as Burst - trigger mode. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].configure_trigger_mode(trigger_mode) - - Args: - trigger_mode (int): Specifies the trigger mode. - - ****Defined Values**** - - **Default Value**: NIFGEN_VAL_CONTINUOUS - - +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_SINGLE | The waveform that you describe in the sequence list generates only once by going through the entire staging list. Only one trigger is required to start the waveform generation. You can use Single trigger mode in any output mode. After a trigger is received, the waveform generation starts from the first stage and continues through to the last stage. | - +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_CONTINUOUS | The waveform that you describe in the staging list generates infinitely by repeatedly cycling through the staging list. After a trigger is received, the waveform generation starts from the first stage and continues through to the last stage. After the last stage is completed, the waveform generation loops back to the start of the first stage and continues until it is stopped. Only one trigger is required to start the waveform generation. | - +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_STEPPED | After a Start Trigger is received, the waveform described by the first stage generates. Then, the device waits for the next trigger signal. On the next trigger, the waveform described by the second stage generates, and so on. After the staging list is exhausted, the waveform generation returns to the first stage and continues to repeat the cycle. | - +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_BURST | After a Start Trigger is received, the waveform described by the first stage generates until another trigger is received. At the next trigger, the buffer of the previous stage completes, then the waveform described by the second stage generates. After the staging list is exhausted, the waveform generation returns to the first stage and continues to repeat the cycle. In Frequency List mode, the duration instruction is ignored, and the trigger switches the frequency to the next frequency in the list. | - +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - trigger_mode_ctype = visatype.ViInt32(trigger_mode) # case 8 - error_code = self._library.niFgen_ConfigureTriggerMode(vi_ctype, channel_name_ctype, trigger_mode_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_trigger_source(self, trigger_source): - '''configure_trigger_source - - Configures the trigger source. The signal generator responds to a - trigger depending on the operation mode in which the signal generator is - operating. - - Note: - The signal generator must not be in the Generating state when you - call this function. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: + **Default Value**: None - session['0,1'].configure_trigger_source(trigger_source) + Note: + This parameter does not affect signal generator behavior when you set + the **waveform** parameter of the configure_standard_waveform + function to NIFGEN_VAL_WFM_DC. + start_phase (float): Specifies the horizontal offset of the standard waveform that you want + the signal generator to produce. Specify this parameter in degrees of + one waveform cycle. NI-FGEN sets the FUNC_START_PHASE + attribute to this value. A start phase of 180 degrees means output + generation begins halfway through the waveform. A start phase of 360 + degrees offsets the output by an entire waveform cycle, which is + identical to a start phase of 0 degrees. - Args: - trigger_source (int): Controls which trigger source the signal generator uses. + **Units**: degrees of one cycle - ****Defined Values**** + **Default Value**: 0.00 - **Default Value**: NIFGEN_VAL_IMMEDIATE - - +--------------------------+--------------------------+ - | NIFGEN_VAL_IMMEDIATE | Immediate | - +--------------------------+--------------------------+ - | NIFGEN_VAL_EXTERNAL | External (maps to PFI 0) | - +--------------------------+--------------------------+ - | NIFGEN_VAL_SOFTWARE_TRIG | Software trigger | - +--------------------------+--------------------------+ - | NIFGEN_VAL_PXI_STAR | PXI star | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_0 | RTSI 0 or PXI_Trig 0 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_1 | RTSI 1 or PXI_Trig 1 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_2 | RTSI 2 or PXI_Trig 2 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_3 | RTSI 3 or PXI_Trig 3 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_4 | RTSI 4 or PXI_Trig 4 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_5 | RTSI 5 or PXI_Trig 5 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_6 | RTSI 6 or PXI_Trig 6 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_RTSI_7 | RTSI 7 or PXI_Trig 7 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL0 | TTL 0 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL1 | TTL 1 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL2 | TTL 2 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL3 | TTL 3 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL4 | TTL 4 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL5 | TTL 5 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_TTL6 | TTL 6 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_PFI_0 | PFI 0 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_PFI_1 | PFI 1 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_PFI_2 | PFI 2 | - +--------------------------+--------------------------+ - | NIFGEN_VAL_PFI_3 | PFI 3 | - +--------------------------+--------------------------+ + Note: + This parameter does not affect signal generator behavior when you set + the **waveform** parameter to NIFGEN_VAL_WFM_DC. ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - trigger_source_ctype = visatype.ViInt32(trigger_source) # case 8 - error_code = self._library.niFgen_ConfigureTriggerSource(vi_ctype, channel_name_ctype, trigger_source_ctype) + waveform_ctype = visatype.ViInt32(waveform) # case 8 + amplitude_ctype = visatype.ViReal64(amplitude) # case 8 + dc_offset_ctype = visatype.ViReal64(dc_offset) # case 8 + frequency_ctype = visatype.ViReal64(frequency) # case 8 + start_phase_ctype = visatype.ViReal64(start_phase) # case 8 + error_code = self._library.niFgen_ConfigureStandardWaveform(vi_ctype, channel_name_ctype, waveform_ctype, amplitude_ctype, dc_offset_ctype, frequency_ctype, start_phase_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def create_waveform_f64(self, waveform_size, waveform_data_array): + def create_waveform_f64(self, waveform_data_array): '''create_waveform_f64 Creates an onboard waveform from binary F64 (floating point double) data @@ -3158,7 +2573,7 @@ def create_waveform_f64(self, waveform_size, waveform_data_array): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].create_waveform_f64(waveform_size, waveform_data_array) + session['0,1'].create_waveform_f64(waveform_data_array) Args: waveform_size (int): | Specifies the size of the arbitrary waveform that you want to create. @@ -3190,7 +2605,7 @@ def create_waveform_f64(self, waveform_size, waveform_data_array): ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - waveform_size_ctype = visatype.ViInt32(waveform_size) # case 8 + waveform_size_ctype = visatype.ViInt32(len(waveform_data_array)) # case 5 waveform_data_array_ctype = (visatype.ViReal64 * len(waveform_data_array))(*waveform_data_array) # case 4 waveform_handle_ctype = visatype.ViInt32() # case 13 error_code = self._library.niFgen_CreateWaveformF64(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype, ctypes.pointer(waveform_handle_ctype)) @@ -3222,7 +2637,7 @@ def create_waveform_from_file_f64(self, file_name, byte_order): Args: file_name (string): The full path and name of the file where the waveform data resides. - byte_order (int): Specifies the byte order of the data in the file. + byte_order (enums.ByteOrder): Specifies the byte order of the data in the file. ****Defined Values**** @@ -3246,94 +2661,17 @@ def create_waveform_from_file_f64(self, file_name, byte_order): waveform_handle (int): The handle that identifies the new waveform. This handle is used later when referring to this waveform. ''' + if type(byte_order) is not enums.ByteOrder: + raise TypeError('Parameter mode must be of type ' + str(enums.ByteOrder)) vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding)) # case 3 - byte_order_ctype = visatype.ViInt32(byte_order) # case 8 + byte_order_ctype = visatype.ViInt32(byte_order.value) # case 9 waveform_handle_ctype = visatype.ViInt32() # case 13 error_code = self._library.niFgen_CreateWaveformFromFileF64(vi_ctype, channel_name_ctype, file_name_ctype, byte_order_ctype, ctypes.pointer(waveform_handle_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) - def create_waveform_from_file_hws(self, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform): - '''create_waveform_from_file_hws - - | Takes the waveform data from the specified HWS (Hierarchical Waveform - Storage) file and creates an onboard waveform for use in Arbitrary - Waveform or Arbitrary Sequence output mode. The **waveformHandle** - returned by this function can be used later for setting the active - waveform, changing the data in the waveform, building sequences of - waveforms, or deleting the waveform when it is no longer needed. - | When the Analog Waveform Editor saves data in an HWS file, it also - stores the rate, gain, and offset with the data. If the - **useRateFromWaveform** and **useGain&OffsetFromWaveform;** parameters - are set to VI_TRUE, this function also sets those properties. - - | - - Note: - If you choose to have this function set the gain and offset properties - for you, you should **not** use the configure_arb_waveform or - configure_arb_sequence functions, as they also set the gain and - offset, thereby overriding the values set by this function. Instead, use - the ARB_WAVEFORM_HANDLE or - ARB_SEQUENCE_HANDLE attributes. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].create_waveform_from_file_hws(file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform) - - Args: - file_name (string): The full path and name of the file where the waveform data resides. - use_rate_from_waveform (bool): | If you set this parameter input to VI_TRUE and if onboard signal - processing (OSP) is enabled, the rate from the waveform is interpreted - as the data rate, and FGEN sets the data rate attribute for you. In - all other cases, it is interpreted as the sample rate, and FGEN sets - the sample rate attribute for you. - - ****Defined Values**** - - | - | ****Default Value**:** VI_TRUE - - +----------+--------------------------------+ - | VI_TRUE | Use rate from waveform. | - +----------+--------------------------------+ - | VI_FALSE | Do not use rate from waveform. | - +----------+--------------------------------+ - use_gain_and_offset_from_waveform (bool): | If this input is set to VI_TRUE, NI-FGEN retrieves the gain and - offset values from the specified HWS file and applies them to the - NI-FGEN driver. - - ****Defined Values**** - - | - | ****Default Value**:** VI_TRUE - - +----------+-------------------------------------------+ - | VI_TRUE | Use gain and offset from waveform. | - +----------+-------------------------------------------+ - | VI_FALSE | Do not use gain and offset from waveform. | - +----------+-------------------------------------------+ - - Returns: - waveform_handle (int): The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding)) # case 3 - use_rate_from_waveform_ctype = visatype.ViBoolean(use_rate_from_waveform) # case 8 - use_gain_and_offset_from_waveform_ctype = visatype.ViBoolean(use_gain_and_offset_from_waveform) # case 8 - waveform_handle_ctype = visatype.ViInt32() # case 13 - error_code = self._library.niFgen_CreateWaveformFromFileHWS(vi_ctype, channel_name_ctype, file_name_ctype, use_rate_from_waveform_ctype, use_gain_and_offset_from_waveform_ctype, ctypes.pointer(waveform_handle_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(waveform_handle_ctype.value) - def create_waveform_from_file_i16(self, file_name, byte_order): '''create_waveform_from_file_i16 @@ -3359,7 +2697,7 @@ def create_waveform_from_file_i16(self, file_name, byte_order): Args: file_name (string): The full path and name of the file where the waveform data resides. - byte_order (int): Specifies the byte order of the data in the file. + byte_order (enums.ByteOrder): Specifies the byte order of the data in the file. ****Defined Values**** @@ -3383,16 +2721,18 @@ def create_waveform_from_file_i16(self, file_name, byte_order): waveform_handle (int): The handle that identifies the new waveform. This handle is used later when referring to this waveform. ''' + if type(byte_order) is not enums.ByteOrder: + raise TypeError('Parameter mode must be of type ' + str(enums.ByteOrder)) vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding)) # case 3 - byte_order_ctype = visatype.ViInt32(byte_order) # case 8 + byte_order_ctype = visatype.ViInt32(byte_order.value) # case 9 waveform_handle_ctype = visatype.ViInt32() # case 13 error_code = self._library.niFgen_CreateWaveformFromFileI16(vi_ctype, channel_name_ctype, file_name_ctype, byte_order_ctype, ctypes.pointer(waveform_handle_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) - def create_waveform_i16(self, waveform_size, waveform_data_array): + def create_waveform_i16(self, waveform_data_array): '''create_waveform_i16 Creates an onboard waveform from binary 16-bit signed integer (I16) data @@ -3412,7 +2752,7 @@ def create_waveform_i16(self, waveform_size, waveform_data_array): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].create_waveform_i16(waveform_size, waveform_data_array) + session['0,1'].create_waveform_i16(waveform_data_array) Args: waveform_size (int): | Specifies the size of the arbitrary waveform that you want to create. @@ -3443,14 +2783,14 @@ def create_waveform_i16(self, waveform_size, waveform_data_array): ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - waveform_size_ctype = visatype.ViInt32(waveform_size) # case 8 + waveform_size_ctype = visatype.ViInt32(len(waveform_data_array)) # case 5 waveform_data_array_ctype = (visatype.ViInt16 * len(waveform_data_array))(*waveform_data_array) # case 4 waveform_handle_ctype = visatype.ViInt32() # case 13 error_code = self._library.niFgen_CreateWaveformI16(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype, ctypes.pointer(waveform_handle_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) - def define_user_standard_waveform(self, waveform_size, waveform_data_array): + def define_user_standard_waveform(self, waveform_data_array): '''define_user_standard_waveform Defines a user waveform for use in either Standard Function or Frequency @@ -3475,7 +2815,7 @@ def define_user_standard_waveform(self, waveform_size, waveform_data_array): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].define_user_standard_waveform(waveform_size, waveform_data_array) + session['0,1'].define_user_standard_waveform(waveform_data_array) Args: waveform_size (int): Specifies the size of the waveform in samples. @@ -3491,7 +2831,7 @@ def define_user_standard_waveform(self, waveform_size, waveform_data_array): ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - waveform_size_ctype = visatype.ViInt32(waveform_size) # case 8 + waveform_size_ctype = visatype.ViInt32(len(waveform_data_array)) # case 5 waveform_data_array_ctype = (visatype.ViReal64 * len(waveform_data_array))(*waveform_data_array) # case 4 error_code = self._library.niFgen_DefineUserStandardWaveform(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -3549,151 +2889,6 @@ def delete_script(self, script_name): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def disable_analog_filter(self): - '''disable_analog_filter - - Disables the analog filter. This function sets the - ANALOG_FILTER_ENABLED attribute to VI_FALSE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].disable_analog_filter() - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - error_code = self._library.niFgen_DisableAnalogFilter(vi_ctype, channel_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def disable_digital_filter(self): - '''disable_digital_filter - - Disables the digital filter. This function sets the - DIGITAL_FILTER_ENABLED attribute to VI_FALSE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].disable_digital_filter() - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - error_code = self._library.niFgen_DisableDigitalFilter(vi_ctype, channel_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def disable_digital_patterning(self): - '''disable_digital_patterning - - Disables digital pattern output on the signal generator. This function - sets the DIGITAL_PATTERN_ENABLED attribute to VI_FALSE. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].disable_digital_patterning() - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - error_code = self._library.niFgen_DisableDigitalPatterning(vi_ctype, channel_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def enable_analog_filter(self, filter_correction_frequency): - '''enable_analog_filter - - Configures the analog filter for the device. This function sets the - ANALOG_FILTER_ENABLED attribute to VI_TRUE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].enable_analog_filter(filter_correction_frequency) - - Args: - filter_correction_frequency (float): Specifies the filter correction frequency of the analog filter. On the - NI 5411 and NI 5431, NI-FGEN adjusts signal amplitude to compensate for - the filter attenuation at that frequency. To disable amplitude - correction, set **filterCorrectionFrequency** to 0. For Standard - Function output mode, **filterCorrectionFrequency** typically should be - set to the same value as the frequency of the standard waveform. - - **Units**: hertz - - **Default Value**: 0 - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - filter_correction_frequency_ctype = visatype.ViReal64(filter_correction_frequency) # case 8 - error_code = self._library.niFgen_EnableAnalogFilter(vi_ctype, channel_name_ctype, filter_correction_frequency_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def enable_digital_filter(self): - '''enable_digital_filter - - Enables the digital filter by setting the - DIGITAL_FILTER_ENABLED attribute to VI_TRUE. This - setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or - Script output modes. You also can use this setting in Standard Function - and Frequency List output modes for user-defined waveforms. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].enable_digital_filter() - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - error_code = self._library.niFgen_EnableDigitalFilter(vi_ctype, channel_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def enable_digital_patterning(self): - '''enable_digital_patterning - - Enables digital pattern output on the signal generator. This function - sets the DIGITAL_PATTERN_ENABLED attribute to VI_TRUE. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].enable_digital_patterning() - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - error_code = self._library.niFgen_EnableDigitalPatterning(vi_ctype, channel_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def _get_attribute_vi_boolean(self, attribute_id): '''_get_attribute_vi_boolean @@ -3958,7 +3153,7 @@ def _get_error(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) return int(error_code_ctype.value), error_description_ctype.value.decode(self._encoding) - def get_fir_filter_coefficients(self, array_size, coefficients_array, number_of_coefficients_read): + def get_fir_filter_coefficients(self): '''get_fir_filter_coefficients | Returns the FIR filter coefficients used by the onboard signal @@ -3989,30 +3184,30 @@ def get_fir_filter_coefficients(self, array_size, coefficients_array, number_of_ You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].get_fir_filter_coefficients(array_size, coefficients_array, number_of_coefficients_read) + session['0,1'].get_fir_filter_coefficients() Args: array_size (int): Specifies the size of the coefficient array - coefficients_array (list of float): Specifies the array of data the onboard signal processor uses for the - FIR filter coefficients. For the NI 5441, provide a symmetric array of - 95 coefficients to this parameter. The array must have at least as many - elements as the value that you specify in the **numberOfCoefficients** - parameter in this function. - The coefficients should range between –1.00 and +1.00. - number_of_coefficients_read (list of int): Specifies the array of data containing the number of coefficients you + + Returns: + number_of_coefficients_read (int): Specifies the array of data containing the number of coefficients you want to read. ''' vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - array_size_ctype = visatype.ViInt32(array_size) # case 8 - coefficients_array_ctype = (visatype.ViReal64 * len(coefficients_array))(*coefficients_array) # case 4 - number_of_coefficients_read_ctype = (visatype.ViInt32 * len(number_of_coefficients_read))(*number_of_coefficients_read) # case 4 - error_code = self._library.niFgen_GetFIRFilterCoefficients(vi_ctype, channel_name_ctype, array_size_ctype, coefficients_array_ctype, number_of_coefficients_read_ctype) + array_size_ctype = visatype.ViInt32() # case 6 + coefficients_array_ctype = None # case 11 + number_of_coefficients_read_ctype = visatype.ViInt32() # case 13 + error_code = self._library.niFgen_GetFIRFilterCoefficients(vi_ctype, channel_name_ctype, array_size_ctype, coefficients_array_ctype, ctypes.pointer(number_of_coefficients_read_ctype)) + errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) + array_size_ctype = visatype.ViInt32(error_code) # TODO(marcoskirsch): use get_ctype_variable_declaration_snippet() + coefficients_array_ctype = (visatype.ViReal64 * array_size_ctype.value)() # TODO(marcoskirsch): use get_ctype_variable_declaration_snippet() + error_code = self._library.niFgen_GetFIRFilterCoefficients(vi_ctype, channel_name_ctype, array_size_ctype, coefficients_array_ctype, ctypes.pointer(number_of_coefficients_read_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + return [float(coefficients_array_ctype[i]) for i in range(array_size_ctype.value)], int(number_of_coefficients_read_ctype.value) - def initialize_with_channels(self, resource_name, reset_device, option_string): - '''initialize_with_channels + def _initialize_with_channels(self, resource_name, reset_device=False, option_string=''): + '''_initialize_with_channels Creates and returns a new NI-FGEN session to the specified channel of a waveform generator that is used in all subsequent NI-FGEN function @@ -4024,7 +3219,7 @@ def initialize_with_channels(self, resource_name, reset_device, option_string): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].initialize_with_channels(resource_name, reset_device, option_string) + session['0,1']._initialize_with_channels(resource_name, reset_device=False, option_string='') Args: resource_name (string): Caution: @@ -4148,153 +3343,6 @@ def initialize_with_channels(self, resource_name, reset_device, option_string): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) - def reset_attribute(self, attribute_id): - '''reset_attribute - - Resets the attribute to its default value. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].reset_attribute(attribute_id) - - Args: - attribute_id (int): Specifies the ID of an attribute. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - attribute_id_ctype = visatype.ViAttr(attribute_id) # case 8 - error_code = self._library.niFgen_ResetAttribute(vi_ctype, channel_name_ctype, attribute_id_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def route_signal_out(self, route_signal_from, route_signal_to): - '''route_signal_out - - Routes various signals in the signal generator to the RTSI lines and - front panel terminals. - - +---+--------------------------------------------------------------------------------------------------+ - | | You can clear a previously routed signal by routing NIFGEN_VAL_NONE to the destination terminal. | - +---+--------------------------------------------------------------------------------------------------+ - | | You can clear a previously routed signal by routing NIFGEN_VAL_NONE to the destination terminal. | - +---+--------------------------------------------------------------------------------------------------+ - - Note: - The signal generator must not be in the Generating state when you call - this function. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].route_signal_out(route_signal_from, route_signal_to) - - Args: - route_signal_from (int): Various signals can be routed out the RTSI lines. - - ****Defined Values**** - - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_NONE | Nothing Sending this value clears the line. | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_MARKER | Marker Event | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_SYNC_OUT | SYNC signal This signal normally appears on the SYNC OUT front panel connector. | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUT_START_TRIGGER | Start Trigger The Start Trigger is normally generated at the start of the sequence. Call the nifgen_ConfigureTriggerSource function to receive this trigger. | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_BOARD_CLOCK | Signal generator board clock The signal generator board clock is 20 MHz for the NI PCI-5401/5411/5431. The NI PXI-5404 has a 20 MHz board clock, and the NI PXI-5421 has integer divisors of 100 MHz. The NI PXI-5401/5411/5431 does not support routing a Board Clock to RTSI lines or front panel connectors. | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_SYNCHRONIZATION | Synchronization strobe A synchronization strobe is used to guarantee absolute synchronization between two or more signal generators. Call the nifgen_ConfigureSynchronization function to receive the strobe. | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_SOFTWARE_TRIG | Software trigger | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUT_UPDATE | — | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_REF_OUT | Reference Clock out front panel connector | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_PXI_CLK10 | PXI 10 MHz backplane Reference Clock | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_PXI_STAR | PXI star trigger line | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_PFI_0 | PFI 0 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_0 | RTSI 0 or PXI_Trig 0 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_1 | RTSI 1 or PXI_Trig 1 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_2 | RTSI 2 or PXI_Trig 2 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_3 | RTSI 3 or PXI_Trig 3 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_4 | RTSI 4 or PXI_Trig 4 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_5 | RTSI 5 or PXI_Trig 5 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_6 | RTSI 6 or PXI_Trig 6 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_RTSI_7 | RTSI 7 or PXI_Trig 7 | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_REF_CLOCK_RTSI_CLOCK | RTSI clock | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_ONBOARD_REFERENCE_CLOCK | Onboard Reference Clock | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_UPDATE_CLOCK | Sample Clock | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_PLL_REF_SOURCE | PLL Reference Clock | - +------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - route_signal_to (int): The possible RTSI lines to which you can route a signal. - - ****Defined Values**** - - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_0 | RTSI 0 or PXI_Trig 0 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_1 | RTSI 1 or PXI_Trig 1 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_2 | RTSI 2 or PXI_Trig 2 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_3 | RTSI 3 or PXI_Trig 3 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_4 | RTSI 4 or PXI_Trig 4 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_5 | RTSI 5 or PXI_Trig 5 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_6 | RTSI 6 or PXI_Trig 6 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_RTSI_7 | RTSI 7 or PXI_Trig 7 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_REF_CLOCK_RTSI_CLOCK | RTSI clock | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_REF_OUT | Reference Clock out front panel connector | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PFI_0 | PFI 0 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PFI_1 | PFI 1 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PFI_4 | PFI 4 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PFI_5 | PFI 5 | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PXI_STAR | PXI star trigger line | - +---------------------------------+-------------------------------------------+ - | NIFGEN_VAL_PXI_CLK10 | PXI 10 MHz backplane Reference Clock | - +---------------------------------+-------------------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - route_signal_from_ctype = visatype.ViInt32(route_signal_from) # case 8 - route_signal_to_ctype = visatype.ViInt32(route_signal_to) # case 8 - error_code = self._library.niFgen_RouteSignalOut(vi_ctype, channel_name_ctype, route_signal_from_ctype, route_signal_to_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def _set_attribute_vi_boolean(self, attribute_id, attribute_value): '''_set_attribute_vi_boolean @@ -4588,7 +3636,7 @@ def set_named_waveform_next_write_position(self, waveform_name, relative_to, off Args: waveform_name (string): Specifies the name to associate with the allocated waveform. - relative_to (int): Specifies the reference position in the waveform. This position and + relative_to (enums.RelativeTo): Specifies the reference position in the waveform. This position and **offset** together determine where to start loading data into the waveform. @@ -4602,10 +3650,12 @@ def set_named_waveform_next_write_position(self, waveform_name, relative_to, off offset (int): Specifies the offset from the **relativeTo** parameter at which to start loading the data into the waveform. ''' + if type(relative_to) is not enums.RelativeTo: + raise TypeError('Parameter mode must be of type ' + str(enums.RelativeTo)) vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case 3 - relative_to_ctype = visatype.ViInt32(relative_to) # case 8 + relative_to_ctype = visatype.ViInt32(relative_to.value) # case 9 offset_ctype = visatype.ViInt32(offset) # case 8 error_code = self._library.niFgen_SetNamedWaveformNextWritePosition(vi_ctype, channel_name_ctype, waveform_name_ctype, relative_to_ctype, offset_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -4640,7 +3690,7 @@ def set_waveform_next_write_position(self, waveform_handle, relative_to, offset) Args: waveform_handle (int): Specifies the handle of the arbitrary waveform previously allocated with the nifgen_AllocateWaveform function. - relative_to (int): Specifies the reference position in the waveform. This position and + relative_to (enums.RelativeTo): Specifies the reference position in the waveform. This position and **offset** together determine where to start loading data into the waveform. @@ -4654,42 +3704,18 @@ def set_waveform_next_write_position(self, waveform_handle, relative_to, offset) offset (int): Specifies the offset from **relativeTo** at which to start loading the data into the waveform. ''' + if type(relative_to) is not enums.RelativeTo: + raise TypeError('Parameter mode must be of type ' + str(enums.RelativeTo)) vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_handle_ctype = visatype.ViInt32(waveform_handle) # case 8 - relative_to_ctype = visatype.ViInt32(relative_to) # case 8 + relative_to_ctype = visatype.ViInt32(relative_to.value) # case 9 offset_ctype = visatype.ViInt32(offset) # case 8 error_code = self._library.niFgen_SetWaveformNextWritePosition(vi_ctype, channel_name_ctype, waveform_handle_ctype, relative_to_ctype, offset_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_binary16_analog_static_value(self, value): - '''write_binary16_analog_static_value - - | Writes the 16-bit value to the DAC, which could be output as a DC - Voltage. - | This function writes to the DAC only when in an external calibration - session. - - Tip: - This method requires repeated capabilities (usually channels). If called directly on the - nifgen.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 - nifgen.Session instance, and calling this method on the result.: - - session['0,1'].write_binary16_analog_static_value(value) - - Args: - value (int): The value to write. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 - value_ctype = visatype.ViInt16(value) # case 8 - error_code = self._library.niFgen_WriteBinary16AnalogStaticValue(vi_ctype, channel_name_ctype, value_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_binary16_waveform(self, waveform_handle, size, data): + def write_binary16_waveform(self, waveform_handle, data): '''write_binary16_waveform Writes binary data to the waveform in onboard memory. The waveform @@ -4711,7 +3737,7 @@ def write_binary16_waveform(self, waveform_handle, size, data): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].write_binary16_waveform(waveform_handle, size, data) + session['0,1'].write_binary16_waveform(waveform_handle, data) Args: waveform_handle (int): Specifies the handle of the arbitrary waveform previously allocated with @@ -4726,13 +3752,13 @@ def write_binary16_waveform(self, waveform_handle, size, data): vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_handle_ctype = visatype.ViInt32(waveform_handle) # case 8 - size_ctype = visatype.ViInt32(size) # case 8 + size_ctype = visatype.ViInt32(len(data)) # case 5 data_ctype = (visatype.ViInt16 * len(data))(*data) # case 4 error_code = self._library.niFgen_WriteBinary16Waveform(vi_ctype, channel_name_ctype, waveform_handle_ctype, size_ctype, data_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_named_waveform_f64(self, waveform_name, size, data): + def write_named_waveform_f64(self, waveform_name, data): '''write_named_waveform_f64 Writes floating-point data to the waveform in onboard memory. The @@ -4761,7 +3787,7 @@ def write_named_waveform_f64(self, waveform_name, size, data): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].write_named_waveform_f64(waveform_name, size, data) + session['0,1'].write_named_waveform_f64(waveform_name, data) Args: waveform_name (string): Specifies the name to associate with the allocated waveform. @@ -4774,13 +3800,13 @@ def write_named_waveform_f64(self, waveform_name, size, data): vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case 3 - size_ctype = visatype.ViInt32(size) # case 8 + size_ctype = visatype.ViInt32(len(data)) # case 5 data_ctype = (visatype.ViReal64 * len(data))(*data) # case 4 error_code = self._library.niFgen_WriteNamedWaveformF64(vi_ctype, channel_name_ctype, waveform_name_ctype, size_ctype, data_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_named_waveform_i16(self, waveform_name, size, data): + def write_named_waveform_i16(self, waveform_name, data): '''write_named_waveform_i16 Writes binary data to the named waveform in onboard memory. @@ -4800,7 +3826,7 @@ def write_named_waveform_i16(self, waveform_name, size, data): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].write_named_waveform_i16(waveform_name, size, data) + session['0,1'].write_named_waveform_i16(waveform_name, data) Args: waveform_name (string): Specifies the name to associate with the allocated waveform. @@ -4813,7 +3839,7 @@ def write_named_waveform_i16(self, waveform_name, size, data): vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case 3 - size_ctype = visatype.ViInt32(size) # case 8 + size_ctype = visatype.ViInt32(len(data)) # case 5 data_ctype = (visatype.ViInt16 * len(data))(*data) # case 4 error_code = self._library.niFgen_WriteNamedWaveformI16(vi_ctype, channel_name_ctype, waveform_name_ctype, size_ctype, data_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -4846,7 +3872,7 @@ def write_script(self, script): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform(self, waveform_handle, size, data): + def write_waveform(self, waveform_handle, data): '''write_waveform Writes floating-point data to the waveform in onboard memory. The @@ -4875,7 +3901,7 @@ def write_waveform(self, waveform_handle, size, data): You can specify a subset of repeated capabilities using the Python index notation on an nifgen.Session instance, and calling this method on the result.: - session['0,1'].write_waveform(waveform_handle, size, data) + session['0,1'].write_waveform(waveform_handle, data) Args: waveform_handle (int): Specifies the handle of the arbitrary waveform previously allocated with @@ -4889,7 +3915,7 @@ def write_waveform(self, waveform_handle, size, data): vi_ctype = visatype.ViSession(self._vi) # case 1 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case 2 waveform_handle_ctype = visatype.ViInt32(waveform_handle) # case 8 - size_ctype = visatype.ViInt32(size) # case 8 + size_ctype = visatype.ViInt32(len(data)) # case 5 data_ctype = (visatype.ViReal64 * len(data))(*data) # case 4 error_code = self._library.niFgen_WriteWaveform(vi_ctype, channel_name_ctype, waveform_handle_ctype, size_ctype, data_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -4933,10 +3959,10 @@ def __init__(self, vi, repeated_capability): class Session(_SessionBase): '''An NI-FGEN session to a National Instruments Signal Generator.''' - def __init__(self, resource_name, id_query, reset_device, option_string): + def __init__(self, resource_name, reset_device=False, option_string=''): super(Session, self).__init__(repeated_capability='') - self._vi = 0 # This must be set before calling _init_with_options(). - self._vi = self._init_with_options(resource_name, id_query, reset_device, option_string) + self._vi = 0 # This must be set before calling _initialize_with_channels(). + self._vi = self._initialize_with_channels(resource_name, reset_device, option_string) self._is_frozen = True def __enter__(self): @@ -5065,7 +4091,7 @@ def clear_arb_waveform(self, waveform_handle): - create_waveform_i16 - create_waveform_from_file_i16 - create_waveform_from_file_f64 - - create_waveform_from_file_hws + - CreateWaveformFromFileHWS **Defined Value**: @@ -5132,77 +4158,14 @@ def commit(self): - Routes are committed, so signals are exported or imported. - Any Reference Clock and external clock circuits are phase-locked. - A subsequent _initiate_generation function can run faster - because the device is already configured. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_Commit(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_channels(self, channels): - '''configure_channels - - Configures the channels to use with the instrument specified in the - **vi** parameter. If you call this function, you must call it - immediately after initializing your session and before configuring - attributes or writing data. - - Args: - channels (string): Specifies the channel on which all subsequent channel-based attributes - in the session are set. Valid values are non-negative integers. For - example, 0 is the only valid value on devices with one channel, while - devices with two channels support values of 0 and 1. You can specify - more than one channel by inserting commas between values (for example, - 0,1). - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - channels_ctype = ctypes.create_string_buffer(channels.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_ConfigureChannels(vi_ctype, channels_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_clock_mode(self, clock_mode): - '''configure_clock_mode - - Selects the clock mode for the signal generator. - - Some signal generators allow you to switch the Sample Clock to - High-Resolution or Automatic Sampling mode with this function. - - When you select NIFGEN_VAL_DIVIDE_DOWN, NI-FGEN rounds the sample - rate to a frequency that can be achieved by dividing down the board - clock (Sample Clock timebase). However, if you select - NIFGEN_VAL_HIGH_RESOLUTION, you can set the sample rate to any value. - If you select NIFGEN_VAL_AUTOMATIC, NI-FGEN selects the clock mode - based on the sample rate, using divide-down sampling when possible. - - Note: - The signal generator must not be in the Generating state when you call - this function. - - Args: - clock_mode (int): Sets the clock mode of the signal generator. - - ****Defined Values**** - - **Default Value**: NIFGEN_VAL_HIGH_RESOLUTION (NI 5450, NI 5451), - NIFGEN_VAL_DIVIDE_DOWN (all other devices) - - +----------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_DIVIDE_DOWN | **Divide down sampling**—Sample rates are generated by dividing the source frequency. | - +----------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_HIGH_RESOLUTION | **High resolution sampling**—Sample rate is generated by a high-resolution clock source. | - +----------------------------+-----------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_AUTOMATIC | **Automatic Selection**—NI-FGEN selects between the divide-down and high-resolution clocking modes. | - +----------------------------+-----------------------------------------------------------------------------------------------------+ + because the device is already configured. ''' vi_ctype = visatype.ViSession(self._vi) # case 1 - clock_mode_ctype = visatype.ViInt32(clock_mode) # case 8 - error_code = self._library.niFgen_ConfigureClockMode(vi_ctype, clock_mode_ctype) + error_code = self._library.niFgen_Commit(vi_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_digital_edge_script_trigger(self, trigger_id, source, edge): + def configure_digital_edge_script_trigger(self, trigger_id, source, edge=enums.ScriptTriggerDigitalEdgeEdge.RISING_EDGE): '''configure_digital_edge_script_trigger Configures the specified Script Trigger for digital edge triggering. @@ -5264,7 +4227,7 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): +-------------+-----------------------------------+ | "PXI_Star" | PXI star trigger line | +-------------+-----------------------------------+ - edge (int): Specifies the edge to detect. + edge (enums.ScriptTriggerDigitalEdgeEdge): Specifies the edge to detect. ****Defined Values**** @@ -5276,15 +4239,17 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): | NIFGEN_VAL_FALLING_EDGE | Occurs when the signal transitions from high level to low level. | +-------------------------+------------------------------------------------------------------+ ''' + if type(edge) is not enums.ScriptTriggerDigitalEdgeEdge: + raise TypeError('Parameter mode must be of type ' + str(enums.ScriptTriggerDigitalEdgeEdge)) vi_ctype = visatype.ViSession(self._vi) # case 1 trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case 3 source_ctype = ctypes.create_string_buffer(source.encode(self._encoding)) # case 3 - edge_ctype = visatype.ViInt32(edge) # case 8 + edge_ctype = visatype.ViInt32(edge.value) # case 9 error_code = self._library.niFgen_ConfigureDigitalEdgeScriptTrigger(vi_ctype, trigger_id_ctype, source_ctype, edge_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_digital_edge_start_trigger(self, source, edge): + def configure_digital_edge_start_trigger(self, source, edge=enums.StartTriggerDigitalEdgeEdge.RISING_EDGE): '''configure_digital_edge_start_trigger Configures the Start Trigger for digital edge triggering. @@ -5331,7 +4296,7 @@ def configure_digital_edge_start_trigger(self, source, edge): +-------------+-----------------------------------+ | "PXI_Star" | PXI star trigger line | +-------------+-----------------------------------+ - edge (int): Specifies the edge to detect. + edge (enums.StartTriggerDigitalEdgeEdge): Specifies the edge to detect. ****Defined Values**** @@ -5343,9 +4308,11 @@ def configure_digital_edge_start_trigger(self, source, edge): | NIFGEN_VAL_FALLING_EDGE | Occurs when the signal transitions from high level to low level. | +-------------------------+------------------------------------------------------------------+ ''' + if type(edge) is not enums.StartTriggerDigitalEdgeEdge: + raise TypeError('Parameter mode must be of type ' + str(enums.StartTriggerDigitalEdgeEdge)) vi_ctype = visatype.ViSession(self._vi) # case 1 source_ctype = ctypes.create_string_buffer(source.encode(self._encoding)) # case 3 - edge_ctype = visatype.ViInt32(edge) # case 8 + edge_ctype = visatype.ViInt32(edge.value) # case 9 error_code = self._library.niFgen_ConfigureDigitalEdgeStartTrigger(vi_ctype, source_ctype, edge_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -5433,366 +4400,7 @@ def configure_digital_level_script_trigger(self, trigger_id, source, trigger_whe errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_output_mode(self, output_mode): - '''configure_output_mode - - Configures the output mode of the signal generator. The output mode - determines how the signal generator produces waveforms. For example, you - can select to generate a standard waveform, an arbitrary waveform, or a - sequence of arbitrary waveforms. - - Note: - The signal generator must not be in the Generating state when you - call this function. - - Args: - output_mode (int): Specifies the output mode that you want the signal generator to use. The - value you specify determines which functions and attributes you can use - to configure the waveform the signal generator produces. - Refer to the OUTPUT_MODE attribute for more information - about setting this parameter. - ****Defined Values**** - **Default Value**: NIFGEN_VAL_OUTPUT_FUNC - - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUTPUT_FUNC | **Standard Function mode**—Generates standard function waveforms such as sine, square, triangle, and so on. | - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUTPUT_FREQ_LIST | **Frequency List mode**—Generates a standard function using a list of frequencies you define. | - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUTPUT_ARB | **Arbitrary waveform mode**—Generates waveforms from user-created/provided waveform arrays of numeric data. | - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUTPUT_SEQ | **Arbitrary sequence mode**—Generates downloaded waveforms in an order your specify. | - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - | NIFGEN_VAL_OUTPUT_SCRIPT | **Script mode**—Allows you to use scripting to link and loop multiple waveforms in complex combinations. | - +-----------------------------+-------------------------------------------------------------------------------------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - output_mode_ctype = visatype.ViInt32(output_mode) # case 8 - error_code = self._library.niFgen_ConfigureOutputMode(vi_ctype, output_mode_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): - '''configure_p2_p_endpoint_fullness_start_trigger - - Configures the Start Trigger for to detect peer-to-peer endpoint - fullness. Generation begins when the number of samples in the - peer-to-peer endpoint reaches the threshold indicated by the - **p2pEndpointFullnessLevel** parameter. - - Note: - Because there is an additional internal FIFO in the signal generator, - the writer peer must actually write 2,304 bytes more than the quantity - of data specified by this function to satisfy the trigger level. - - Args: - p2p_endpoint_fullness_level (int): Specifies the quantity of data in the FIFO endpoint that asserts the - trigger. The value –1 specifies that NI-FGEN uses a default value based - on your endpoint configuration. - - **Units**: samples per channel - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - p2p_endpoint_fullness_level_ctype = visatype.ViInt32(p2p_endpoint_fullness_level) # case 8 - error_code = self._library.niFgen_ConfigureP2PEndpointFullnessStartTrigger(vi_ctype, p2p_endpoint_fullness_level_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_ref_clock_frequency(self, reference_clock_frequency): - '''configure_ref_clock_frequency - - Configures the signal generator reference clock frequency. The signal - generator uses the reference clock to derive frequencies and sample - rates when generating waveforms. - - Note: - The signal generator must not be in the Generating state when you - call this function. - - Args: - reference_clock_frequency (float): The reference clock frequency in Hz. - - **Default Value**: 10000000 - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - reference_clock_frequency_ctype = visatype.ViReal64(reference_clock_frequency) # case 8 - error_code = self._library.niFgen_ConfigureRefClockFrequency(vi_ctype, reference_clock_frequency_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_ref_clock_source(self, reference_clock_source): - '''configure_ref_clock_source - - Configures the signal generator reference clock source. The signal - generator uses the reference clock to derive frequencies and sample - rates when generating waveforms. - - Args: - reference_clock_source (int): Specifies the reference clock source that you want the signal generator - to use. NI-FGEN sets the REF_CLOCK_SOURCE attribute to - this value. - - The signal generator derives the frequencies and sample rates that it - uses to generate waveforms from the source you specify. - - For example, when you set this parameter to - NIFGEN_VAL_REF_CLOCK_EXTERNAL, the signal generator uses the signal - it receives at its external clock terminal as the reference clock. - - ****Defined Values**** - - **Default Value**: NIFGEN_VAL_REF_CLOCK_INTERNAL - - +---------------------------------+------------------------------+ - | NIFGEN_VAL_REF_CLOCK_INTERNAL | Internal clock source | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_REF_CLOCK_EXTERNAL | External clock source | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_REF_CLOCK_RTSI_CLOCK | RTSI clock | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_REF_CLOCK_TTL7 | TTL 7 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_PXI_CLK10 | PXI 10 MHz clock | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_REF_IN | External clock source | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_0 | RTSI 0 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_1 | RTSI 1 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_2 | RTSI 2 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_3 | RTSI 3 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_4 | RTSI 4 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_5 | RTSI 5 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_6 | RTSI 6 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_RTSI_7 | RTSI 7 | - +---------------------------------+------------------------------+ - | NIFGEN_VAL_CLK_IN | CLK IN front panel connector | - +---------------------------------+------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - reference_clock_source_ctype = visatype.ViInt32(reference_clock_source) # case 8 - error_code = self._library.niFgen_ConfigureRefClockSource(vi_ctype, reference_clock_source_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_reference_clock(self, reference_clock_source, reference_clock_frequency): - '''configure_reference_clock - - Configures the signal generator Reference Clock source and frequency. - The signal generator uses the Reference Clock to tune the Sample Clock - timebase of the signal generator so that the frequency stability and - accuracy of the Sample Clock timebase matches that of the Reference - Clock. - - Args: - reference_clock_source (string): Specifies the source for the Reference Clock. For example, when you set - this parameter to "ClkIn," the signal generator uses the signal it - receives at its CLK IN front panel connector as the Reference Clock. The - Reference Clock phase-locks with the signal generator Sample Clock - timebase to allow the frequency stability and accuracy of the Sample - Clock timebase to match that of the Reference Clock. - ****Defined Values**** - **Default Value**: "None" - - +-------------------------+----------------------------------+ - | "None" | No Reference Clock | - +-------------------------+----------------------------------+ - | "PXI_Clk" | 10 MHz backplane Reference Clock | - +-------------------------+----------------------------------+ - | "ClkIn" | CLK IN front panel connector | - +-------------------------+----------------------------------+ - | "OnboardReferenceClock" | Onboard Reference Clock | - +-------------------------+----------------------------------+ - | "RTSI7" | RTSI line 7 | - +-------------------------+----------------------------------+ - | "RefIn" | REF IN front panel connector | - +-------------------------+----------------------------------+ - - Note: - The following **Defined Values** are examples of possible Reference - Clock sources. For a complete list of the Reference Clock sources - available on your device, refer to the Routes topic for your device or - the **Device Routes** tab in MAX. - reference_clock_frequency (float): The Reference Clock frequency in hertz. - - **Default Value**: 10000000 - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - reference_clock_source_ctype = ctypes.create_string_buffer(reference_clock_source.encode(self._encoding)) # case 3 - reference_clock_frequency_ctype = visatype.ViReal64(reference_clock_frequency) # case 8 - error_code = self._library.niFgen_ConfigureReferenceClock(vi_ctype, reference_clock_source_ctype, reference_clock_frequency_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_sample_clock_source(self, sample_clock_source): - '''configure_sample_clock_source - - Sets the source of the Sample Clock (Update Clock) of the signal - generator. - - Args: - sample_clock_source (string): Specifies the Sample Clock source the signal generator uses. - ****Defined Values**** - **Default Value**: "OnboardClock" - - +----------------+-----------------------------------+ - | "OnboardClock" | Onboard Clock | - +----------------+-----------------------------------+ - | "ClkIn" | CLK IN front panel connector | - +----------------+-----------------------------------+ - | "PXI_Star" | PXI star trigger line | - +----------------+-----------------------------------+ - | "PXI_Trig0" | PXI trigger line 0 or RTSI line 0 | - +----------------+-----------------------------------+ - | "PXI_Trig1" | PXI trigger line 1 or RTSI line 1 | - +----------------+-----------------------------------+ - | "PXI_Trig2" | PXI trigger line 2 or RTSI line 2 | - +----------------+-----------------------------------+ - | "PXI_Trig3" | PXI trigger line 3 or RTSI line 3 | - +----------------+-----------------------------------+ - | "PXI_Trig4" | PXI trigger line 4 or RTSI line 4 | - +----------------+-----------------------------------+ - | "PXI_Trig5" | PXI trigger line 5 or RTSI line 5 | - +----------------+-----------------------------------+ - | "PXI_Trig6" | PXI trigger line 6 or RTSI line 6 | - +----------------+-----------------------------------+ - | "PXI_Trig7" | PXI trigger line 7 or RTSI line 7 | - +----------------+-----------------------------------+ - | "DDC_ClkIn" | Sample Clock from DDC connector | - +----------------+-----------------------------------+ - - Note: - The following **Defined Values** are examples of possible Sample - Clock sources. For a complete list of the Sample Clock sources available - on your device, refer to the Routes topic for your device or the - **Device Routes** tab in MAX. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - sample_clock_source_ctype = ctypes.create_string_buffer(sample_clock_source.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_ConfigureSampleClockSource(vi_ctype, sample_clock_source_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_sample_rate(self, sample_rate): - '''configure_sample_rate - - Configures the ARB_SAMPLE_RATE attribute, which - determines the rate at which the signal generator produces arbitrary - waveforms. When you configure the signal generator to produce an - arbitrary sequence, this value is the sample rate for all arbitrary - waveforms in the sequence. - - Note: - The signal generator must not be in the Generating state when you call - this function. - - Args: - sample_rate (float): Specifies the sample rate at which you want the signal generator to - generate arbitrary waveforms. NI-FGEN sets the - ARB_SAMPLE_RATE attribute to this value. - - **Units**: Samples/s - - **Default Value**: None - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - sample_rate_ctype = visatype.ViReal64(sample_rate) # case 8 - error_code = self._library.niFgen_ConfigureSampleRate(vi_ctype, sample_rate_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_software_edge_script_trigger(self, trigger_id): - '''configure_software_edge_script_trigger - - Configures the specified Script Trigger for software edge triggering. - - Args: - trigger_id (string): Specifies the Script Trigger used for triggering. - - **Defined Values** - - **Default Value**: "ScriptTrigger0" - - +------------------+------------------+ - | "ScriptTrigger0" | Script Trigger 0 | - +------------------+------------------+ - | "ScriptTrigger1" | Script Trigger 1 | - +------------------+------------------+ - | "ScriptTrigger2" | Script Trigger 2 | - +------------------+------------------+ - | "ScriptTrigger3" | Script Trigger 3 | - +------------------+------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_ConfigureSoftwareEdgeScriptTrigger(vi_ctype, trigger_id_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_software_edge_start_trigger(self): - '''configure_software_edge_start_trigger - - Configures the Start Trigger for software edge triggering. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_ConfigureSoftwareEdgeStartTrigger(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def configure_update_clock_source(self, update_clock_source): - '''configure_update_clock_source - - Sets the source of the update clock of the signal generator. The source - can be internal or external. - - Args: - update_clock_source (int): Specifies the update clock source. - - ****Defined Values**** - - **Default Value**: NIFGEN_VAL_INTERNAL - - +-----------------------+---------------------------------+ - | NIFGEN_VAL_INTERNAL | Internal clock source | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_EXTERNAL | External clock source | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_PXI_STAR | PXI star | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_0 | RTSI 0 or PXI_Trig 0 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_1 | RTSI 1 or PXI_Trig 1 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_2 | RTSI 2 or PXI_Trig 2 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_3 | RTSI 3 or PXI_Trig 3 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_4 | RTSI 4 or PXI_Trig 4 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_5 | RTSI 5 or PXI_Trig 5 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_6 | RTSI 6 or PXI_Trig 6 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_RTSI_7 | RTSI 7 or PXI_Trig 7 | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_CLK_IN | CLK IN front panel connector | - +-----------------------+---------------------------------+ - | NIFGEN_VAL_DDC_CLK_IN | Digital Data & Control clock in | - +-----------------------+---------------------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - update_clock_source_ctype = visatype.ViInt32(update_clock_source) # case 8 - error_code = self._library.niFgen_ConfigureUpdateClockSource(vi_ctype, update_clock_source_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def create_advanced_arb_sequence(self, sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array): + def create_advanced_arb_sequence(self, waveform_handles_array, loop_counts_array, sample_counts_array=None, marker_location_array=None): '''create_advanced_arb_sequence Creates an arbitrary sequence from an array of waveform handles and an @@ -5892,7 +4500,7 @@ def create_advanced_arb_sequence(self, sequence_length, waveform_handles_array, arbitrary sequence. ''' vi_ctype = visatype.ViSession(self._vi) # case 1 - sequence_length_ctype = visatype.ViInt32(sequence_length) # case 8 + sequence_length_ctype = visatype.ViInt32(len(waveform_handles_array)) # case 5 waveform_handles_array_ctype = (visatype.ViInt32 * len(waveform_handles_array))(*waveform_handles_array) # case 4 loop_counts_array_ctype = (visatype.ViInt32 * len(loop_counts_array))(*loop_counts_array) # case 4 sample_counts_array_ctype = (visatype.ViInt32 * len(sample_counts_array))(*sample_counts_array) # case 4 @@ -5973,112 +4581,7 @@ def create_arb_sequence(self, sequence_length, waveform_handles_array, loop_coun errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(sequence_handle_ctype.value) - def create_arb_waveform(self, waveform_size, waveform_data_array): - '''create_arb_waveform - - [OBSOLETE] This function is obsolete. Use the nifgen_CreateWaveformF64, - nifgen_CreateWaveformI16, or nifgen_CreateWaveformComplexF64 function - instead of this function. - - Creates an arbitrary waveform and returns a handle that identifies that - waveform. You can pass this handle to the nifgen_ConfigureArbWaveform - function to produce that waveform. You can also use the handles this - function returns to specify a sequence of arbitrary waveforms with the - nifgen_CreateArbSequence function. - - Note: - You must scale the data between –1.00 and +1.00. Use the **arbGain** - parameter to generate different output voltages. - - Args: - waveform_size (int): | Specifies the size of the arbitrary waveform that you want created. - | The size must meet the following restrictions: - - - The size must be less than or equal to the maximum waveform size that - the device allows. - - The size must be greater than or equal to the minimum waveform size - that the device allows. - - The size must be an integer multiple of the device waveform quantum. - - | - | You can obtain these values from the **maximumWaveformSize**, - **minimumWaveformSize**, and **waveformQuantum** parameters in the - nifgen_QueryArbWfmCapabilities function. - | ****Default Value**:** None - waveform_data_array (list of float): Specifies the array of data you want to use for the new arbitrary - waveform. The array must have at least as many elements as the value - that you specify in **waveformSize**. - - You must normalize the data points in the array to be between –1.00 and - +1.00. - - **Default Value**: None - - Returns: - waveform_handle (int): The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - waveform_size_ctype = visatype.ViInt32(waveform_size) # case 8 - waveform_data_array_ctype = (visatype.ViReal64 * len(waveform_data_array))(*waveform_data_array) # case 4 - waveform_handle_ctype = visatype.ViInt32() # case 13 - error_code = self._library.niFgen_CreateArbWaveform(vi_ctype, waveform_size_ctype, waveform_data_array_ctype, ctypes.pointer(waveform_handle_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(waveform_handle_ctype.value) - - def create_binary16_arb_waveform(self, waveform_size, waveform_data_array): - '''create_binary16_arb_waveform - - [OBSOLETE] This function is obsolete. Use the nifgen_CreateWaveformI16 - function instead of this function. - - Creates an arbitrary waveform from binary data and returns a handle that - identifies that waveform. You can pass this handle to the - nifgen_ConfigureArbWaveform function to produce that waveform. You can - also use the handles this function returns to specify a sequence of - arbitrary waveforms with the nifgen_CreateArbSequence function. - - Note: - You must set the output mode to NIFGEN_VAL_OUTPUT_ARB or - NIFGEN_VAL_OUTPUT_SEQ before calling this function. - - Args: - waveform_size (int): | Specifies the size of the arbitrary waveform that you want created. - | The size must meet the following restrictions: - - - The size must be less than or equal to the maximum waveform size that - the device allows. - - The size must be greater than or equal to the minimum waveform size - that the device allows. - - The size must be an integer multiple of the device waveform quantum. - - | - | You can obtain these values from the **maximumWaveformSize**, - **minimumWaveformSize**, and **waveformQuantum** parameters in - nifgen_QueryArbWfmCapabilities. - | ****Default Value**:** None - waveform_data_array (list of int): Specifies the array of data you want to use for the new arbitrary - waveform. The array must have at least as many elements as the value - that you specify in **waveformSize**. - - You must normalize the data points in the array to be between –32768 and - 32767. - - **Default Value**: None - - Returns: - waveform_handle (int): The handle that identifies the new waveform. This handle is used later - when referring to this waveform. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - waveform_size_ctype = visatype.ViInt32(waveform_size) # case 8 - waveform_data_array_ctype = (visatype.ViInt16 * len(waveform_data_array))(*waveform_data_array) # case 4 - waveform_handle_ctype = visatype.ViInt32() # case 13 - error_code = self._library.niFgen_CreateBinary16ArbWaveform(vi_ctype, waveform_size_ctype, waveform_data_array_ctype, ctypes.pointer(waveform_handle_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(waveform_handle_ctype.value) - - def create_freq_list(self, waveform, frequency_list_length, frequency_array, duration_array): + def create_freq_list(self, waveform, frequency_array, duration_array): '''create_freq_list Creates a frequency list from an array of frequencies @@ -6099,7 +4602,7 @@ def create_freq_list(self, waveform, frequency_list_length, frequency_array, dur this function. Args: - waveform (int): Specifies the standard waveform that you want the signal generator to + waveform (enums.Waveform): Specifies the standard waveform that you want the signal generator to produce. NI-FGEN sets the FUNC_WAVEFORM attribute to this value. @@ -6152,97 +4655,36 @@ def create_freq_list(self, waveform, frequency_list_length, frequency_array, dur **Units**: seconds - **Default Value**: None - - Returns: - frequency_list_handle (int): Returns the handle that identifies the new frequency list. You can pass - this handle to nifgen_ConfigureFreqList to generate the arbitrary - sequence. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - waveform_ctype = visatype.ViInt32(waveform) # case 8 - frequency_list_length_ctype = visatype.ViInt32(frequency_list_length) # case 8 - frequency_array_ctype = (visatype.ViReal64 * len(frequency_array))(*frequency_array) # case 4 - duration_array_ctype = (visatype.ViReal64 * len(duration_array))(*duration_array) # case 4 - frequency_list_handle_ctype = visatype.ViInt32() # case 13 - error_code = self._library.niFgen_CreateFreqList(vi_ctype, waveform_ctype, frequency_list_length_ctype, frequency_array_ctype, duration_array_ctype, ctypes.pointer(frequency_list_handle_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(frequency_list_handle_ctype.value) - - def disable(self): - '''disable - - Places the instrument in a quiescent state where it has minimal or no - impact on the system to which it is connected. The analog output and all - exported signals are disabled. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_Disable(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def disable_script_trigger(self, trigger_id): - '''disable_script_trigger - - Disables the specified Script Trigger. - - Args: - trigger_id (string): Specifies the Script Trigger used for triggering. - - **Defined Values** - - **Default Value**: "ScriptTrigger0" - - +------------------+------------------+ - | "ScriptTrigger0" | Script Trigger 0 | - +------------------+------------------+ - | "ScriptTrigger1" | Script Trigger 1 | - +------------------+------------------+ - | "ScriptTrigger2" | Script Trigger 2 | - +------------------+------------------+ - | "ScriptTrigger3" | Script Trigger 3 | - +------------------+------------------+ - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_DisableScriptTrigger(vi_ctype, trigger_id_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def disable_start_trigger(self): - '''disable_start_trigger + **Default Value**: None - Disables the Start Trigger. + Returns: + frequency_list_handle (int): Returns the handle that identifies the new frequency list. You can pass + this handle to nifgen_ConfigureFreqList to generate the arbitrary + sequence. ''' + if type(waveform) is not enums.Waveform: + raise TypeError('Parameter mode must be of type ' + str(enums.Waveform)) vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_DisableStartTrigger(vi_ctype) + waveform_ctype = visatype.ViInt32(waveform.value) # case 9 + frequency_list_length_ctype = visatype.ViInt32(len(frequency_array)) # case 5 + frequency_array_ctype = (visatype.ViReal64 * len(frequency_array))(*frequency_array) # case 4 + duration_array_ctype = (visatype.ViReal64 * len(duration_array))(*duration_array) # case 4 + frequency_list_handle_ctype = visatype.ViInt32() # case 13 + error_code = self._library.niFgen_CreateFreqList(vi_ctype, waveform_ctype, frequency_list_length_ctype, frequency_array_ctype, duration_array_ctype, ctypes.pointer(frequency_list_handle_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def error_handler(self, error_code): - '''error_handler - - Converts a status code returned by an NI-FGEN function into a - user-readable string and returns any error elaborations. - - Args: - error_code (int): Specifies the **status** parameter that is returned from any of the - NI-FGEN functions. - - **Default Value**: 0 (VI_SUCCESS) + return int(frequency_list_handle_ctype.value) - Returns: - error_message (string): Returns the error message string read from the instrument error message - queue. + def disable(self): + '''disable - You must pass a ViChar array with at least 256 bytes. + Places the instrument in a quiescent state where it has minimal or no + impact on the system to which it is connected. The analog output and all + exported signals are disabled. ''' vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code_ctype = visatype.ViStatus(error_code) # case 8 - error_message_ctype = (visatype.ViChar * 1)() # case 10 - error_code = self._library.niFgen_ErrorHandler(vi_ctype, error_code_ctype, error_message_ctype) + error_code = self._library.niFgen_Disable(vi_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return error_message_ctype.value.decode(self._encoding) + return def export_signal(self, signal, signal_identifier, output_terminal): '''export_signal @@ -6259,7 +4701,7 @@ def export_signal(self, signal, signal_identifier, output_terminal): signal is routed to the output terminal you specify. Args: - signal (int): Specifies the source of the signal to route. + signal (enums.Signal): Specifies the source of the signal to route. ****Defined Values**** +------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -6362,14 +4804,73 @@ def export_signal(self, signal, signal_identifier, output_terminal): device, refer to the Routes topic for your device or the **Device Routes** tab in MAX. ''' + if type(signal) is not enums.Signal: + raise TypeError('Parameter mode must be of type ' + str(enums.Signal)) vi_ctype = visatype.ViSession(self._vi) # case 1 - signal_ctype = visatype.ViInt32(signal) # case 8 + signal_ctype = visatype.ViInt32(signal.value) # case 9 signal_identifier_ctype = ctypes.create_string_buffer(signal_identifier.encode(self._encoding)) # case 3 output_terminal_ctype = ctypes.create_string_buffer(output_terminal.encode(self._encoding)) # case 3 error_code = self._library.niFgen_ExportSignal(vi_ctype, signal_ctype, signal_identifier_ctype, output_terminal_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def get_ext_cal_last_date_and_time(self): + '''get_ext_cal_last_date_and_time + + Returns the date and time of the last successful external calibration. + The time returned is 24-hour (military) local time; for example, if the + device was calibrated at 2:30 PM, this function returns 14 for the + **hour** parameter and 30 for the **minute** parameter. + + Returns: + year (int): Specifies the year of the last successful calibration. + month (int): Specifies the month of the last successful calibration. + day (int): Specifies the day of the last successful calibration. + hour (int): Specifies the hour of the last successful calibration. + minute (int): Specifies the minute of the last successful calibration. + ''' + vi_ctype = visatype.ViSession(self._vi) # case 1 + year_ctype = visatype.ViInt32() # case 13 + month_ctype = visatype.ViInt32() # case 13 + day_ctype = visatype.ViInt32() # case 13 + hour_ctype = visatype.ViInt32() # case 13 + minute_ctype = visatype.ViInt32() # case 13 + error_code = self._library.niFgen_GetExtCalLastDateAndTime(vi_ctype, ctypes.pointer(year_ctype), ctypes.pointer(month_ctype), ctypes.pointer(day_ctype), ctypes.pointer(hour_ctype), ctypes.pointer(minute_ctype)) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return int(year_ctype.value), int(month_ctype.value), int(day_ctype.value), int(hour_ctype.value), int(minute_ctype.value) + + def get_ext_cal_last_temp(self): + '''get_ext_cal_last_temp + + Returns the temperature at the last successful external calibration. The + temperature is returned in degrees Celsius. + + Returns: + temperature (float): Specifies the temperature at the last successful calibration in degrees + Celsius. + ''' + vi_ctype = visatype.ViSession(self._vi) # case 1 + temperature_ctype = visatype.ViReal64() # case 13 + error_code = self._library.niFgen_GetExtCalLastTemp(vi_ctype, ctypes.pointer(temperature_ctype)) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return float(temperature_ctype.value) + + def get_ext_cal_recommended_interval(self): + '''get_ext_cal_recommended_interval + + Returns the recommended interval between external calibrations in + months. + + Returns: + months (int): Specifies the recommended interval between external calibrations in + months. + ''' + vi_ctype = visatype.ViSession(self._vi) # case 1 + months_ctype = visatype.ViInt32() # case 13 + error_code = self._library.niFgen_GetExtCalRecommendedInterval(vi_ctype, ctypes.pointer(months_ctype)) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return int(months_ctype.value) + def get_hardware_state(self): '''get_hardware_state @@ -6379,7 +4880,7 @@ def get_hardware_state(self): Note: Hardware states do not necessarily correspond to NI-FGEN states. Returns: - state (int): Returns the hardware state of the signal generator. + state (enums.HardwareState): Returns the hardware state of the signal generator. **Defined Values** @@ -6399,7 +4900,7 @@ def get_hardware_state(self): state_ctype = visatype.ViInt32() # case 13 error_code = self._library.niFgen_GetHardwareState(vi_ctype, ctypes.pointer(state_ctype)) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(state_ctype.value) + return enums.HardwareState(state_ctype.value) def get_self_cal_last_date_and_time(self): '''get_self_cal_last_date_and_time @@ -6471,212 +4972,6 @@ def get_self_cal_supported(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(self_cal_supported_ctype.value) - def _init_with_options(self, resource_name, id_query, reset_device, option_string): - '''_init_with_options - - Performs the following initialization actions: - - - Creates a new IVI instrument session and optionally sets the initial - state of the following session attributes: - RANGE_CHECK, QUERY_INSTRUMENT_STATUS, - cache, simulate, and - RECORD_COERCIONS. - - Opens a session to the specified device using the interface and - address that you specify for **resourceName**. - - If **IDQuery** is set to VI_TRUE, this function queries the device - ID and checks that it is valid for NI-FGEN. - - If **resetDevice** is set to VI_TRUE, this function resets the - device to a known state. - - Sends initialization commands to set the instrument to the state - necessary for NI-FGEN operation. - - Returns a session handle that you can use to identify the device in - all subsequent NI-FGEN function calls. - - Args: - resource_name (string): Caution: - Traditional NI-DAQ and NI-DAQmx device names are not case-sensitive. - However, all IVI names, such as logical names, are case-sensitive. If - you use logical names, driver session names, or virtual names in your - program, you must ensure that the name you use matches the name in the - IVI Configuration Store file exactly, without any variations in the case - of the characters. - - | Specifies the resource name of the device to initialize. - - For Traditional NI-DAQ devices, the syntax is DAQ::\ *n*, where *n* is - the device number assigned by MAX, as shown in Example 1. - - For NI-DAQmx devices, the syntax is just the device name specified in - MAX, as shown in Example 2. Typical default names for NI-DAQmx devices - in MAX are Dev1 or PXI1Slot1. You can rename an NI-DAQmx device by - right-clicking on the name in MAX and entering a new name. - - An alternate syntax for NI-DAQmx devices consists of DAQ::\ *NI-DAQmx - device name*, as shown in Example 3. This naming convention allows for - the use of an NI-DAQmx device in an application that was originally - designed for a Traditional NI-DAQ device. For example, if the - application expects DAQ::1, you can rename the NI-DAQmx device to 1 in - MAX and pass in DAQ::1 for the resource name, as shown in Example 4. - - If you use the DAQ::\ *n* syntax and an NI-DAQmx device name already - exists with that same name, the NI-DAQmx device is matched first. - - You can also pass in the name of an IVI logical name or an IVI virtual - name configured with the IVI Configuration utility, as shown in Example - 5. A logical name identifies a particular virtual instrument. A virtual - name identifies a specific device and specifies the initial settings for - the session. - - +-----------+--------------------------------------+------------------------+---------------------------------+ - | Example # | Device Type | Syntax | Variable | - +===========+======================================+========================+=================================+ - | 1 | Traditional NI-DAQ device | DAQ::\ *1* | (*1* = device number) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 2 | NI-DAQmx device | *myDAQmxDevice* | (*myDAQmxDevice* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 3 | NI-DAQmx device | DAQ::\ *myDAQmxDevice* | (*myDAQmxDevice* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 4 | NI-DAQmx device | DAQ::\ *2* | (*2* = device name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - | 5 | IVI logical name or IVI virtual name | *myLogicalName* | (*myLogicalName* = name) | - +-----------+--------------------------------------+------------------------+---------------------------------+ - id_query (bool): Specifies whether you want NI-FGEN to perform an ID query. - - When you set this parameter to VI_TRUE, NI-FGEN verifies that the - device that you initialize is a type that it supports. - - Circumstances can arise where sending an ID query to the device is - undesirable. When you set this parameter to VI_FALSE, the function - initializes the device without performing an ID query. - - ****Defined Values**** - - **Default Value**: VI_TRUE - - +----------+------------------+ - | VI_TRUE | Perform ID query | - +----------+------------------+ - | VI_FALSE | Skip ID query | - +----------+------------------+ - reset_device (bool): Specifies whether you want to reset the device during the initialization - procedure. VI_TRUE specifies that the device is reset and performs the - same function as the nifgen_Reset function. - - ****Defined Values**** - - **Default Value**: VI_TRUE - - +----------+---------------------+ - | VI_TRUE | Reset device | - +----------+---------------------+ - | VI_FALSE | Do not reset device | - +----------+---------------------+ - option_string (string): Sets the initial value of certain session attributes. - - The syntax for **optionString** is - - <*attributeName*> = <*value*> - - where - - *attributeName* is the name of the attribute and *value* is the value to - which the attribute is set - - To set multiple attributes, separate them with a comma. - - If you pass NULL or an empty string for this parameter, the session uses - the default values for these attributes. You can override the default - values by assigning a value explicitly in a string that you pass for - this parameter. - - You do not have to specify all of the attributes and may leave any of - them out. However, if you do not specify one of the attributes, its - default value is used. - - If simulation is enabled (Simulate=1), you may specify the device that - you want to simulate. To specify a device, enter the following syntax in - **optionString**. - - DriverSetup=Model:<*driver model number*>;Channels:<*channel - names*>;BoardType:<*module type*>;MemorySize:<*size of onboard memory in - bytes*> - - **Syntax Examples** - - **Attributes and **Defined Values**** - - **Default Values**: "Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1" - - +------------------+-------------------------+-------------------+ - | Attribute Name | Attribute | Values | - +==================+=========================+===================+ - | RangeCheck | RANGE_CHECK | VI_TRUE, VI_FALSE | - +------------------+-------------------------+-------------------+ - | QueryInstrStatus | QUERY_INSTRUMENT_STATUS | VI_TRUE, VI_FALSE | - +------------------+-------------------------+-------------------+ - | Cache | cache | VI_TRUE, VI_FALSE | - +------------------+-------------------------+-------------------+ - | Simulate | simulate | VI_TRUE, VI_FALSE | - +------------------+-------------------------+-------------------+ - - Returns: - vi (int): Returns a session handle that you can use to identify the device in all - subsequent NI-FGEN function calls. - ''' - resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding)) # case 3 - id_query_ctype = visatype.ViBoolean(id_query) # case 8 - reset_device_ctype = visatype.ViBoolean(reset_device) # case 8 - option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case 3 - vi_ctype = visatype.ViSession() # case 13 - error_code = self._library.niFgen_InitWithOptions(resource_name_ctype, id_query_ctype, reset_device_ctype, option_string_ctype, ctypes.pointer(vi_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return int(vi_ctype.value) - - def initialize_analog_output_calibration(self): - '''initialize_analog_output_calibration - - Sets up the device to start the analog output calibration. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_InitializeAnalogOutputCalibration(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def initialize_cal_adc_calibration(self): - '''initialize_cal_adc_calibration - - Initializes an external calibration session for ADC calibration. For the - NI 5421/5422/5441, ADC calibration involves characterizing the gain and - offset of the onboard ADC. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_InitializeCalADCCalibration(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def initialize_flatness_calibration(self): - '''initialize_flatness_calibration - - Initializes an external calibration session to calibrate flatness. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_InitializeFlatnessCalibration(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def initialize_oscillator_frequency_calibration(self): - '''initialize_oscillator_frequency_calibration - - Sets up the device to start the VCXO calibration. - - The session handle should be the handle returned by the - nifgen_InitExtCal function. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_InitializeOscillatorFrequencyCalibration(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def _initiate_generation(self): '''_initiate_generation @@ -6718,23 +5013,6 @@ def is_done(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(done_ctype.value) - def manual_enable_p2_p_stream(self, endpoint_name): - '''manual_enable_p2_p_stream - - Enables a peer-to-peer data stream using manual flow control. - - Args: - endpoint_name (string): Specifies the stream endpoint FIFO to configure. Refer to the - `Peer-to-Peer Data - Streaming `__ - documentation in the *NI Signal Generators Help* for more information. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - endpoint_name_ctype = ctypes.create_string_buffer(endpoint_name.encode(self._encoding)) # case 3 - error_code = self._library.niFgen_ManualEnableP2PStream(vi_ctype, endpoint_name_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def query_arb_seq_capabilities(self): '''query_arb_seq_capabilities @@ -6849,38 +5127,6 @@ def query_freq_list_capabilities(self): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(maximum_number_of_freq_lists_ctype.value), int(minimum_frequency_list_length_ctype.value), int(maximum_frequency_list_length_ctype.value), float(minimum_frequency_list_duration_ctype.value), float(maximum_frequency_list_duration_ctype.value), float(frequency_list_duration_quantum_ctype.value) - def read_cal_adc(self, number_of_reads_to_average, return_calibrated_value): - '''read_cal_adc - - Takes one or more voltage measurements from the onboard calibration ADC - and returns the value or the average value. The signal that the ADC - actually measures can be specified using the - CAL_ADC_INPUT attribute. The ADC has some inherent gain - and offset. These values can be determined during an external - calibration session and stored in the calibration EEPROM. - - If the **returnCalibratedValue** parameter is VI_TRUE, NI-FGEN adjusts - the value that is returned to account for the gain and offset of the - ADC. Otherwise, the raw voltage value reported by the ADC is returned. - - Args: - number_of_reads_to_average (int): Specifies the number of measurements to be taken and averaged to - determine the return value. - return_calibrated_value (bool): Specifies whether the voltage returned from the ADC should be adjusted - to account for the gain and offset of the ADC. - - Returns: - cal_adc_value (float): Specifies the average of the voltage measurements taken from the onboard - calibration ADC. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - number_of_reads_to_average_ctype = visatype.ViInt32(number_of_reads_to_average) # case 8 - return_calibrated_value_ctype = visatype.ViBoolean(return_calibrated_value) # case 8 - cal_adc_value_ctype = visatype.ViReal64() # case 13 - error_code = self._library.niFgen_ReadCalADC(vi_ctype, number_of_reads_to_average_ctype, return_calibrated_value_ctype, ctypes.pointer(cal_adc_value_ctype)) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(cal_adc_value_ctype.value) - def read_current_temperature(self): '''read_current_temperature @@ -6946,7 +5192,7 @@ def send_software_edge_trigger(self, trigger, trigger_id): NI 5401/5411/5431. Args: - trigger (int): Sets the clock mode of the signal generator. + trigger (enums.Trigger): Sets the clock mode of the signal generator. ****Defined Values**** @@ -6959,29 +5205,16 @@ def send_software_edge_trigger(self, trigger, trigger_id): +----------------------------+ trigger_id (string): ''' + if type(trigger) is not enums.Trigger: + raise TypeError('Parameter mode must be of type ' + str(enums.Trigger)) vi_ctype = visatype.ViSession(self._vi) # case 1 - trigger_ctype = visatype.ViInt32(trigger) # case 8 + trigger_ctype = visatype.ViInt32(trigger.value) # case 9 trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case 3 error_code = self._library.niFgen_SendSoftwareEdgeTrigger(vi_ctype, trigger_ctype, trigger_id_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def send_software_trigger(self): - '''send_software_trigger - - Sends a command to trigger the signal generator. - - Note: - This function can act as an override for an external edge trigger. - However, the NI 5401/5411/5431 do not support overriding an external - digital edge trigger. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - error_code = self._library.niFgen_SendSoftwareTrigger(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def wait_until_done(self, max_time): + def wait_until_done(self, max_time=10000): '''wait_until_done Waits until the device is done generating or until the maximum time has @@ -6996,28 +5229,6 @@ def wait_until_done(self, max_time): errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_p2_p_endpoint_i16(self, endpoint_name, number_of_samples, endpoint_data): - '''write_p2_p_endpoint_i16 - - Writes I16 data to the peer-to-peer endpoint. Use this function to write - initial data from the host to the endpoint before starting generation to - avoid an underflow at start. - - Args: - endpoint_name (string): Specifies the name of the FIFO endpoint. Data is written to the endpoint - FIFO. - number_of_samples (int): Specifies the number of samples to write into the endpoint FIFO. - endpoint_data (list of int): Specifies the array of data to write into the endpoint FIFO. The binary - data is left-justified. - ''' - vi_ctype = visatype.ViSession(self._vi) # case 1 - endpoint_name_ctype = ctypes.create_string_buffer(endpoint_name.encode(self._encoding)) # case 3 - number_of_samples_ctype = visatype.ViInt32(number_of_samples) # case 8 - endpoint_data_ctype = (visatype.ViInt16 * len(endpoint_data))(*endpoint_data) # case 4 - error_code = self._library.niFgen_WriteP2PEndpointI16(vi_ctype, endpoint_name_ctype, number_of_samples_ctype, endpoint_data_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def _close(self): '''_close diff --git a/generated/nifgen/tests/mock_helper.py b/generated/nifgen/tests/mock_helper.py index eabc3c3ec..c575c8397 100644 --- a/generated/nifgen/tests/mock_helper.py +++ b/generated/nifgen/tests/mock_helper.py @@ -23,18 +23,6 @@ def __init__(self): self._defaults['AllocateWaveform'] = {} self._defaults['AllocateWaveform']['return'] = 0 self._defaults['AllocateWaveform']['waveformHandle'] = None - self._defaults['CheckAttributeViBoolean'] = {} - self._defaults['CheckAttributeViBoolean']['return'] = 0 - self._defaults['CheckAttributeViInt32'] = {} - self._defaults['CheckAttributeViInt32']['return'] = 0 - self._defaults['CheckAttributeViInt64'] = {} - self._defaults['CheckAttributeViInt64']['return'] = 0 - self._defaults['CheckAttributeViReal64'] = {} - self._defaults['CheckAttributeViReal64']['return'] = 0 - self._defaults['CheckAttributeViSession'] = {} - self._defaults['CheckAttributeViSession']['return'] = 0 - self._defaults['CheckAttributeViString'] = {} - self._defaults['CheckAttributeViString']['return'] = 0 self._defaults['ClearArbMemory'] = {} self._defaults['ClearArbMemory']['return'] = 0 self._defaults['ClearArbSequence'] = {} @@ -47,16 +35,10 @@ def __init__(self): self._defaults['ClearUserStandardWaveform']['return'] = 0 self._defaults['Commit'] = {} self._defaults['Commit']['return'] = 0 - self._defaults['ConfigureAmplitude'] = {} - self._defaults['ConfigureAmplitude']['return'] = 0 self._defaults['ConfigureArbSequence'] = {} self._defaults['ConfigureArbSequence']['return'] = 0 self._defaults['ConfigureArbWaveform'] = {} self._defaults['ConfigureArbWaveform']['return'] = 0 - self._defaults['ConfigureChannels'] = {} - self._defaults['ConfigureChannels']['return'] = 0 - self._defaults['ConfigureClockMode'] = {} - self._defaults['ConfigureClockMode']['return'] = 0 self._defaults['ConfigureCustomFIRFilterCoefficients'] = {} self._defaults['ConfigureCustomFIRFilterCoefficients']['return'] = 0 self._defaults['ConfigureDigitalEdgeScriptTrigger'] = {} @@ -67,44 +49,8 @@ def __init__(self): self._defaults['ConfigureDigitalLevelScriptTrigger']['return'] = 0 self._defaults['ConfigureFreqList'] = {} self._defaults['ConfigureFreqList']['return'] = 0 - self._defaults['ConfigureFrequency'] = {} - self._defaults['ConfigureFrequency']['return'] = 0 - self._defaults['ConfigureGain'] = {} - self._defaults['ConfigureGain']['return'] = 0 - self._defaults['ConfigureOperationMode'] = {} - self._defaults['ConfigureOperationMode']['return'] = 0 - self._defaults['ConfigureOutputEnabled'] = {} - self._defaults['ConfigureOutputEnabled']['return'] = 0 - self._defaults['ConfigureOutputImpedance'] = {} - self._defaults['ConfigureOutputImpedance']['return'] = 0 - self._defaults['ConfigureOutputMode'] = {} - self._defaults['ConfigureOutputMode']['return'] = 0 - self._defaults['ConfigureP2PEndpointFullnessStartTrigger'] = {} - self._defaults['ConfigureP2PEndpointFullnessStartTrigger']['return'] = 0 - self._defaults['ConfigureRefClockFrequency'] = {} - self._defaults['ConfigureRefClockFrequency']['return'] = 0 - self._defaults['ConfigureRefClockSource'] = {} - self._defaults['ConfigureRefClockSource']['return'] = 0 - self._defaults['ConfigureReferenceClock'] = {} - self._defaults['ConfigureReferenceClock']['return'] = 0 - self._defaults['ConfigureSampleClockSource'] = {} - self._defaults['ConfigureSampleClockSource']['return'] = 0 - self._defaults['ConfigureSampleRate'] = {} - self._defaults['ConfigureSampleRate']['return'] = 0 - self._defaults['ConfigureSoftwareEdgeScriptTrigger'] = {} - self._defaults['ConfigureSoftwareEdgeScriptTrigger']['return'] = 0 - self._defaults['ConfigureSoftwareEdgeStartTrigger'] = {} - self._defaults['ConfigureSoftwareEdgeStartTrigger']['return'] = 0 self._defaults['ConfigureStandardWaveform'] = {} self._defaults['ConfigureStandardWaveform']['return'] = 0 - self._defaults['ConfigureSynchronization'] = {} - self._defaults['ConfigureSynchronization']['return'] = 0 - self._defaults['ConfigureTriggerMode'] = {} - self._defaults['ConfigureTriggerMode']['return'] = 0 - self._defaults['ConfigureTriggerSource'] = {} - self._defaults['ConfigureTriggerSource']['return'] = 0 - self._defaults['ConfigureUpdateClockSource'] = {} - self._defaults['ConfigureUpdateClockSource']['return'] = 0 self._defaults['CreateAdvancedArbSequence'] = {} self._defaults['CreateAdvancedArbSequence']['return'] = 0 self._defaults['CreateAdvancedArbSequence']['coercedMarkersArray'] = None @@ -112,12 +58,6 @@ def __init__(self): self._defaults['CreateArbSequence'] = {} self._defaults['CreateArbSequence']['return'] = 0 self._defaults['CreateArbSequence']['sequenceHandle'] = None - self._defaults['CreateArbWaveform'] = {} - self._defaults['CreateArbWaveform']['return'] = 0 - self._defaults['CreateArbWaveform']['waveformHandle'] = None - self._defaults['CreateBinary16ArbWaveform'] = {} - self._defaults['CreateBinary16ArbWaveform']['return'] = 0 - self._defaults['CreateBinary16ArbWaveform']['waveformHandle'] = None self._defaults['CreateFreqList'] = {} self._defaults['CreateFreqList']['return'] = 0 self._defaults['CreateFreqList']['frequencyListHandle'] = None @@ -127,9 +67,6 @@ def __init__(self): self._defaults['CreateWaveformFromFileF64'] = {} self._defaults['CreateWaveformFromFileF64']['return'] = 0 self._defaults['CreateWaveformFromFileF64']['waveformHandle'] = None - self._defaults['CreateWaveformFromFileHWS'] = {} - self._defaults['CreateWaveformFromFileHWS']['return'] = 0 - self._defaults['CreateWaveformFromFileHWS']['waveformHandle'] = None self._defaults['CreateWaveformFromFileI16'] = {} self._defaults['CreateWaveformFromFileI16']['return'] = 0 self._defaults['CreateWaveformFromFileI16']['waveformHandle'] = None @@ -144,25 +81,6 @@ def __init__(self): self._defaults['DeleteScript']['return'] = 0 self._defaults['Disable'] = {} self._defaults['Disable']['return'] = 0 - self._defaults['DisableAnalogFilter'] = {} - self._defaults['DisableAnalogFilter']['return'] = 0 - self._defaults['DisableDigitalFilter'] = {} - self._defaults['DisableDigitalFilter']['return'] = 0 - self._defaults['DisableDigitalPatterning'] = {} - self._defaults['DisableDigitalPatterning']['return'] = 0 - self._defaults['DisableScriptTrigger'] = {} - self._defaults['DisableScriptTrigger']['return'] = 0 - self._defaults['DisableStartTrigger'] = {} - self._defaults['DisableStartTrigger']['return'] = 0 - self._defaults['EnableAnalogFilter'] = {} - self._defaults['EnableAnalogFilter']['return'] = 0 - self._defaults['EnableDigitalFilter'] = {} - self._defaults['EnableDigitalFilter']['return'] = 0 - self._defaults['EnableDigitalPatterning'] = {} - self._defaults['EnableDigitalPatterning']['return'] = 0 - self._defaults['ErrorHandler'] = {} - self._defaults['ErrorHandler']['return'] = 0 - self._defaults['ErrorHandler']['errorMessage'] = None self._defaults['ExportSignal'] = {} self._defaults['ExportSignal']['return'] = 0 self._defaults['GetAttributeViBoolean'] = {} @@ -184,8 +102,23 @@ def __init__(self): self._defaults['GetError']['return'] = 0 self._defaults['GetError']['errorCode'] = None self._defaults['GetError']['errorDescription'] = None + self._defaults['GetExtCalLastDateAndTime'] = {} + self._defaults['GetExtCalLastDateAndTime']['return'] = 0 + self._defaults['GetExtCalLastDateAndTime']['Year'] = None + self._defaults['GetExtCalLastDateAndTime']['Month'] = None + self._defaults['GetExtCalLastDateAndTime']['Day'] = None + self._defaults['GetExtCalLastDateAndTime']['Hour'] = None + self._defaults['GetExtCalLastDateAndTime']['Minute'] = None + self._defaults['GetExtCalLastTemp'] = {} + self._defaults['GetExtCalLastTemp']['return'] = 0 + self._defaults['GetExtCalLastTemp']['Temperature'] = None + self._defaults['GetExtCalRecommendedInterval'] = {} + self._defaults['GetExtCalRecommendedInterval']['return'] = 0 + self._defaults['GetExtCalRecommendedInterval']['Months'] = None self._defaults['GetFIRFilterCoefficients'] = {} self._defaults['GetFIRFilterCoefficients']['return'] = 0 + self._defaults['GetFIRFilterCoefficients']['numberOfCoefficientsRead'] = None + self._defaults['GetFIRFilterCoefficients']['coefficientsArray'] = None self._defaults['GetHardwareState'] = {} self._defaults['GetHardwareState']['return'] = 0 self._defaults['GetHardwareState']['state'] = None @@ -202,17 +135,6 @@ def __init__(self): self._defaults['GetSelfCalSupported'] = {} self._defaults['GetSelfCalSupported']['return'] = 0 self._defaults['GetSelfCalSupported']['selfCalSupported'] = None - self._defaults['InitWithOptions'] = {} - self._defaults['InitWithOptions']['return'] = 0 - self._defaults['InitWithOptions']['vi'] = None - self._defaults['InitializeAnalogOutputCalibration'] = {} - self._defaults['InitializeAnalogOutputCalibration']['return'] = 0 - self._defaults['InitializeCalADCCalibration'] = {} - self._defaults['InitializeCalADCCalibration']['return'] = 0 - self._defaults['InitializeFlatnessCalibration'] = {} - self._defaults['InitializeFlatnessCalibration']['return'] = 0 - self._defaults['InitializeOscillatorFrequencyCalibration'] = {} - self._defaults['InitializeOscillatorFrequencyCalibration']['return'] = 0 self._defaults['InitializeWithChannels'] = {} self._defaults['InitializeWithChannels']['return'] = 0 self._defaults['InitializeWithChannels']['vi'] = None @@ -221,8 +143,6 @@ def __init__(self): self._defaults['IsDone'] = {} self._defaults['IsDone']['return'] = 0 self._defaults['IsDone']['Done'] = None - self._defaults['ManualEnableP2PStream'] = {} - self._defaults['ManualEnableP2PStream']['return'] = 0 self._defaults['QueryArbSeqCapabilities'] = {} self._defaults['QueryArbSeqCapabilities']['return'] = 0 self._defaults['QueryArbSeqCapabilities']['maximumNumberOfSequences'] = None @@ -243,26 +163,17 @@ def __init__(self): self._defaults['QueryFreqListCapabilities']['minimumFrequencyListDuration'] = None self._defaults['QueryFreqListCapabilities']['maximumFrequencyListDuration'] = None self._defaults['QueryFreqListCapabilities']['frequencyListDurationQuantum'] = None - self._defaults['ReadCalADC'] = {} - self._defaults['ReadCalADC']['return'] = 0 - self._defaults['ReadCalADC']['calAdcValue'] = None self._defaults['ReadCurrentTemperature'] = {} self._defaults['ReadCurrentTemperature']['return'] = 0 self._defaults['ReadCurrentTemperature']['Temperature'] = None - self._defaults['ResetAttribute'] = {} - self._defaults['ResetAttribute']['return'] = 0 self._defaults['ResetDevice'] = {} self._defaults['ResetDevice']['return'] = 0 self._defaults['ResetWithDefaults'] = {} self._defaults['ResetWithDefaults']['return'] = 0 - self._defaults['RouteSignalOut'] = {} - self._defaults['RouteSignalOut']['return'] = 0 self._defaults['SelfCal'] = {} self._defaults['SelfCal']['return'] = 0 self._defaults['SendSoftwareEdgeTrigger'] = {} self._defaults['SendSoftwareEdgeTrigger']['return'] = 0 - self._defaults['SendSoftwareTrigger'] = {} - self._defaults['SendSoftwareTrigger']['return'] = 0 self._defaults['SetAttributeViBoolean'] = {} self._defaults['SetAttributeViBoolean']['return'] = 0 self._defaults['SetAttributeViInt32'] = {} @@ -279,16 +190,12 @@ def __init__(self): self._defaults['SetWaveformNextWritePosition']['return'] = 0 self._defaults['WaitUntilDone'] = {} self._defaults['WaitUntilDone']['return'] = 0 - self._defaults['WriteBinary16AnalogStaticValue'] = {} - self._defaults['WriteBinary16AnalogStaticValue']['return'] = 0 self._defaults['WriteBinary16Waveform'] = {} self._defaults['WriteBinary16Waveform']['return'] = 0 self._defaults['WriteNamedWaveformF64'] = {} self._defaults['WriteNamedWaveformF64']['return'] = 0 self._defaults['WriteNamedWaveformI16'] = {} self._defaults['WriteNamedWaveformI16']['return'] = 0 - self._defaults['WriteP2PEndpointI16'] = {} - self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} self._defaults['WriteScript']['return'] = 0 self._defaults['WriteWaveform'] = {} @@ -334,36 +241,6 @@ def niFgen_AllocateWaveform(self, vi, channel_name, waveform_size, waveform_hand waveform_handle.contents.value = self._defaults['AllocateWaveform']['waveformHandle'] return self._defaults['AllocateWaveform']['return'] - def niFgen_CheckAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViBoolean']['return'] != 0: - return self._defaults['CheckAttributeViBoolean']['return'] - return self._defaults['CheckAttributeViBoolean']['return'] - - def niFgen_CheckAttributeViInt32(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViInt32']['return'] != 0: - return self._defaults['CheckAttributeViInt32']['return'] - return self._defaults['CheckAttributeViInt32']['return'] - - def niFgen_CheckAttributeViInt64(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViInt64']['return'] != 0: - return self._defaults['CheckAttributeViInt64']['return'] - return self._defaults['CheckAttributeViInt64']['return'] - - def niFgen_CheckAttributeViReal64(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViReal64']['return'] != 0: - return self._defaults['CheckAttributeViReal64']['return'] - return self._defaults['CheckAttributeViReal64']['return'] - - def niFgen_CheckAttributeViSession(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViSession']['return'] != 0: - return self._defaults['CheckAttributeViSession']['return'] - return self._defaults['CheckAttributeViSession']['return'] - - def niFgen_CheckAttributeViString(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 - if self._defaults['CheckAttributeViString']['return'] != 0: - return self._defaults['CheckAttributeViString']['return'] - return self._defaults['CheckAttributeViString']['return'] - def niFgen_ClearArbMemory(self, vi): # noqa: N802 if self._defaults['ClearArbMemory']['return'] != 0: return self._defaults['ClearArbMemory']['return'] @@ -394,11 +271,6 @@ def niFgen_Commit(self, vi): # noqa: N802 return self._defaults['Commit']['return'] return self._defaults['Commit']['return'] - def niFgen_ConfigureAmplitude(self, vi, channel_name, amplitude): # noqa: N802 - if self._defaults['ConfigureAmplitude']['return'] != 0: - return self._defaults['ConfigureAmplitude']['return'] - return self._defaults['ConfigureAmplitude']['return'] - def niFgen_ConfigureArbSequence(self, vi, channel_name, sequence_handle, gain, offset): # noqa: N802 if self._defaults['ConfigureArbSequence']['return'] != 0: return self._defaults['ConfigureArbSequence']['return'] @@ -409,16 +281,6 @@ def niFgen_ConfigureArbWaveform(self, vi, channel_name, waveform_handle, gain, o return self._defaults['ConfigureArbWaveform']['return'] return self._defaults['ConfigureArbWaveform']['return'] - def niFgen_ConfigureChannels(self, vi, channels): # noqa: N802 - if self._defaults['ConfigureChannels']['return'] != 0: - return self._defaults['ConfigureChannels']['return'] - return self._defaults['ConfigureChannels']['return'] - - def niFgen_ConfigureClockMode(self, vi, clock_mode): # noqa: N802 - if self._defaults['ConfigureClockMode']['return'] != 0: - return self._defaults['ConfigureClockMode']['return'] - return self._defaults['ConfigureClockMode']['return'] - def niFgen_ConfigureCustomFIRFilterCoefficients(self, vi, channel_name, number_of_coefficients, coefficients_array): # noqa: N802 if self._defaults['ConfigureCustomFIRFilterCoefficients']['return'] != 0: return self._defaults['ConfigureCustomFIRFilterCoefficients']['return'] @@ -444,101 +306,11 @@ def niFgen_ConfigureFreqList(self, vi, channel_name, frequency_list_handle, ampl return self._defaults['ConfigureFreqList']['return'] return self._defaults['ConfigureFreqList']['return'] - def niFgen_ConfigureFrequency(self, vi, channel_name, frequency): # noqa: N802 - if self._defaults['ConfigureFrequency']['return'] != 0: - return self._defaults['ConfigureFrequency']['return'] - return self._defaults['ConfigureFrequency']['return'] - - def niFgen_ConfigureGain(self, vi, channel_name, gain): # noqa: N802 - if self._defaults['ConfigureGain']['return'] != 0: - return self._defaults['ConfigureGain']['return'] - return self._defaults['ConfigureGain']['return'] - - def niFgen_ConfigureOperationMode(self, vi, channel_name, operation_mode): # noqa: N802 - if self._defaults['ConfigureOperationMode']['return'] != 0: - return self._defaults['ConfigureOperationMode']['return'] - return self._defaults['ConfigureOperationMode']['return'] - - def niFgen_ConfigureOutputEnabled(self, vi, channel_name, enabled): # noqa: N802 - if self._defaults['ConfigureOutputEnabled']['return'] != 0: - return self._defaults['ConfigureOutputEnabled']['return'] - return self._defaults['ConfigureOutputEnabled']['return'] - - def niFgen_ConfigureOutputImpedance(self, vi, channel_name, impedance): # noqa: N802 - if self._defaults['ConfigureOutputImpedance']['return'] != 0: - return self._defaults['ConfigureOutputImpedance']['return'] - return self._defaults['ConfigureOutputImpedance']['return'] - - def niFgen_ConfigureOutputMode(self, vi, output_mode): # noqa: N802 - if self._defaults['ConfigureOutputMode']['return'] != 0: - return self._defaults['ConfigureOutputMode']['return'] - return self._defaults['ConfigureOutputMode']['return'] - - def niFgen_ConfigureP2PEndpointFullnessStartTrigger(self, vi, p2p_endpoint_fullness_level): # noqa: N802 - if self._defaults['ConfigureP2PEndpointFullnessStartTrigger']['return'] != 0: - return self._defaults['ConfigureP2PEndpointFullnessStartTrigger']['return'] - return self._defaults['ConfigureP2PEndpointFullnessStartTrigger']['return'] - - def niFgen_ConfigureRefClockFrequency(self, vi, reference_clock_frequency): # noqa: N802 - if self._defaults['ConfigureRefClockFrequency']['return'] != 0: - return self._defaults['ConfigureRefClockFrequency']['return'] - return self._defaults['ConfigureRefClockFrequency']['return'] - - def niFgen_ConfigureRefClockSource(self, vi, reference_clock_source): # noqa: N802 - if self._defaults['ConfigureRefClockSource']['return'] != 0: - return self._defaults['ConfigureRefClockSource']['return'] - return self._defaults['ConfigureRefClockSource']['return'] - - def niFgen_ConfigureReferenceClock(self, vi, reference_clock_source, reference_clock_frequency): # noqa: N802 - if self._defaults['ConfigureReferenceClock']['return'] != 0: - return self._defaults['ConfigureReferenceClock']['return'] - return self._defaults['ConfigureReferenceClock']['return'] - - def niFgen_ConfigureSampleClockSource(self, vi, sample_clock_source): # noqa: N802 - if self._defaults['ConfigureSampleClockSource']['return'] != 0: - return self._defaults['ConfigureSampleClockSource']['return'] - return self._defaults['ConfigureSampleClockSource']['return'] - - def niFgen_ConfigureSampleRate(self, vi, sample_rate): # noqa: N802 - if self._defaults['ConfigureSampleRate']['return'] != 0: - return self._defaults['ConfigureSampleRate']['return'] - return self._defaults['ConfigureSampleRate']['return'] - - def niFgen_ConfigureSoftwareEdgeScriptTrigger(self, vi, trigger_id): # noqa: N802 - if self._defaults['ConfigureSoftwareEdgeScriptTrigger']['return'] != 0: - return self._defaults['ConfigureSoftwareEdgeScriptTrigger']['return'] - return self._defaults['ConfigureSoftwareEdgeScriptTrigger']['return'] - - def niFgen_ConfigureSoftwareEdgeStartTrigger(self, vi): # noqa: N802 - if self._defaults['ConfigureSoftwareEdgeStartTrigger']['return'] != 0: - return self._defaults['ConfigureSoftwareEdgeStartTrigger']['return'] - return self._defaults['ConfigureSoftwareEdgeStartTrigger']['return'] - def niFgen_ConfigureStandardWaveform(self, vi, channel_name, waveform, amplitude, dc_offset, frequency, start_phase): # noqa: N802 if self._defaults['ConfigureStandardWaveform']['return'] != 0: return self._defaults['ConfigureStandardWaveform']['return'] return self._defaults['ConfigureStandardWaveform']['return'] - def niFgen_ConfigureSynchronization(self, vi, channel_name, synchronization_source): # noqa: N802 - if self._defaults['ConfigureSynchronization']['return'] != 0: - return self._defaults['ConfigureSynchronization']['return'] - return self._defaults['ConfigureSynchronization']['return'] - - def niFgen_ConfigureTriggerMode(self, vi, channel_name, trigger_mode): # noqa: N802 - if self._defaults['ConfigureTriggerMode']['return'] != 0: - return self._defaults['ConfigureTriggerMode']['return'] - return self._defaults['ConfigureTriggerMode']['return'] - - def niFgen_ConfigureTriggerSource(self, vi, channel_name, trigger_source): # noqa: N802 - if self._defaults['ConfigureTriggerSource']['return'] != 0: - return self._defaults['ConfigureTriggerSource']['return'] - return self._defaults['ConfigureTriggerSource']['return'] - - def niFgen_ConfigureUpdateClockSource(self, vi, update_clock_source): # noqa: N802 - if self._defaults['ConfigureUpdateClockSource']['return'] != 0: - return self._defaults['ConfigureUpdateClockSource']['return'] - return self._defaults['ConfigureUpdateClockSource']['return'] - def niFgen_CreateAdvancedArbSequence(self, vi, sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array, coerced_markers_array, sequence_handle): # noqa: N802 if self._defaults['CreateAdvancedArbSequence']['return'] != 0: return self._defaults['CreateAdvancedArbSequence']['return'] @@ -563,22 +335,6 @@ def niFgen_CreateArbSequence(self, vi, sequence_length, waveform_handles_array, sequence_handle.contents.value = self._defaults['CreateArbSequence']['sequenceHandle'] return self._defaults['CreateArbSequence']['return'] - def niFgen_CreateArbWaveform(self, vi, waveform_size, waveform_data_array, waveform_handle): # noqa: N802 - if self._defaults['CreateArbWaveform']['return'] != 0: - return self._defaults['CreateArbWaveform']['return'] - if self._defaults['CreateArbWaveform']['waveformHandle'] is None: - raise MockFunctionCallError("niFgen_CreateArbWaveform", param='waveformHandle') - waveform_handle.contents.value = self._defaults['CreateArbWaveform']['waveformHandle'] - return self._defaults['CreateArbWaveform']['return'] - - def niFgen_CreateBinary16ArbWaveform(self, vi, waveform_size, waveform_data_array, waveform_handle): # noqa: N802 - if self._defaults['CreateBinary16ArbWaveform']['return'] != 0: - return self._defaults['CreateBinary16ArbWaveform']['return'] - if self._defaults['CreateBinary16ArbWaveform']['waveformHandle'] is None: - raise MockFunctionCallError("niFgen_CreateBinary16ArbWaveform", param='waveformHandle') - waveform_handle.contents.value = self._defaults['CreateBinary16ArbWaveform']['waveformHandle'] - return self._defaults['CreateBinary16ArbWaveform']['return'] - def niFgen_CreateFreqList(self, vi, waveform, frequency_list_length, frequency_array, duration_array, frequency_list_handle): # noqa: N802 if self._defaults['CreateFreqList']['return'] != 0: return self._defaults['CreateFreqList']['return'] @@ -603,14 +359,6 @@ def niFgen_CreateWaveformFromFileF64(self, vi, channel_name, file_name, byte_ord waveform_handle.contents.value = self._defaults['CreateWaveformFromFileF64']['waveformHandle'] return self._defaults['CreateWaveformFromFileF64']['return'] - def niFgen_CreateWaveformFromFileHWS(self, vi, channel_name, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform, waveform_handle): # noqa: N802 - if self._defaults['CreateWaveformFromFileHWS']['return'] != 0: - return self._defaults['CreateWaveformFromFileHWS']['return'] - if self._defaults['CreateWaveformFromFileHWS']['waveformHandle'] is None: - raise MockFunctionCallError("niFgen_CreateWaveformFromFileHWS", param='waveformHandle') - waveform_handle.contents.value = self._defaults['CreateWaveformFromFileHWS']['waveformHandle'] - return self._defaults['CreateWaveformFromFileHWS']['return'] - def niFgen_CreateWaveformFromFileI16(self, vi, channel_name, file_name, byte_order, waveform_handle): # noqa: N802 if self._defaults['CreateWaveformFromFileI16']['return'] != 0: return self._defaults['CreateWaveformFromFileI16']['return'] @@ -647,59 +395,6 @@ def niFgen_Disable(self, vi): # noqa: N802 return self._defaults['Disable']['return'] return self._defaults['Disable']['return'] - def niFgen_DisableAnalogFilter(self, vi, channel_name): # noqa: N802 - if self._defaults['DisableAnalogFilter']['return'] != 0: - return self._defaults['DisableAnalogFilter']['return'] - return self._defaults['DisableAnalogFilter']['return'] - - def niFgen_DisableDigitalFilter(self, vi, channel_name): # noqa: N802 - if self._defaults['DisableDigitalFilter']['return'] != 0: - return self._defaults['DisableDigitalFilter']['return'] - return self._defaults['DisableDigitalFilter']['return'] - - def niFgen_DisableDigitalPatterning(self, vi, channel_name): # noqa: N802 - if self._defaults['DisableDigitalPatterning']['return'] != 0: - return self._defaults['DisableDigitalPatterning']['return'] - return self._defaults['DisableDigitalPatterning']['return'] - - def niFgen_DisableScriptTrigger(self, vi, trigger_id): # noqa: N802 - if self._defaults['DisableScriptTrigger']['return'] != 0: - return self._defaults['DisableScriptTrigger']['return'] - return self._defaults['DisableScriptTrigger']['return'] - - def niFgen_DisableStartTrigger(self, vi): # noqa: N802 - if self._defaults['DisableStartTrigger']['return'] != 0: - return self._defaults['DisableStartTrigger']['return'] - return self._defaults['DisableStartTrigger']['return'] - - def niFgen_EnableAnalogFilter(self, vi, channel_name, filter_correction_frequency): # noqa: N802 - if self._defaults['EnableAnalogFilter']['return'] != 0: - return self._defaults['EnableAnalogFilter']['return'] - return self._defaults['EnableAnalogFilter']['return'] - - def niFgen_EnableDigitalFilter(self, vi, channel_name): # noqa: N802 - if self._defaults['EnableDigitalFilter']['return'] != 0: - return self._defaults['EnableDigitalFilter']['return'] - return self._defaults['EnableDigitalFilter']['return'] - - def niFgen_EnableDigitalPatterning(self, vi, channel_name): # noqa: N802 - if self._defaults['EnableDigitalPatterning']['return'] != 0: - return self._defaults['EnableDigitalPatterning']['return'] - return self._defaults['EnableDigitalPatterning']['return'] - - def niFgen_ErrorHandler(self, vi, error_code, error_message): # noqa: N802 - if self._defaults['ErrorHandler']['return'] != 0: - return self._defaults['ErrorHandler']['return'] - if self._defaults['ErrorHandler']['errorMessage'] is None: - raise MockFunctionCallError("niFgen_ErrorHandler", param='errorMessage') - a = self._defaults['ErrorHandler']['errorMessage'] - import sys - if sys.version_info.major > 2 and type(a) is str: - a = a.encode('ascii') - for i in range(min(len(error_message), len(a))): - error_message[i] = a[i] - return self._defaults['ErrorHandler']['return'] - def niFgen_ExportSignal(self, vi, signal, signal_identifier, output_terminal): # noqa: N802 if self._defaults['ExportSignal']['return'] != 0: return self._defaults['ExportSignal']['return'] @@ -760,9 +455,54 @@ def niFgen_GetError(self, vi, error_code, error_description_buffer_size, error_d error_description.value = self._defaults['GetError']['errorDescription'].encode('ascii') return self._defaults['GetError']['return'] + def niFgen_GetExtCalLastDateAndTime(self, vi, year, month, day, hour, minute): # noqa: N802 + if self._defaults['GetExtCalLastDateAndTime']['return'] != 0: + return self._defaults['GetExtCalLastDateAndTime']['return'] + if self._defaults['GetExtCalLastDateAndTime']['Year'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastDateAndTime", param='Year') + year.contents.value = self._defaults['GetExtCalLastDateAndTime']['Year'] + if self._defaults['GetExtCalLastDateAndTime']['Month'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastDateAndTime", param='Month') + month.contents.value = self._defaults['GetExtCalLastDateAndTime']['Month'] + if self._defaults['GetExtCalLastDateAndTime']['Day'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastDateAndTime", param='Day') + day.contents.value = self._defaults['GetExtCalLastDateAndTime']['Day'] + if self._defaults['GetExtCalLastDateAndTime']['Hour'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastDateAndTime", param='Hour') + hour.contents.value = self._defaults['GetExtCalLastDateAndTime']['Hour'] + if self._defaults['GetExtCalLastDateAndTime']['Minute'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastDateAndTime", param='Minute') + minute.contents.value = self._defaults['GetExtCalLastDateAndTime']['Minute'] + return self._defaults['GetExtCalLastDateAndTime']['return'] + + def niFgen_GetExtCalLastTemp(self, vi, temperature): # noqa: N802 + if self._defaults['GetExtCalLastTemp']['return'] != 0: + return self._defaults['GetExtCalLastTemp']['return'] + if self._defaults['GetExtCalLastTemp']['Temperature'] is None: + raise MockFunctionCallError("niFgen_GetExtCalLastTemp", param='Temperature') + temperature.contents.value = self._defaults['GetExtCalLastTemp']['Temperature'] + return self._defaults['GetExtCalLastTemp']['return'] + + def niFgen_GetExtCalRecommendedInterval(self, vi, months): # noqa: N802 + if self._defaults['GetExtCalRecommendedInterval']['return'] != 0: + return self._defaults['GetExtCalRecommendedInterval']['return'] + if self._defaults['GetExtCalRecommendedInterval']['Months'] is None: + raise MockFunctionCallError("niFgen_GetExtCalRecommendedInterval", param='Months') + months.contents.value = self._defaults['GetExtCalRecommendedInterval']['Months'] + return self._defaults['GetExtCalRecommendedInterval']['return'] + def niFgen_GetFIRFilterCoefficients(self, vi, channel_name, array_size, coefficients_array, number_of_coefficients_read): # noqa: N802 if self._defaults['GetFIRFilterCoefficients']['return'] != 0: return self._defaults['GetFIRFilterCoefficients']['return'] + if self._defaults['GetFIRFilterCoefficients']['numberOfCoefficientsRead'] is None: + raise MockFunctionCallError("niFgen_GetFIRFilterCoefficients", param='numberOfCoefficientsRead') + number_of_coefficients_read.contents.value = self._defaults['GetFIRFilterCoefficients']['numberOfCoefficientsRead'] + if self._defaults['GetFIRFilterCoefficients']['coefficientsArray'] is None: + raise MockFunctionCallError("niFgen_GetFIRFilterCoefficients", param='coefficientsArray') + if array_size.value == 0: + return len(self._defaults['GetFIRFilterCoefficients']['coefficientsArray']) + for i in range(len(self._defaults['GetFIRFilterCoefficients']['coefficientsArray'])): + coefficients_array[i] = self._defaults['GetFIRFilterCoefficients']['coefficientsArray'][i] return self._defaults['GetFIRFilterCoefficients']['return'] def niFgen_GetHardwareState(self, vi, state): # noqa: N802 @@ -809,34 +549,6 @@ def niFgen_GetSelfCalSupported(self, vi, self_cal_supported): # noqa: N802 self_cal_supported.contents.value = self._defaults['GetSelfCalSupported']['selfCalSupported'] return self._defaults['GetSelfCalSupported']['return'] - def niFgen_InitWithOptions(self, resource_name, id_query, reset_device, option_string, vi): # noqa: N802 - if self._defaults['InitWithOptions']['return'] != 0: - return self._defaults['InitWithOptions']['return'] - if self._defaults['InitWithOptions']['vi'] is None: - raise MockFunctionCallError("niFgen_InitWithOptions", param='vi') - vi.contents.value = self._defaults['InitWithOptions']['vi'] - return self._defaults['InitWithOptions']['return'] - - def niFgen_InitializeAnalogOutputCalibration(self, vi): # noqa: N802 - if self._defaults['InitializeAnalogOutputCalibration']['return'] != 0: - return self._defaults['InitializeAnalogOutputCalibration']['return'] - return self._defaults['InitializeAnalogOutputCalibration']['return'] - - def niFgen_InitializeCalADCCalibration(self, vi): # noqa: N802 - if self._defaults['InitializeCalADCCalibration']['return'] != 0: - return self._defaults['InitializeCalADCCalibration']['return'] - return self._defaults['InitializeCalADCCalibration']['return'] - - def niFgen_InitializeFlatnessCalibration(self, vi): # noqa: N802 - if self._defaults['InitializeFlatnessCalibration']['return'] != 0: - return self._defaults['InitializeFlatnessCalibration']['return'] - return self._defaults['InitializeFlatnessCalibration']['return'] - - def niFgen_InitializeOscillatorFrequencyCalibration(self, vi): # noqa: N802 - if self._defaults['InitializeOscillatorFrequencyCalibration']['return'] != 0: - return self._defaults['InitializeOscillatorFrequencyCalibration']['return'] - return self._defaults['InitializeOscillatorFrequencyCalibration']['return'] - def niFgen_InitializeWithChannels(self, resource_name, channel_name, reset_device, option_string, vi): # noqa: N802 if self._defaults['InitializeWithChannels']['return'] != 0: return self._defaults['InitializeWithChannels']['return'] @@ -858,11 +570,6 @@ def niFgen_IsDone(self, vi, done): # noqa: N802 done.contents.value = self._defaults['IsDone']['Done'] return self._defaults['IsDone']['return'] - def niFgen_ManualEnableP2PStream(self, vi, endpoint_name): # noqa: N802 - if self._defaults['ManualEnableP2PStream']['return'] != 0: - return self._defaults['ManualEnableP2PStream']['return'] - return self._defaults['ManualEnableP2PStream']['return'] - def niFgen_QueryArbSeqCapabilities(self, vi, maximum_number_of_sequences, minimum_sequence_length, maximum_sequence_length, maximum_loop_count): # noqa: N802 if self._defaults['QueryArbSeqCapabilities']['return'] != 0: return self._defaults['QueryArbSeqCapabilities']['return'] @@ -920,14 +627,6 @@ def niFgen_QueryFreqListCapabilities(self, vi, maximum_number_of_freq_lists, min frequency_list_duration_quantum.contents.value = self._defaults['QueryFreqListCapabilities']['frequencyListDurationQuantum'] return self._defaults['QueryFreqListCapabilities']['return'] - def niFgen_ReadCalADC(self, vi, number_of_reads_to_average, return_calibrated_value, cal_adc_value): # noqa: N802 - if self._defaults['ReadCalADC']['return'] != 0: - return self._defaults['ReadCalADC']['return'] - if self._defaults['ReadCalADC']['calAdcValue'] is None: - raise MockFunctionCallError("niFgen_ReadCalADC", param='calAdcValue') - cal_adc_value.contents.value = self._defaults['ReadCalADC']['calAdcValue'] - return self._defaults['ReadCalADC']['return'] - def niFgen_ReadCurrentTemperature(self, vi, temperature): # noqa: N802 if self._defaults['ReadCurrentTemperature']['return'] != 0: return self._defaults['ReadCurrentTemperature']['return'] @@ -936,11 +635,6 @@ def niFgen_ReadCurrentTemperature(self, vi, temperature): # noqa: N802 temperature.contents.value = self._defaults['ReadCurrentTemperature']['Temperature'] return self._defaults['ReadCurrentTemperature']['return'] - def niFgen_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802 - if self._defaults['ResetAttribute']['return'] != 0: - return self._defaults['ResetAttribute']['return'] - return self._defaults['ResetAttribute']['return'] - def niFgen_ResetDevice(self, vi): # noqa: N802 if self._defaults['ResetDevice']['return'] != 0: return self._defaults['ResetDevice']['return'] @@ -951,11 +645,6 @@ def niFgen_ResetWithDefaults(self, vi): # noqa: N802 return self._defaults['ResetWithDefaults']['return'] return self._defaults['ResetWithDefaults']['return'] - def niFgen_RouteSignalOut(self, vi, channel_name, route_signal_from, route_signal_to): # noqa: N802 - if self._defaults['RouteSignalOut']['return'] != 0: - return self._defaults['RouteSignalOut']['return'] - return self._defaults['RouteSignalOut']['return'] - def niFgen_SelfCal(self, vi): # noqa: N802 if self._defaults['SelfCal']['return'] != 0: return self._defaults['SelfCal']['return'] @@ -966,11 +655,6 @@ def niFgen_SendSoftwareEdgeTrigger(self, vi, trigger, trigger_id): # noqa: N802 return self._defaults['SendSoftwareEdgeTrigger']['return'] return self._defaults['SendSoftwareEdgeTrigger']['return'] - def niFgen_SendSoftwareTrigger(self, vi): # noqa: N802 - if self._defaults['SendSoftwareTrigger']['return'] != 0: - return self._defaults['SendSoftwareTrigger']['return'] - return self._defaults['SendSoftwareTrigger']['return'] - def niFgen_SetAttributeViBoolean(self, vi, channel_name, attribute_id, attribute_value): # noqa: N802 if self._defaults['SetAttributeViBoolean']['return'] != 0: return self._defaults['SetAttributeViBoolean']['return'] @@ -1011,11 +695,6 @@ def niFgen_WaitUntilDone(self, vi, max_time): # noqa: N802 return self._defaults['WaitUntilDone']['return'] return self._defaults['WaitUntilDone']['return'] - def niFgen_WriteBinary16AnalogStaticValue(self, vi, channel_name, value): # noqa: N802 - if self._defaults['WriteBinary16AnalogStaticValue']['return'] != 0: - return self._defaults['WriteBinary16AnalogStaticValue']['return'] - return self._defaults['WriteBinary16AnalogStaticValue']['return'] - def niFgen_WriteBinary16Waveform(self, vi, channel_name, waveform_handle, size, data): # noqa: N802 if self._defaults['WriteBinary16Waveform']['return'] != 0: return self._defaults['WriteBinary16Waveform']['return'] @@ -1031,11 +710,6 @@ def niFgen_WriteNamedWaveformI16(self, vi, channel_name, waveform_name, size, da return self._defaults['WriteNamedWaveformI16']['return'] return self._defaults['WriteNamedWaveformI16']['return'] - def niFgen_WriteP2PEndpointI16(self, vi, endpoint_name, number_of_samples, endpoint_data): # noqa: N802 - if self._defaults['WriteP2PEndpointI16']['return'] != 0: - return self._defaults['WriteP2PEndpointI16']['return'] - return self._defaults['WriteP2PEndpointI16']['return'] - def niFgen_WriteScript(self, vi, channel_name, script): # noqa: N802 if self._defaults['WriteScript']['return'] != 0: return self._defaults['WriteScript']['return'] @@ -1095,18 +769,6 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_AllocateNamedWaveform.return_value = 0 mock_library.niFgen_AllocateWaveform.side_effect = MockFunctionCallError("niFgen_AllocateWaveform") mock_library.niFgen_AllocateWaveform.return_value = 0 - mock_library.niFgen_CheckAttributeViBoolean.side_effect = MockFunctionCallError("niFgen_CheckAttributeViBoolean") - mock_library.niFgen_CheckAttributeViBoolean.return_value = 0 - mock_library.niFgen_CheckAttributeViInt32.side_effect = MockFunctionCallError("niFgen_CheckAttributeViInt32") - mock_library.niFgen_CheckAttributeViInt32.return_value = 0 - mock_library.niFgen_CheckAttributeViInt64.side_effect = MockFunctionCallError("niFgen_CheckAttributeViInt64") - mock_library.niFgen_CheckAttributeViInt64.return_value = 0 - mock_library.niFgen_CheckAttributeViReal64.side_effect = MockFunctionCallError("niFgen_CheckAttributeViReal64") - mock_library.niFgen_CheckAttributeViReal64.return_value = 0 - mock_library.niFgen_CheckAttributeViSession.side_effect = MockFunctionCallError("niFgen_CheckAttributeViSession") - mock_library.niFgen_CheckAttributeViSession.return_value = 0 - mock_library.niFgen_CheckAttributeViString.side_effect = MockFunctionCallError("niFgen_CheckAttributeViString") - mock_library.niFgen_CheckAttributeViString.return_value = 0 mock_library.niFgen_ClearArbMemory.side_effect = MockFunctionCallError("niFgen_ClearArbMemory") mock_library.niFgen_ClearArbMemory.return_value = 0 mock_library.niFgen_ClearArbSequence.side_effect = MockFunctionCallError("niFgen_ClearArbSequence") @@ -1119,16 +781,10 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_ClearUserStandardWaveform.return_value = 0 mock_library.niFgen_Commit.side_effect = MockFunctionCallError("niFgen_Commit") mock_library.niFgen_Commit.return_value = 0 - mock_library.niFgen_ConfigureAmplitude.side_effect = MockFunctionCallError("niFgen_ConfigureAmplitude") - mock_library.niFgen_ConfigureAmplitude.return_value = 0 mock_library.niFgen_ConfigureArbSequence.side_effect = MockFunctionCallError("niFgen_ConfigureArbSequence") mock_library.niFgen_ConfigureArbSequence.return_value = 0 mock_library.niFgen_ConfigureArbWaveform.side_effect = MockFunctionCallError("niFgen_ConfigureArbWaveform") mock_library.niFgen_ConfigureArbWaveform.return_value = 0 - mock_library.niFgen_ConfigureChannels.side_effect = MockFunctionCallError("niFgen_ConfigureChannels") - mock_library.niFgen_ConfigureChannels.return_value = 0 - mock_library.niFgen_ConfigureClockMode.side_effect = MockFunctionCallError("niFgen_ConfigureClockMode") - mock_library.niFgen_ConfigureClockMode.return_value = 0 mock_library.niFgen_ConfigureCustomFIRFilterCoefficients.side_effect = MockFunctionCallError("niFgen_ConfigureCustomFIRFilterCoefficients") mock_library.niFgen_ConfigureCustomFIRFilterCoefficients.return_value = 0 mock_library.niFgen_ConfigureDigitalEdgeScriptTrigger.side_effect = MockFunctionCallError("niFgen_ConfigureDigitalEdgeScriptTrigger") @@ -1139,60 +795,18 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_ConfigureDigitalLevelScriptTrigger.return_value = 0 mock_library.niFgen_ConfigureFreqList.side_effect = MockFunctionCallError("niFgen_ConfigureFreqList") mock_library.niFgen_ConfigureFreqList.return_value = 0 - mock_library.niFgen_ConfigureFrequency.side_effect = MockFunctionCallError("niFgen_ConfigureFrequency") - mock_library.niFgen_ConfigureFrequency.return_value = 0 - mock_library.niFgen_ConfigureGain.side_effect = MockFunctionCallError("niFgen_ConfigureGain") - mock_library.niFgen_ConfigureGain.return_value = 0 - mock_library.niFgen_ConfigureOperationMode.side_effect = MockFunctionCallError("niFgen_ConfigureOperationMode") - mock_library.niFgen_ConfigureOperationMode.return_value = 0 - mock_library.niFgen_ConfigureOutputEnabled.side_effect = MockFunctionCallError("niFgen_ConfigureOutputEnabled") - mock_library.niFgen_ConfigureOutputEnabled.return_value = 0 - mock_library.niFgen_ConfigureOutputImpedance.side_effect = MockFunctionCallError("niFgen_ConfigureOutputImpedance") - mock_library.niFgen_ConfigureOutputImpedance.return_value = 0 - mock_library.niFgen_ConfigureOutputMode.side_effect = MockFunctionCallError("niFgen_ConfigureOutputMode") - mock_library.niFgen_ConfigureOutputMode.return_value = 0 - mock_library.niFgen_ConfigureP2PEndpointFullnessStartTrigger.side_effect = MockFunctionCallError("niFgen_ConfigureP2PEndpointFullnessStartTrigger") - mock_library.niFgen_ConfigureP2PEndpointFullnessStartTrigger.return_value = 0 - mock_library.niFgen_ConfigureRefClockFrequency.side_effect = MockFunctionCallError("niFgen_ConfigureRefClockFrequency") - mock_library.niFgen_ConfigureRefClockFrequency.return_value = 0 - mock_library.niFgen_ConfigureRefClockSource.side_effect = MockFunctionCallError("niFgen_ConfigureRefClockSource") - mock_library.niFgen_ConfigureRefClockSource.return_value = 0 - mock_library.niFgen_ConfigureReferenceClock.side_effect = MockFunctionCallError("niFgen_ConfigureReferenceClock") - mock_library.niFgen_ConfigureReferenceClock.return_value = 0 - mock_library.niFgen_ConfigureSampleClockSource.side_effect = MockFunctionCallError("niFgen_ConfigureSampleClockSource") - mock_library.niFgen_ConfigureSampleClockSource.return_value = 0 - mock_library.niFgen_ConfigureSampleRate.side_effect = MockFunctionCallError("niFgen_ConfigureSampleRate") - mock_library.niFgen_ConfigureSampleRate.return_value = 0 - mock_library.niFgen_ConfigureSoftwareEdgeScriptTrigger.side_effect = MockFunctionCallError("niFgen_ConfigureSoftwareEdgeScriptTrigger") - mock_library.niFgen_ConfigureSoftwareEdgeScriptTrigger.return_value = 0 - mock_library.niFgen_ConfigureSoftwareEdgeStartTrigger.side_effect = MockFunctionCallError("niFgen_ConfigureSoftwareEdgeStartTrigger") - mock_library.niFgen_ConfigureSoftwareEdgeStartTrigger.return_value = 0 mock_library.niFgen_ConfigureStandardWaveform.side_effect = MockFunctionCallError("niFgen_ConfigureStandardWaveform") mock_library.niFgen_ConfigureStandardWaveform.return_value = 0 - mock_library.niFgen_ConfigureSynchronization.side_effect = MockFunctionCallError("niFgen_ConfigureSynchronization") - mock_library.niFgen_ConfigureSynchronization.return_value = 0 - mock_library.niFgen_ConfigureTriggerMode.side_effect = MockFunctionCallError("niFgen_ConfigureTriggerMode") - mock_library.niFgen_ConfigureTriggerMode.return_value = 0 - mock_library.niFgen_ConfigureTriggerSource.side_effect = MockFunctionCallError("niFgen_ConfigureTriggerSource") - mock_library.niFgen_ConfigureTriggerSource.return_value = 0 - mock_library.niFgen_ConfigureUpdateClockSource.side_effect = MockFunctionCallError("niFgen_ConfigureUpdateClockSource") - mock_library.niFgen_ConfigureUpdateClockSource.return_value = 0 mock_library.niFgen_CreateAdvancedArbSequence.side_effect = MockFunctionCallError("niFgen_CreateAdvancedArbSequence") mock_library.niFgen_CreateAdvancedArbSequence.return_value = 0 mock_library.niFgen_CreateArbSequence.side_effect = MockFunctionCallError("niFgen_CreateArbSequence") mock_library.niFgen_CreateArbSequence.return_value = 0 - mock_library.niFgen_CreateArbWaveform.side_effect = MockFunctionCallError("niFgen_CreateArbWaveform") - mock_library.niFgen_CreateArbWaveform.return_value = 0 - mock_library.niFgen_CreateBinary16ArbWaveform.side_effect = MockFunctionCallError("niFgen_CreateBinary16ArbWaveform") - mock_library.niFgen_CreateBinary16ArbWaveform.return_value = 0 mock_library.niFgen_CreateFreqList.side_effect = MockFunctionCallError("niFgen_CreateFreqList") mock_library.niFgen_CreateFreqList.return_value = 0 mock_library.niFgen_CreateWaveformF64.side_effect = MockFunctionCallError("niFgen_CreateWaveformF64") mock_library.niFgen_CreateWaveformF64.return_value = 0 mock_library.niFgen_CreateWaveformFromFileF64.side_effect = MockFunctionCallError("niFgen_CreateWaveformFromFileF64") mock_library.niFgen_CreateWaveformFromFileF64.return_value = 0 - mock_library.niFgen_CreateWaveformFromFileHWS.side_effect = MockFunctionCallError("niFgen_CreateWaveformFromFileHWS") - mock_library.niFgen_CreateWaveformFromFileHWS.return_value = 0 mock_library.niFgen_CreateWaveformFromFileI16.side_effect = MockFunctionCallError("niFgen_CreateWaveformFromFileI16") mock_library.niFgen_CreateWaveformFromFileI16.return_value = 0 mock_library.niFgen_CreateWaveformI16.side_effect = MockFunctionCallError("niFgen_CreateWaveformI16") @@ -1205,24 +819,6 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_DeleteScript.return_value = 0 mock_library.niFgen_Disable.side_effect = MockFunctionCallError("niFgen_Disable") mock_library.niFgen_Disable.return_value = 0 - mock_library.niFgen_DisableAnalogFilter.side_effect = MockFunctionCallError("niFgen_DisableAnalogFilter") - mock_library.niFgen_DisableAnalogFilter.return_value = 0 - mock_library.niFgen_DisableDigitalFilter.side_effect = MockFunctionCallError("niFgen_DisableDigitalFilter") - mock_library.niFgen_DisableDigitalFilter.return_value = 0 - mock_library.niFgen_DisableDigitalPatterning.side_effect = MockFunctionCallError("niFgen_DisableDigitalPatterning") - mock_library.niFgen_DisableDigitalPatterning.return_value = 0 - mock_library.niFgen_DisableScriptTrigger.side_effect = MockFunctionCallError("niFgen_DisableScriptTrigger") - mock_library.niFgen_DisableScriptTrigger.return_value = 0 - mock_library.niFgen_DisableStartTrigger.side_effect = MockFunctionCallError("niFgen_DisableStartTrigger") - mock_library.niFgen_DisableStartTrigger.return_value = 0 - mock_library.niFgen_EnableAnalogFilter.side_effect = MockFunctionCallError("niFgen_EnableAnalogFilter") - mock_library.niFgen_EnableAnalogFilter.return_value = 0 - mock_library.niFgen_EnableDigitalFilter.side_effect = MockFunctionCallError("niFgen_EnableDigitalFilter") - mock_library.niFgen_EnableDigitalFilter.return_value = 0 - mock_library.niFgen_EnableDigitalPatterning.side_effect = MockFunctionCallError("niFgen_EnableDigitalPatterning") - mock_library.niFgen_EnableDigitalPatterning.return_value = 0 - mock_library.niFgen_ErrorHandler.side_effect = MockFunctionCallError("niFgen_ErrorHandler") - mock_library.niFgen_ErrorHandler.return_value = 0 mock_library.niFgen_ExportSignal.side_effect = MockFunctionCallError("niFgen_ExportSignal") mock_library.niFgen_ExportSignal.return_value = 0 mock_library.niFgen_GetAttributeViBoolean.side_effect = MockFunctionCallError("niFgen_GetAttributeViBoolean") @@ -1237,6 +833,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_GetAttributeViString.return_value = 0 mock_library.niFgen_GetError.side_effect = MockFunctionCallError("niFgen_GetError") mock_library.niFgen_GetError.return_value = 0 + mock_library.niFgen_GetExtCalLastDateAndTime.side_effect = MockFunctionCallError("niFgen_GetExtCalLastDateAndTime") + mock_library.niFgen_GetExtCalLastDateAndTime.return_value = 0 + mock_library.niFgen_GetExtCalLastTemp.side_effect = MockFunctionCallError("niFgen_GetExtCalLastTemp") + mock_library.niFgen_GetExtCalLastTemp.return_value = 0 + mock_library.niFgen_GetExtCalRecommendedInterval.side_effect = MockFunctionCallError("niFgen_GetExtCalRecommendedInterval") + mock_library.niFgen_GetExtCalRecommendedInterval.return_value = 0 mock_library.niFgen_GetFIRFilterCoefficients.side_effect = MockFunctionCallError("niFgen_GetFIRFilterCoefficients") mock_library.niFgen_GetFIRFilterCoefficients.return_value = 0 mock_library.niFgen_GetHardwareState.side_effect = MockFunctionCallError("niFgen_GetHardwareState") @@ -1247,48 +849,28 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_GetSelfCalLastTemp.return_value = 0 mock_library.niFgen_GetSelfCalSupported.side_effect = MockFunctionCallError("niFgen_GetSelfCalSupported") mock_library.niFgen_GetSelfCalSupported.return_value = 0 - mock_library.niFgen_InitWithOptions.side_effect = MockFunctionCallError("niFgen_InitWithOptions") - mock_library.niFgen_InitWithOptions.return_value = 0 - mock_library.niFgen_InitializeAnalogOutputCalibration.side_effect = MockFunctionCallError("niFgen_InitializeAnalogOutputCalibration") - mock_library.niFgen_InitializeAnalogOutputCalibration.return_value = 0 - mock_library.niFgen_InitializeCalADCCalibration.side_effect = MockFunctionCallError("niFgen_InitializeCalADCCalibration") - mock_library.niFgen_InitializeCalADCCalibration.return_value = 0 - mock_library.niFgen_InitializeFlatnessCalibration.side_effect = MockFunctionCallError("niFgen_InitializeFlatnessCalibration") - mock_library.niFgen_InitializeFlatnessCalibration.return_value = 0 - mock_library.niFgen_InitializeOscillatorFrequencyCalibration.side_effect = MockFunctionCallError("niFgen_InitializeOscillatorFrequencyCalibration") - mock_library.niFgen_InitializeOscillatorFrequencyCalibration.return_value = 0 mock_library.niFgen_InitializeWithChannels.side_effect = MockFunctionCallError("niFgen_InitializeWithChannels") mock_library.niFgen_InitializeWithChannels.return_value = 0 mock_library.niFgen_InitiateGeneration.side_effect = MockFunctionCallError("niFgen_InitiateGeneration") mock_library.niFgen_InitiateGeneration.return_value = 0 mock_library.niFgen_IsDone.side_effect = MockFunctionCallError("niFgen_IsDone") mock_library.niFgen_IsDone.return_value = 0 - mock_library.niFgen_ManualEnableP2PStream.side_effect = MockFunctionCallError("niFgen_ManualEnableP2PStream") - mock_library.niFgen_ManualEnableP2PStream.return_value = 0 mock_library.niFgen_QueryArbSeqCapabilities.side_effect = MockFunctionCallError("niFgen_QueryArbSeqCapabilities") mock_library.niFgen_QueryArbSeqCapabilities.return_value = 0 mock_library.niFgen_QueryArbWfmCapabilities.side_effect = MockFunctionCallError("niFgen_QueryArbWfmCapabilities") mock_library.niFgen_QueryArbWfmCapabilities.return_value = 0 mock_library.niFgen_QueryFreqListCapabilities.side_effect = MockFunctionCallError("niFgen_QueryFreqListCapabilities") mock_library.niFgen_QueryFreqListCapabilities.return_value = 0 - mock_library.niFgen_ReadCalADC.side_effect = MockFunctionCallError("niFgen_ReadCalADC") - mock_library.niFgen_ReadCalADC.return_value = 0 mock_library.niFgen_ReadCurrentTemperature.side_effect = MockFunctionCallError("niFgen_ReadCurrentTemperature") mock_library.niFgen_ReadCurrentTemperature.return_value = 0 - mock_library.niFgen_ResetAttribute.side_effect = MockFunctionCallError("niFgen_ResetAttribute") - mock_library.niFgen_ResetAttribute.return_value = 0 mock_library.niFgen_ResetDevice.side_effect = MockFunctionCallError("niFgen_ResetDevice") mock_library.niFgen_ResetDevice.return_value = 0 mock_library.niFgen_ResetWithDefaults.side_effect = MockFunctionCallError("niFgen_ResetWithDefaults") mock_library.niFgen_ResetWithDefaults.return_value = 0 - mock_library.niFgen_RouteSignalOut.side_effect = MockFunctionCallError("niFgen_RouteSignalOut") - mock_library.niFgen_RouteSignalOut.return_value = 0 mock_library.niFgen_SelfCal.side_effect = MockFunctionCallError("niFgen_SelfCal") mock_library.niFgen_SelfCal.return_value = 0 mock_library.niFgen_SendSoftwareEdgeTrigger.side_effect = MockFunctionCallError("niFgen_SendSoftwareEdgeTrigger") mock_library.niFgen_SendSoftwareEdgeTrigger.return_value = 0 - mock_library.niFgen_SendSoftwareTrigger.side_effect = MockFunctionCallError("niFgen_SendSoftwareTrigger") - mock_library.niFgen_SendSoftwareTrigger.return_value = 0 mock_library.niFgen_SetAttributeViBoolean.side_effect = MockFunctionCallError("niFgen_SetAttributeViBoolean") mock_library.niFgen_SetAttributeViBoolean.return_value = 0 mock_library.niFgen_SetAttributeViInt32.side_effect = MockFunctionCallError("niFgen_SetAttributeViInt32") @@ -1305,16 +887,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFgen_SetWaveformNextWritePosition.return_value = 0 mock_library.niFgen_WaitUntilDone.side_effect = MockFunctionCallError("niFgen_WaitUntilDone") mock_library.niFgen_WaitUntilDone.return_value = 0 - mock_library.niFgen_WriteBinary16AnalogStaticValue.side_effect = MockFunctionCallError("niFgen_WriteBinary16AnalogStaticValue") - mock_library.niFgen_WriteBinary16AnalogStaticValue.return_value = 0 mock_library.niFgen_WriteBinary16Waveform.side_effect = MockFunctionCallError("niFgen_WriteBinary16Waveform") mock_library.niFgen_WriteBinary16Waveform.return_value = 0 mock_library.niFgen_WriteNamedWaveformF64.side_effect = MockFunctionCallError("niFgen_WriteNamedWaveformF64") mock_library.niFgen_WriteNamedWaveformF64.return_value = 0 mock_library.niFgen_WriteNamedWaveformI16.side_effect = MockFunctionCallError("niFgen_WriteNamedWaveformI16") mock_library.niFgen_WriteNamedWaveformI16.return_value = 0 - mock_library.niFgen_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niFgen_WriteP2PEndpointI16") - mock_library.niFgen_WriteP2PEndpointI16.return_value = 0 mock_library.niFgen_WriteScript.side_effect = MockFunctionCallError("niFgen_WriteScript") mock_library.niFgen_WriteScript.return_value = 0 mock_library.niFgen_WriteWaveform.side_effect = MockFunctionCallError("niFgen_WriteWaveform") diff --git a/src/nifgen/metadata/config.py b/src/nifgen/metadata/config.py index 7dd8012ee..d9d50cceb 100644 --- a/src/nifgen/metadata/config.py +++ b/src/nifgen/metadata/config.py @@ -21,6 +21,6 @@ 'initiate_function': 'InitiateGeneration', 'abort_function': 'AbortGeneration', }, - 'init_function': 'InitWithOptions', + 'init_function': 'InitializeWithChannels', } diff --git a/src/nifgen/metadata/functions_addon.py b/src/nifgen/metadata/functions_addon.py index adbbff38e..3176f6b7e 100644 --- a/src/nifgen/metadata/functions_addon.py +++ b/src/nifgen/metadata/functions_addon.py @@ -1,5 +1,3 @@ -# TODO(texasaggie97) update this file with all NI-FGEN function information - # These dictionaries are applied to the generated functions dictionary at build time # Any changes to the API should be made here. functions.py is code generated @@ -7,35 +5,77 @@ # This will override that with private - add '_' to the beginning of the name, or # don't generate at all functions_codegen_method = { - 'InitWithOptions': { 'codegen_method': 'private', }, - 'Initiate': { 'codegen_method': 'private', }, - 'close': { 'codegen_method': 'private', }, - 'Abort': { 'codegen_method': 'private', }, - '.etAttribute.+': { 'codegen_method': 'private', }, # All Set/Get Attribute functions are private - 'init': { 'codegen_method': 'no', }, - 'error_message': { 'codegen_method': 'private', }, - 'GetError': { 'codegen_method': 'private', }, - 'ClearError': { 'codegen_method': 'no', }, - 'LockSession': { 'codegen_method': 'no', }, - 'UnlockSession': { 'codegen_method': 'no', }, - '.+ExtCal': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API - 'CalAdjust.+': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API - '.+UserDefined.+': { 'codegen_method': 'no', }, - 'SetAttributeViSession': { 'codegen_method': 'no', }, - 'GetAttributeViSession': { 'codegen_method': 'no', }, - 'GetNextInterchangeWarning': { 'codegen_method': 'no', }, # Not applicable to Python API - 'ResetInterchangeCheck': { 'codegen_method': 'no', }, # Not applicable to Python API - 'ClearInterchangeWarnings': { 'codegen_method': 'no', }, # Not applicable to Python API - 'GetNextCoercionRecord': { 'codegen_method': 'no', }, # Not applicable to Python API - 'error_query': { 'codegen_method': 'no', }, - 'revision_query': { 'codegen_method': 'no', }, - '.+Complex.+': { 'codegen_method': 'no', }, - 'GetStreamEndpointHandle': { 'codegen_method': 'no', }, + 'init': { 'codegen_method': 'no', }, + 'InitWithOptions': { 'codegen_method': 'no', }, + 'InitializeWithChannels': { 'codegen_method': 'private', }, + 'close': { 'codegen_method': 'private', }, + 'CheckAttribute.*': { 'codegen_method': 'no', }, # Not supported in Python API. Issue #529 + 'InitiateGeneration': { 'codegen_method': 'private', }, + 'Configure.*': { 'codegen_method': 'no', }, # Use corresponding attribute instead + 'ConfigureArbSequence': { 'codegen_method': 'public', }, + 'ConfigureArbWaveform': { 'codegen_method': 'public', }, + 'ConfigureArbWaveform': { 'codegen_method': 'public', }, + 'ConfigureCustomFIRFilterCoefficients': { 'codegen_method': 'public', }, + 'ConfigureDigitalEdgeScriptTrigger': { 'codegen_method': 'public', }, + 'ConfigureDigitalEdgeStartTrigger': { 'codegen_method': 'public', }, + 'ConfigureDigitalLevelScriptTrigger': { 'codegen_method': 'public', }, + 'ConfigureFreqList': { 'codegen_method': 'public', }, + 'ConfigureStandardWaveform': { 'codegen_method': 'public', }, + 'Disable.+': { 'codegen_method': 'no', }, # Use corresponding attribute instead + 'Enable.+': { 'codegen_method': 'no', }, # Use corresponding attribute instead + 'P2P': { 'codegen_method': 'no', }, # P2P not supported in Python API + 'HWS': { 'codegen_method': 'no', }, # HWS is dead! + 'ResetAttribute': { 'codegen_method': 'no', }, # Issue #531 + 'RouteSignalOut': { 'codegen_method': 'no', }, # Use string-based routing instead + 'WriteBinary16AnalogStaticValue': { 'codegen_method': 'no', }, # Use corresponding attribute instead + 'CreateArbWaveform': { 'codegen_method': 'no', }, # Obsoleted before initial Python release + 'CreateBinary16ArbWaveform': { 'codegen_method': 'no', }, # Obsoleted before initial Python release + 'SendSoftwareTrigger': { 'codegen_method': 'no', }, # Obsoleted before initial Python release + 'Abort': { 'codegen_method': 'private', }, + '.etAttribute.+': { 'codegen_method': 'private', }, # All Set/Get Attribute functions are private + 'error_message': { 'codegen_method': 'private', }, + 'GetError': { 'codegen_method': 'private', }, + 'ClearError': { 'codegen_method': 'no', }, + 'ErrorHandler': { 'codegen_method': 'no', }, + 'LockSession': { 'codegen_method': 'no', }, + 'UnlockSession': { 'codegen_method': 'no', }, + 'InitExtCal': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'CloseExtCal': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'RestoreLastExtCalConstants': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'ChangeExtCalPassword': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'CalAdjust.+': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'Initialize.+Calibration': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + 'ReadCalADC': { 'codegen_method': 'no', }, # External Calibration is not supported by the Python API + '.+UserDefined.+': { 'codegen_method': 'no', }, + 'SetAttributeViSession': { 'codegen_method': 'no', }, + 'GetAttributeViSession': { 'codegen_method': 'no', }, + 'GetNextInterchangeWarning': { 'codegen_method': 'no', }, # Not applicable to Python API + 'ResetInterchangeCheck': { 'codegen_method': 'no', }, # Not applicable to Python API + 'ClearInterchangeWarnings': { 'codegen_method': 'no', }, # Not applicable to Python API + 'GetNextCoercionRecord': { 'codegen_method': 'no', }, # Not applicable to Python API + 'error_query': { 'codegen_method': 'no', }, + 'revision_query': { 'codegen_method': 'no', }, + '.+Complex.+': { 'codegen_method': 'no', }, + 'GetStreamEndpointHandle': { 'codegen_method': 'no', }, } # Attach the given parameter to the given enum from enums.py functions_enums = { - # @TODO add all enums + 'CreateFreqList': { 'parameters': { 1: { 'enum': 'Waveform', }, }, }, + 'CreateWaveformFromFileF64': { 'parameters': { 3: { 'enum': 'ByteOrder', }, }, }, # TODO: issue #538 + 'CreateWaveformFromFileI16': { 'parameters': { 3: { 'enum': 'ByteOrder', }, }, }, # TODO: issue #538 + 'ConfigureDigitalEdgeScriptTrigger': { 'parameters': { 3: { 'enum': 'ScriptTriggerDigitalEdgeEdge', }, }, }, + 'ConfigureDigitalEdgeStartTrigger': { 'parameters': { 2: { 'enum': 'StartTriggerDigitalEdgeEdge', }, }, }, + 'ExportSignal': { 'parameters': { 1: { 'enum': 'Signal', }, }, }, # TODO: issue #538 + 'SetNamedWaveformNextWritePosition': { 'parameters': { 3: { 'enum': 'RelativeTo', }, }, }, # TODO: issue #538 + 'SetWaveformNextWritePosition': { 'parameters': { 3: { 'enum': 'RelativeTo', }, }, }, # TODO: issue #538 + 'GetHardwareState': { 'parameters': { 1: { 'enum': 'HardwareState', }, }, }, # TODO: issue #538 + 'SendSoftwareEdgeTrigger': { 'parameters': { 1: { 'enum': 'Trigger', }, }, }, # TODO: issue #538 +} + +functions_issues = { + 'GetFIRFilterCoefficients': { 'parameters': { 3: {'direction':'out'}, # TODO(marcoskirsch): Remove when #534 solved + 4: { 'direction':'out', 'is_buffer': False, 'type':'ViInt32', }, }, }, } # This is the additional information needed by the code generator to properly generate the buffer retrieval mechanism @@ -53,11 +93,18 @@ # 'value' should be the name of the parameter through which the size (0, then the real # one) is passed in. This parameter won't exist in the corresponding Python Session method. functions_buffer_info = { - 'GetError': { 'parameters': { 3: { 'size': {'mechanism':'ivi-dance', 'value':'errorDescriptionBufferSize'}, }, }, }, - 'self_test': { 'parameters': { 2: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From documentation - 'GetAttributeViString': { 'parameters': { 4: { 'size': {'mechanism':'ivi-dance', 'value':'arraySize'}, }, }, }, - 'GetCalUserDefinedInfo': { 'parameters': { 1: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From LabVIEW VI, even though niDMM_GetCalUserDefinedInfoMaxSize() exists. - 'error_message': { 'parameters': { 2: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From documentation + 'GetError': { 'parameters': { 3: { 'size': {'mechanism':'ivi-dance', 'value':'errorDescriptionBufferSize'}, }, }, }, + 'self_test': { 'parameters': { 2: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From documentation + 'GetAttributeViString': { 'parameters': { 4: { 'size': {'mechanism':'ivi-dance', 'value':'arraySize'}, }, }, }, + 'GetCalUserDefinedInfo': { 'parameters': { 1: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From LabVIEW VI, even though niDMM_GetCalUserDefinedInfoMaxSize() exists. + 'error_message': { 'parameters': { 2: { 'size': {'mechanism':'fixed', 'value':256}, }, }, }, # From documentation + 'ConfigureCustomFIRFilterCoefficients': { 'parameters': { 3: { 'size': {'mechanism':'len', 'value':'numberOfCoefficients'}, }, }, }, + 'CreateWaveform(I16|F64)': { 'parameters': { 3: { 'size': {'mechanism':'len', 'value':'waveformSize'}, }, }, }, + 'DefineUserStandardWaveform': { 'parameters': { 3: { 'size': {'mechanism':'len', 'value':'waveformSize'}, }, }, }, + 'GetFIRFilterCoefficients': { 'parameters': { 3: { 'size': {'mechanism':'ivi-dance', 'value':'arraySize'}, }, }, }, # TODO(marcoskirsch): #537 + 'Write.*Waveform': { 'parameters': { 4: { 'size': {'mechanism':'len', 'value':'Size'}, }, }, }, + 'CreateAdvancedArbSequence': { 'parameters': { 2: { 'size': {'mechanism':'len', 'value':'sequenceLength'}, }, }, }, # TODO(marcoskirsch): Suffers from #515 + 'CreateFreqList': { 'parameters': { 3: { 'size': {'mechanism':'len', 'value':'frequencyListLength'}, }, }, }, # TODO(marcoskirsch): Suffers from #515 } # These are functions we mark as "error_handling":True. The generator uses this information to @@ -70,5 +117,17 @@ # Default values for method parameters functions_default_value = { + 'InitializeWithChannels': { 'parameters': { 1: { 'default_value': '', }, + 2: { 'default_value': False, }, + 3: { 'default_value': '', }, }, }, + 'ConfigureFreqList': { 'parameters': { 4: { 'default_value': 0.0, }, + 5: { 'default_value': 0.0, }, }, }, + 'ConfigureStandardWaveform': { 'parameters': { 4: { 'default_value': 0.0, }, + 5: { 'default_value': 0.0, }, }, }, + 'ConfigureDigitalEdgeScriptTrigger': { 'parameters': { 3: { 'default_value': 'ScriptTriggerDigitalEdgeEdge.RISING_EDGE', }, }, }, + 'ConfigureDigitalEdgeStartTrigger': { 'parameters': { 2: { 'default_value': 'StartTriggerDigitalEdgeEdge.RISING_EDGE', }, }, }, + 'CreateAdvancedArbSequence': { 'parameters': { 4: { 'default_value': None, }, + 5: { 'default_value': None, }, }, }, + 'WaitUntilDone': { 'parameters': { 1: { 'default_value': 10000, }, }, }, } diff --git a/src/nifgen/system_tests/test_system_nifgen.py b/src/nifgen/system_tests/test_system_nifgen.py index 2980c4166..c46425f46 100644 --- a/src/nifgen/system_tests/test_system_nifgen.py +++ b/src/nifgen/system_tests/test_system_nifgen.py @@ -4,7 +4,7 @@ @pytest.fixture(scope='function') def session(): - with nifgen.Session('', False, False, 'Simulate=1, DriverSetup=Model:5433 (2CH);BoardType:PXIe') as simulated_session: + with nifgen.Session('', False, 'Simulate=1, DriverSetup=Model:5433 (2CH);BoardType:PXIe') as simulated_session: yield simulated_session @@ -41,7 +41,7 @@ def test_method_get_self_cal_supported(session): def test_get_self_cal_last_date_and_time(): try: - with nifgen.Session('', False, False, 'Simulate=1, DriverSetup=Model:5421;BoardType:PXI') as session: + with nifgen.Session('', False, 'Simulate=1, DriverSetup=Model:5421;BoardType:PXI') as session: year, month, day, hour, minute = session.get_self_cal_last_date_and_time() assert False except nifgen.Error as e: diff --git a/src/niswitch/metadata/functions_addon.py b/src/niswitch/metadata/functions_addon.py index 325dcb042..281f8d9d4 100644 --- a/src/niswitch/metadata/functions_addon.py +++ b/src/niswitch/metadata/functions_addon.py @@ -89,7 +89,4 @@ 'RouteTriggerInput': { 'parameters': { 3: { 'default_value': False, }, }, }, 'WaitForDebounce': { 'parameters': { 1: { 'default_value': 5000, }, }, }, 'WaitForScanComplete': { 'parameters': { 1: { 'default_value': 5000, }, }, }, - - - }