How to use the nidmm.visatype.ViSession function in nidmm

To help you get started, we’ve selected a few nidmm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ni / nimi-python / generated / nidmm / session.py View on Github external
self-test. The array must contain at least 256 elements.

                For the NI 4050 and NI 4060, the error codes returned for self-test
                failures include the following:

                -  NIDMM_ERROR_AC_TEST_FAILURE
                -  NIDMM_ERROR_DC_TEST_FAILURE
                -  NIDMM_ERROR_RESISTANCE_TEST_FAILURE

                These error codes indicate that the DMM should be repaired.

                For the NI 4080/4081/4082 and the NI 4070/4071/4072, the error code
                returned for a self-test failure is NIDMM_ERROR_SELF_TEST_FAILURE.
                This error code indicates that the DMM should be repaired.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        self_test_result_ctype = visatype.ViInt16()  # case 14
        self_test_message_ctype = (visatype.ViChar * 256)()  # case 11
        error_code = self._library.niDMM_self_test(vi_ctype, ctypes.pointer(self_test_result_ctype), self_test_message_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return int(self_test_result_ctype.value), self_test_message_ctype.value.decode(self._encoding)
github ni / nimi-python / generated / nidmm / session.py View on Github external
def configure_short_cable_comp_values(self, resistance, reactance):
        '''configure_short_cable_comp_values

        For the NI 4082 and NI 4072 only, configures the
        SHORT_CABLE_COMP_RESISTANCE and
        SHORT_CABLE_COMP_REACTANCE attributes.

        Args:
            resistance (float): Specifies the short cable compensation **resistance**.
            reactance (float): Specifies the short cable compensation **reactance**.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        resistance_ctype = visatype.ViReal64(resistance)  # case 9
        reactance_ctype = visatype.ViReal64(reactance)  # case 9
        error_code = self._library.niDMM_ConfigureShortCableCompValues(vi_ctype, resistance_ctype, reactance_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / nidmm / session.py View on Github external
'''configure_rtd_custom

        Configures the A, B, and C parameters for a custom RTD.

        Args:
            rtd_a (float): Specifies the Callendar-Van Dusen A coefficient for RTD scaling when RTD
                Type parameter is set to Custom in the configure_rtd_type function.
                The default is 3.9083e-3 (Pt3851)
            rtd_b (float): Specifies the Callendar-Van Dusen B coefficient for RTD scaling when RTD
                Type parameter is set to Custom in the configure_rtd_type function.
                The default is -5.775e-7 (Pt3851).
            rtd_c (float): Specifies the Callendar-Van Dusen C coefficient for RTD scaling when RTD
                Type parameter is set to Custom in the configure_rtd_type function.
                The default is -4.183e-12 (Pt3851).
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        rtd_a_ctype = visatype.ViReal64(rtd_a)  # case 9
        rtd_b_ctype = visatype.ViReal64(rtd_b)  # case 9
        rtd_c_ctype = visatype.ViReal64(rtd_c)  # case 9
        error_code = self._library.niDMM_ConfigureRTDCustom(vi_ctype, rtd_a_ctype, rtd_b_ctype, rtd_c_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / nidmm / session.py View on Github external
def get_dev_temp(self, options=''):
        '''get_dev_temp

        Returns the current **Temperature** of the device.

        Note: The NI 4050 and NI 4060 are not supported.

        Args:
            options (string): Reserved.

        Returns:
            temperature (float): Returns the current **temperature** of the device.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        options_ctype = ctypes.create_string_buffer(options.encode(self._encoding))  # case 3
        temperature_ctype = visatype.ViReal64()  # case 14
        error_code = self._library.niDMM_GetDevTemp(vi_ctype, options_ctype, ctypes.pointer(temperature_ctype))
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return float(temperature_ctype.value)
github ni / nimi-python / generated / nidmm / session.py View on Github external
def get_auto_range_value(self):
        '''get_auto_range_value

        Returns the **Actual_Range** that the DMM is using, even when Auto
        Range is off.

        Returns:
            actual_range (float): Indicates the **actual_range** the DMM is using. Returns the value of
                the AUTO_RANGE_VALUE attribute. The units of the returned
                value depend on the function.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        actual_range_ctype = visatype.ViReal64()  # case 14
        error_code = self._library.niDMM_GetAutoRangeValue(vi_ctype, ctypes.pointer(actual_range_ctype))
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return float(actual_range_ctype.value)
github ni / nimi-python / generated / nidmm / session.py View on Github external
measurements for the current capacitance/inductance range, and returns
        open cable compensation **Conductance** and **Susceptance** values. You
        can use the return values of this function as inputs to
        configure_open_cable_comp_values.

        This function returns an error if the value of the function
        attribute is not set to NIDMM_VAL_CAPACITANCE (1005) or
        NIDMM_VAL_INDUCTANCE (1006).

        Returns:
            conductance (float): **conductance** is the measured value of open cable compensation
                **conductance**.
            susceptance (float): **susceptance** is the measured value of open cable compensation
                **susceptance**.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        conductance_ctype = visatype.ViReal64()  # case 14
        susceptance_ctype = visatype.ViReal64()  # case 14
        error_code = self._library.niDMM_PerformOpenCableComp(vi_ctype, ctypes.pointer(conductance_ctype), ctypes.pointer(susceptance_ctype))
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return float(conductance_ctype.value), float(susceptance_ctype.value)
github ni / nimi-python / generated / nidmm / session.py View on Github external
| NIDMM_VAL_TEMP_RTD_PT3916       |
                +---------------------------------+
                | NIDMM_VAL_TEMP_RTD_PT3920       |
                +---------------------------------+
                | NIDMM_VAL_TEMP_RTD_PT3911       |
                +---------------------------------+
                | NIDMM_VAL_TEMP_RTD_PT3928       |
                +---------------------------------+
                | \*No standard. Check the TCR.   |
                +---------------------------------+
            rtd_resistance (float): Specifies the RTD resistance in ohms at 0 °C. NI-DMM uses this value to
                set the RTD Resistance property. The default is 100 (Ω).
        '''
        if type(rtd_type) is not enums.RTDType:
            raise TypeError('Parameter mode must be of type ' + str(enums.RTDType))
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        rtd_type_ctype = visatype.ViInt32(rtd_type.value)  # case 10
        rtd_resistance_ctype = visatype.ViReal64(rtd_resistance)  # case 9
        error_code = self._library.niDMM_ConfigureRTDType(vi_ctype, rtd_type_ctype, rtd_resistance_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / nidmm / session.py View on Github external
def configure_open_cable_comp_values(self, conductance, susceptance):
        '''configure_open_cable_comp_values

        For the NI 4082 and NI 4072 only, configures the
        OPEN_CABLE_COMP_CONDUCTANCE and
        OPEN_CABLE_COMP_SUSCEPTANCE attributes.

        Args:
            conductance (float): Specifies the open cable compensation **conductance**.
            susceptance (float): Specifies the open cable compensation **susceptance**.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        conductance_ctype = visatype.ViReal64(conductance)  # case 9
        susceptance_ctype = visatype.ViReal64(susceptance)  # case 9
        error_code = self._library.niDMM_ConfigureOpenCableCompValues(vi_ctype, conductance_ctype, susceptance_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / nidmm / session.py View on Github external
trigger_delay (float): Specifies the time that the DMM waits after it has received a trigger
                before taking a measurement. The driver sets the
                TRIGGER_DELAY attribute to this value. By default,
                **trigger_delay** is NIDMM_VAL_AUTO_DELAY (-1), which means the DMM
                waits an appropriate settling time before taking the measurement. On the
                NI 4060, if you set **trigger_delay** to 0, the DMM does not settle
                before taking the measurement. The NI 4065 and NI 4070/4071/4072 use the
                value specified in **trigger_delay** as additional settling time.

                Note:
                When using the NI 4050, **Trigger_Delay** must be set to
                NIDMM_VAL_AUTO_DELAY (-1).
        '''
        if type(trigger_source) is not enums.TriggerSource:
            raise TypeError('Parameter mode must be of type ' + str(enums.TriggerSource))
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        trigger_source_ctype = visatype.ViInt32(trigger_source.value)  # case 10
        trigger_delay_ctype = visatype.ViReal64(trigger_delay)  # case 9
        error_code = self._library.niDMM_ConfigureTrigger(vi_ctype, trigger_source_ctype, trigger_delay_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / nidmm / session.py View on Github external
def abort(self):
        '''abort

        Aborts a previously initiated measurement and returns the DMM to the
        Idle state.
        '''
        vi_ctype = visatype.ViSession(self._vi)  # case 1
        error_code = self._library.niDMM_Abort(vi_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return