Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Tip:
This method requires repeated capabilities (usually channels). If called directly on the
nidmm.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
nidmm.Session instance, and calling this method on the result.:
session['0,1']._set_attribute_vi_boolean(attribute_id, attribute_value)
Args:
attribute_id (int): Pass the ID of an attribute.
attribute_value (bool): Pass the value that you want to set the attribute to.
'''
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.ViBoolean(attribute_value) # case 9
error_code = self._library.niDMM_SetAttributeViBoolean(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
| Cache | cache | VI_TRUE | 1 |
+------------------+--------------------+-------------------+----+
| Simulate | simulate | VI_FALSE | 0 |
+------------------+--------------------+-------------------+----+
| RecordCoercions | RECORD_COERCIONS | VI_FALSE | 0 |
+------------------+--------------------+-------------------+----+
| DriverSetup | DRIVER_SETUP | "" (empty string) | "" |
+------------------+--------------------+-------------------+----+
Returns:
vi (int): Returns a ViSession handle that you use to identify the instrument in
all subsequent instrument driver function calls.
'''
resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding)) # case 3
id_query_ctype = visatype.ViBoolean(id_query) # case 9
reset_device_ctype = visatype.ViBoolean(reset_device) # case 9
option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case 3
vi_ctype = visatype.ViSession() # case 14
error_code = self._library.niDMM_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)
+------------------+--------------------+-------------------+----+
| Cache | cache | VI_TRUE | 1 |
+------------------+--------------------+-------------------+----+
| Simulate | simulate | VI_FALSE | 0 |
+------------------+--------------------+-------------------+----+
| RecordCoercions | RECORD_COERCIONS | VI_FALSE | 0 |
+------------------+--------------------+-------------------+----+
| DriverSetup | DRIVER_SETUP | "" (empty string) | "" |
+------------------+--------------------+-------------------+----+
Returns:
vi (int): Returns a ViSession handle that you use to identify the instrument in
all subsequent instrument driver function calls.
'''
resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding)) # case 3
id_query_ctype = visatype.ViBoolean(id_query) # case 9
reset_device_ctype = visatype.ViBoolean(reset_device) # case 9
option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case 3
vi_ctype = visatype.ViSession() # case 14
error_code = self._library.niDMM_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)
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_boolean(attribute_id)
Args:
attribute_id (int): Pass the ID of an attribute.
Returns:
attribute_value (bool): Returns the current value of the attribute. Pass the address of a
ViBoolean 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.ViBoolean() # case 14
error_code = self._library.niDMM_GetAttributeViBoolean(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 bool(attribute_value_ctype.value)
Returns a Boolean value that expresses whether or not the DMM that you
are using can perform self-calibration.
Returns:
self_cal_supported (bool): Returns whether Self Cal is supported for the device specified by the
given session.
+----------+---+-------------------------------------------------------------+
| VI_TRUE | 1 | The DMM that you are using can perform self-calibration. |
+----------+---+-------------------------------------------------------------+
| VI_FALSE | 0 | The DMM that you are using cannot perform self-calibration. |
+----------+---+-------------------------------------------------------------+
'''
vi_ctype = visatype.ViSession(self._vi) # case 1
self_cal_supported_ctype = visatype.ViBoolean() # case 14
error_code = self._library.niDMM_GetSelfCalSupported(vi_ctype, ctypes.pointer(self_cal_supported_ctype))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return bool(self_cal_supported_ctype.value)