Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
milliseconds. If the function does not complete within this time
interval, the function returns the NIDMM_ERROR_MAX_TIME_EXCEEDED
error code. This may happen if an external trigger has not been
received, or if the specified timeout is not long enough for the
acquisition to complete.
The valid range is 0–86400000. The default value is
NIDMM_VAL_TIME_LIMIT_AUTO (-1). The DMM calculates the timeout
automatically.
Returns:
reading (float): The measured value returned from the DMM.
'''
vi_ctype = visatype.ViSession(self._vi) # case 1
maximum_time_ctype = visatype.ViInt32(maximum_time) # case 9
reading_ctype = visatype.ViReal64() # case 14
error_code = self._library.niDMM_Fetch(vi_ctype, maximum_time_ctype, ctypes.pointer(reading_ctype))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(reading_ctype.value)
You can specify a subset of repeated capabilities using the Python index notation on an
nidmm.Session instance, and calling this method on the result.:
session['0,1']._get_attribute_vi_real64(attribute_id)
Args:
attribute_id (int): Pass the ID of an attribute.
Returns:
attribute_value (float): Returns the current value of the attribute. Pass the address of a
ViReal64 variable.
'''
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 9
attribute_value_ctype = visatype.ViReal64() # case 14
error_code = self._library.niDMM_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, ctypes.pointer(attribute_value_ctype))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(attribute_value_ctype.value)
milliseconds. If the function does not complete within this time
interval, the function returns the NIDMM_ERROR_MAX_TIME_EXCEEDED
error code. This may happen if an external trigger has not been
received, or if the specified timeout is not long enough for the
acquisition to complete.
The valid range is 0–86400000. The default value is
NIDMM_VAL_TIME_LIMIT_AUTO (-1). The DMM calculates the timeout
automatically.
Returns:
reading (float): The measured value returned from the DMM.
'''
vi_ctype = visatype.ViSession(self._vi) # case 1
maximum_time_ctype = visatype.ViInt32(maximum_time) # case 9
reading_ctype = visatype.ViReal64() # case 14
error_code = self._library.niDMM_Read(vi_ctype, maximum_time_ctype, ctypes.pointer(reading_ctype))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(reading_ctype.value)
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
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
RESOLUTION_ABSOLUTE to this value. This parameter is
ignored when the **Range** parameter is set to
NIDMM_VAL_AUTO_RANGE_ON (-1.0) or NIDMM_VAL_AUTO_RANGE_ONCE
(-3.0). The default is 0.001 V.
Note:
NI-DMM ignores this parameter for capacitance and inductance
measurements on the NI 4072. To achieve better resolution for such
measurements, use the LC_NUMBER_MEAS_TO_AVERAGE
attribute.
'''
if type(measurement_function) is not enums.Function:
raise TypeError('Parameter mode must be of type ' + str(enums.Function))
vi_ctype = visatype.ViSession(self._vi) # case 1
measurement_function_ctype = visatype.ViInt32(measurement_function.value) # case 10
range_ctype = visatype.ViReal64(range) # case 9
resolution_absolute_ctype = visatype.ViReal64(resolution_absolute) # case 9
error_code = self._library.niDMM_ConfigureMeasurementAbsolute(vi_ctype, measurement_function_ctype, range_ctype, resolution_absolute_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return
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
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)
| 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
time.
On the NI 4060, when the powerline frequency is 60, the PLCs allowed are
1 PLC, 6 PLC, 12 PLC, and 120 PLC. When the powerline frequency is 50,
the PLCs allowed are 1 PLC, 5 PLC, 10 PLC, and 100 PLC.
aperture_time_units (enums.ApertureTimeUnits): Indicates the units of aperture time as powerline cycles (PLCs) or
seconds. Returns the value of the APERTURE_TIME_UNITS
attribute.
+-----------------------------+---+------------------+
| NIDMM_VAL_SECONDS | 0 | Seconds |
+-----------------------------+---+------------------+
| NIDMM_VAL_POWER_LINE_CYCLES | 1 | Powerline Cycles |
+-----------------------------+---+------------------+
'''
vi_ctype = visatype.ViSession(self._vi) # case 1
aperture_time_ctype = visatype.ViReal64() # case 14
aperture_time_units_ctype = visatype.ViInt32() # case 14
error_code = self._library.niDMM_GetApertureTimeInfo(vi_ctype, ctypes.pointer(aperture_time_ctype), ctypes.pointer(aperture_time_units_ctype))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(aperture_time_ctype.value), enums.ApertureTimeUnits(aperture_time_units_ctype.value)