Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this ring control has constants as valid values, you can view the
constants by moving to the Attribute Value control and pressing .
Returns:
attribute_value (int): Returns the current value of the attribute. Pass the address of a
ViInt32 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.ViInt32() # case S200
error_code = self._library.niSwitch_GetAttributeViInt32(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 int(attribute_value_ctype.value)
or by selecting it and then pressing . A ring control at the top of the
dialog box allows you to see all IVI attributes or only the attributes
of the ViInt32 type. If you choose to see all IVI attributes, the data
types appear to the right of the attribute names in the list box. The
data types that are not consistent with this function are dim. If you
select an attribute data type that is dim, LabWindows/CVI transfers you
to the function panel for the corresponding function that is consistent
with the data type. - If you want to enter a variable name, press to
change this ring control to a manual input box. - If the attribute in
this ring control has constants as valid values, you can view the
constants by moving to the Attribute Value control and 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
array_size_ctype = visatype.ViInt32() # case S170
attribute_value_ctype = None # case C050
error_code = self._library.niSwitch_GetAttributeViString(vi_ctype, channel_name_ctype, attribute_id_ctype, array_size_ctype, attribute_value_ctype)
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
array_size_ctype = visatype.ViInt32(error_code) # case S180
attribute_value_ctype = (visatype.ViChar * array_size_ctype.value)() # case C060
error_code = self._library.niSwitch_GetAttributeViString(vi_ctype, channel_name_ctype, attribute_id_ctype, array_size_ctype, attribute_value_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return attribute_value_ctype.value.decode(self._encoding)
a manual input box. - If the attribute in this ring control has
constants as valid values, you can view the constants by moving to the
Attribute Value control and pressing .
attribute_value (bool): 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.ViBoolean(attribute_value) # case S150
error_code = self._library.niSwitch_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
a manual input box. - If the attribute in this ring control has
constants as valid values, you can view the constants by moving to the
Attribute Value control and pressing .
attribute_value (str): 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 = ctypes.create_string_buffer(attribute_value.encode(self._encoding)) # case C020
error_code = self._library.niSwitch_SetAttributeViString(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
this ring control has constants as valid values, you can view the
constants by moving to the Attribute Value control and pressing .
Returns:
attribute_value (bool): Returns the current value of the attribute. Pass the address of a
ViBoolean 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.ViBoolean() # case S200
error_code = self._library.niSwitch_GetAttributeViBoolean(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 bool(attribute_value_ctype.value)
this ring control has constants as valid values, you can view the
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)
a manual input box. - If the attribute in this ring control has
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 manual input box. - If the attribute in this ring control has
constants as valid values, you can view the constants by moving to the
Attribute Value control and pressing .
attribute_value (int): 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.ViInt32(attribute_value) # case S150
error_code = self._library.niSwitch_SetAttributeViInt32(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