Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, visatype.ViReal64, expected_value)
def __init__(self):
_PointerMatcher.__init__(self, visatype.ViReal64)
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, visatype.ViReal64, expected_size_or_value)
constants as valid values, you can view the constants by moving to the
Attribute Value control and pressing .
attribute_value (float): Pass the value to which you want to set the attribute. From the function
panel window, you can use this control as follows. - If the attribute
currently showing in the Attribute ID ring control has constants as
valid values, you can view a list of the constants by pressing on this
control. Select a value by double-clicking on it or by selecting it and
then pressing . Note: Some of the values might not be valid depending on
the current settings of the instrument session. Default Value: none
'''
vi_ctype = visatype.ViSession(self._vi) # case S110
channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010
attribute_id_ctype = visatype.ViAttr(attribute_id) # case S150
attribute_value_ctype = visatype.ViReal64(attribute_value) # case S150
error_code = self._library.niSwitch_SetAttributeViReal64(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
a list of valid values.
scan_delay (float): The minimum length of time you want the switch device to wait after it
creates a path until it asserts a trigger on the scan advanced output
line. The driver uses this value to set the Scan Delay attribute. The
scan delay is in addition to the settling time.The driver uses this
value to set the scan_delay attribute. Express this
value in seconds. Default value: 0.0 s
'''
if type(trigger_input) is not enums.TriggerInput:
raise TypeError('Parameter mode must be of type ' + str(enums.TriggerInput))
if type(scan_advanced_output) is not enums.ScanAdvancedOutput:
raise TypeError('Parameter mode must be of type ' + str(enums.ScanAdvancedOutput))
vi_ctype = visatype.ViSession(self._vi) # case S110
scan_delay_ctype = visatype.ViReal64(scan_delay) # case S150
trigger_input_ctype = visatype.ViInt32(trigger_input.value) # case S130
scan_advanced_output_ctype = visatype.ViInt32(scan_advanced_output.value) # case S130
error_code = self._library.niSwitch_ConfigureScanTrigger(vi_ctype, scan_delay_ctype, trigger_input_ctype, scan_advanced_output_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return
constants by moving to the Attribute Value control and pressing .
Returns:
attribute_value (float): Returns the current value of the attribute. Pass the address of a
ViReal64 variable. From the function panel window, you can use this
control as follows. - If the attribute currently showing in the
Attribute ID ring control has constants as valid values, you can view a
list of the constants by pressing on this control. Select a value by
double-clicking on it or by selecting it and then pressing .
'''
vi_ctype = visatype.ViSession(self._vi) # case S110
channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010
attribute_id_ctype = visatype.ViAttr(attribute_id) # case S150
attribute_value_ctype = visatype.ViReal64() # case S200
error_code = self._library.niSwitch_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype)))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(attribute_value_ctype.value)