How to use the niswitch.visatype.ViBoolean function in niswitch

To help you get started, we’ve selected a few niswitch 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 / niswitch / unit_tests / matchers.py View on Github external
def __init__(self):
        _PointerMatcher.__init__(self, visatype.ViBoolean)
github ni / nimi-python / generated / niswitch / unit_tests / matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, visatype.ViBoolean, 1 if expected_value is True else 0)
github ni / nimi-python / generated / niswitch / session.py View on Github external
- Currently unsupported. The device will not reset.


        Returns:
            vi (int): A particular NI-SWITCH session established with
                _init_with_topology, InitWithOptions, or init
                and used for all subsequent NI-SWITCH calls.

                Note:
                One or more of the referenced functions are not in the Python API for this driver.

        '''
        resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding))  # case C020
        topology_ctype = ctypes.create_string_buffer(topology.encode(self._encoding))  # case C020
        simulate_ctype = visatype.ViBoolean(simulate)  # case S150
        reset_device_ctype = visatype.ViBoolean(reset_device)  # case S150
        vi_ctype = visatype.ViSession()  # case S200
        error_code = self._library.niSwitch_InitWithTopology(resource_name_ctype, topology_ctype, simulate_ctype, reset_device_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype)))
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return int(vi_ctype.value)
github ni / nimi-python / generated / niswitch / session.py View on Github external
process. Valid Values: VI_TRUE - Reset Device (Default Value) VI_FALSE
                - Currently unsupported. The device will not reset.


        Returns:
            vi (int): A particular NI-SWITCH session established with
                _init_with_topology, InitWithOptions, or init
                and used for all subsequent NI-SWITCH calls.

                Note:
                One or more of the referenced functions are not in the Python API for this driver.

        '''
        resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding))  # case C020
        topology_ctype = ctypes.create_string_buffer(topology.encode(self._encoding))  # case C020
        simulate_ctype = visatype.ViBoolean(simulate)  # case S150
        reset_device_ctype = visatype.ViBoolean(reset_device)  # case S150
        vi_ctype = visatype.ViSession()  # case S200
        error_code = self._library.niSwitch_InitWithTopology(resource_name_ctype, topology_ctype, simulate_ctype, reset_device_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype)))
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return int(vi_ctype.value)
github ni / nimi-python / generated / niswitch / session.py View on Github external
Note:
                One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.

            invert (bool): If VI_TRUE, inverts the input trigger signal from falling to rising or
                vice versa. Default value: VI_FALSE

        '''
        if type(scan_advanced_output_connector) is not enums.ScanAdvancedOutput:
            raise TypeError('Parameter mode must be of type ' + str(enums.ScanAdvancedOutput))
        if type(scan_advanced_output_bus_line) is not enums.ScanAdvancedOutput:
            raise TypeError('Parameter mode must be of type ' + str(enums.ScanAdvancedOutput))
        vi_ctype = visatype.ViSession(self._vi)  # case S110
        scan_advanced_output_connector_ctype = visatype.ViInt32(scan_advanced_output_connector.value)  # case S130
        scan_advanced_output_bus_line_ctype = visatype.ViInt32(scan_advanced_output_bus_line.value)  # case S130
        invert_ctype = visatype.ViBoolean(invert)  # case S150
        error_code = self._library.niSwitch_RouteScanAdvancedOutput(vi_ctype, scan_advanced_output_connector_ctype, scan_advanced_output_bus_line_ctype, invert_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / niswitch / session.py View on Github external
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
github ni / nimi-python / generated / niswitch / session.py View on Github external
Note:
                One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.

            invert (bool): If VI_TRUE, inverts the input trigger signal from falling to rising or
                vice versa. Default value: VI_FALSE

        '''
        if type(trigger_input_connector) is not enums.TriggerInput:
            raise TypeError('Parameter mode must be of type ' + str(enums.TriggerInput))
        if type(trigger_input_bus_line) is not enums.TriggerInput:
            raise TypeError('Parameter mode must be of type ' + str(enums.TriggerInput))
        vi_ctype = visatype.ViSession(self._vi)  # case S110
        trigger_input_connector_ctype = visatype.ViInt32(trigger_input_connector.value)  # case S130
        trigger_input_bus_line_ctype = visatype.ViInt32(trigger_input_bus_line.value)  # case S130
        invert_ctype = visatype.ViBoolean(invert)  # case S150
        error_code = self._library.niSwitch_RouteTriggerInput(vi_ctype, trigger_input_connector_ctype, trigger_input_bus_line_ctype, invert_ctype)
        errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
        return
github ni / nimi-python / generated / niswitch / session.py View on Github external
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)