Python ctypes 模块,byref() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用ctypes.byref()

项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def _write_digital_u_16(
        task_handle, write_array, num_samps_per_chan, auto_start, timeout,
        data_layout=FillMode.GROUP_BY_CHANNEL):
    samps_per_chan_written = ctypes.c_int()

    cfunc = lib_importer.windll.DAQmxWriteDigitalU16
    if cfunc.argtypes is None:
        with cfunc.arglock:
            if cfunc.argtypes is None:
                cfunc.argtypes = [
                    lib_importer.task_handle, ctypes.c_int, c_bool32,
                    ctypes.c_double, ctypes.c_int,
                    wrapped_ndpointer(dtype=numpy.uint16, flags=('C', 'W')),
                    ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)]

    error_code = cfunc(
        task_handle, num_samps_per_chan, auto_start, timeout,
        data_layout.value, write_array,
        ctypes.byref(samps_per_chan_written), None)
    check_for_error(error_code)

    return samps_per_chan_written.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def _major_version(self):
        """
        int: Indicates the major portion of the installed version of NI-
            DAQmx, such as 7 for version 7.0.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetSysNIDAQMajorVersion
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def _minor_version(self):
        """
        int: Indicates the minor portion of the installed version of NI-
            DAQmx, such as 0 for version 7.0.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetSysNIDAQMinorVersion
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def _update_version(self):
        """
        int: Indicates the update portion of the installed version of
            NI-DAQmx, such as 1 for version 9.0.1.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetSysNIDAQUpdateVersion
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_term_cfgs(self):
        """
        List[:class:`nidaqmx.constants.TerminalConfiguration`]:
            Indicates the list of terminal configurations supported by
            the channel.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanAITermCfgs
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TermCfg, TerminalConfiguration)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_manual_control_amplitude(self):
        """
        float: Indicates the current value of the front panel amplitude
            control for the physical channel in volts.
        """
        val = ctypes.c_double()

        cfunc = (lib_importer.windll.
                 DAQmxGetPhysicalChanAOManualControlAmplitude)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_manual_control_enable(self):
        """
        bool: Specifies if you can control the physical channel
            externally via a manual control located on the device. You
            cannot simultaneously control a channel manually and with
            NI-DAQmx.
        """
        val = c_bool32()

        cfunc = (lib_importer.windll.
                 DAQmxGetPhysicalChanAOManualControlEnable)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_manual_control_freq(self):
        """
        float: Indicates the current value of the front panel frequency
            control for the physical channel in hertz.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanAOManualControlFreq
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_manual_control_short_detected(self):
        """
        bool: Indicates whether the physical channel is currently
            disabled due to a short detected on the channel.
        """
        val = c_bool32()

        cfunc = (lib_importer.windll.
                 DAQmxGetPhysicalChanAOManualControlShortDetected)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_power_amp_gain(self):
        """
        float: Indicates the calibrated gain of the channel.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetAOPowerAmpGain
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_power_amp_offset(self):
        """
        float: Indicates the calibrated offset of the channel in volts.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetAOPowerAmpOffset
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_power_amp_overcurrent(self):
        """
        bool: Indicates if the channel detected an overcurrent
            condition.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetAOPowerAmpOvercurrent
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_term_cfgs(self):
        """
        List[:class:`nidaqmx.constants.TerminalConfiguration`]:
            Indicates the list of terminal configurations supported by
            the channel.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanAOTermCfgs
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TermCfg, TerminalConfiguration)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def di_change_detect_supported(self):
        """
        bool: Indicates if the change detection timing type is supported
            for the digital input physical channel.
        """
        val = c_bool32()

        cfunc = (lib_importer.windll.
                 DAQmxGetPhysicalChanDIChangeDetectSupported)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def di_samp_clk_supported(self):
        """
        bool: Indicates if the sample clock timing type is supported for
            the digital input physical channel.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanDISampClkSupported
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def do_port_width(self):
        """
        int: Indicates in bits the width of digital output port.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanDOPortWidth
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def do_samp_clk_supported(self):
        """
        bool: Indicates if the sample clock timing type is supported for
            the digital output physical channel.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanDOSampClkSupported
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def teds_mfg_id(self):
        """
        int: Indicates the manufacturer ID of the sensor.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanTEDSMfgID
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def teds_model_num(self):
        """
        int: Indicates the model number of the sensor.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanTEDSModelNum
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def teds_version_num(self):
        """
        int: Indicates the version number of the sensor.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetPhysicalChanTEDSVersionNum
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_states_ao_state(self):
        """
        float: Specifies the state to set the analog output physical
            channels when the watchdog task expires.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetWatchdogAOExpirState
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes_byte_str,
                        ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._handle, self._physical_channel, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_states_ao_type(self):
        """
        :class:`nidaqmx.constants.WatchdogAOExpirState`: Specifies the
            output type of the analog output physical channels when the
            watchdog task expires.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetWatchdogAOOutputType
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes_byte_str,
                        ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._handle, self._physical_channel, ctypes.byref(val))
        check_for_error(error_code)

        return WatchdogAOExpirState(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_states_co_state(self):
        """
        :class:`nidaqmx.constants.WatchdogCOExpirState`: Specifies the
            state to set the counter output channel terminal when the
            watchdog task expires.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetWatchdogCOExpirState
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes_byte_str,
                        ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._handle, self._physical_channel, ctypes.byref(val))
        check_for_error(error_code)

        return WatchdogCOExpirState(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_states_do_state(self):
        """
        :class:`nidaqmx.constants.Level`: Specifies the state to which
            to set the digital physical channels when the watchdog task
            expires.  You cannot modify the expiration state of
            dedicated digital input physical channels.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetWatchdogDOExpirState
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes_byte_str,
                        ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._handle, self._physical_channel, ctypes.byref(val))
        check_for_error(error_code)

        return Level(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_trig_dig_edge_edge(self):
        """
        :class:`nidaqmx.constants.Edge`: Specifies on which edge of a
            digital signal to expire the watchdog task.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDigEdgeWatchdogExpirTrigEdge
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._handle, ctypes.byref(val))
        check_for_error(error_code)

        return Edge(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_trig_trig_on_network_conn_loss(self):
        """
        bool: Specifies the watchdog timer behavior when the network
            connection is lost between the host and the chassis. If set
            to true, the watchdog timer expires when the chassis detects
            the loss of network connection.
        """
        val = c_bool32()

        cfunc = (lib_importer.windll.
                 DAQmxGetWatchdogExpirTrigOnNetworkConnLoss)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._handle, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expir_trig_trig_type(self):
        """
        :class:`nidaqmx.constants.TriggerType`: Specifies the type of
            trigger to use to expire a watchdog task.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetWatchdogExpirTrigType
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._handle, ctypes.byref(val))
        check_for_error(error_code)

        return TriggerType(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def expired(self):
        """
        bool: Indicates if the watchdog timer expired. You can read this
            property only while the task is running.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetWatchdogHasExpired
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._handle, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def timeout(self):
        """
        float: Specifies in seconds the amount of time until the
            watchdog timer expires. A value of -1 means the internal
            timer never expires. Set this input to -1 if you use an
            Expiration Trigger to expire the watchdog task.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetWatchdogTimeout
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        lib_importer.task_handle,
                        ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._handle, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_max_multi_chan_rate(self):
        """
        float: Indicates the maximum sampling rate for an analog input
            task from this device. To find the maximum rate for the
            task, take the minimum of **ai_max_single_chan_rate** or the
            indicated sampling rate of this device divided by the number
            of channels to acquire data from (including cold-junction
            compensation and autozero channels).
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevAIMaxMultiChanRate
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_max_single_chan_rate(self):
        """
        float: Indicates the maximum rate for an analog input task if
            the task contains only a single channel from this device.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevAIMaxSingleChanRate
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_min_rate(self):
        """
        float: Indicates the minimum rate for an analog input task on
            this device. NI-DAQmx returns a warning or error if you
            attempt to sample at a slower rate.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevAIMinRate
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_simultaneous_sampling_supported(self):
        """
        bool: Indicates if the device supports simultaneous sampling.
        """
        val = c_bool32()

        cfunc = (lib_importer.windll.
                 DAQmxGetDevAISimultaneousSamplingSupported)
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ai_trig_usage(self):
        """
        List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
            triggers supported by this device for an analog input task.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevAITrigUsage
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TriggerUsageTypes, TriggerUsage)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_max_rate(self):
        """
        float: Indicates the maximum analog output rate of the device.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevAOMaxRate
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_min_rate(self):
        """
        float: Indicates the minimum analog output rate of the device.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevAOMinRate
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_samp_clk_supported(self):
        """
        bool: Indicates if the device supports the sample clock timing
            type for analog output tasks.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetDevAOSampClkSupported
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ao_trig_usage(self):
        """
        List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
            triggers supported by this device for analog output tasks.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevAOTrigUsage
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TriggerUsageTypes, TriggerUsage)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def bus_type(self):
        """
        :class:`nidaqmx.constants.BusType`: Indicates the bus type of
            the device.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevBusType
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return BusType(val.value)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ci_max_size(self):
        """
        int: Indicates in bits the size of the counters on the device.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetDevCIMaxSize
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ci_max_timebase(self):
        """
        float: Indicates in hertz the maximum counter timebase
            frequency.
        """
        val = ctypes.c_double()

        cfunc = lib_importer.windll.DAQmxGetDevCIMaxTimebase
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_double)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ci_samp_clk_supported(self):
        """
        bool: Indicates if the device supports the sample clock timing
            type for counter input tasks.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetDevCISampClkSupported
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def ci_trig_usage(self):
        """
        List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
            triggers supported by this device for counter input tasks.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevCITrigUsage
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TriggerUsageTypes, TriggerUsage)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def co_max_size(self):
        """
        int: Indicates in bits the size of the counters on the device.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetDevCOMaxSize
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def co_samp_clk_supported(self):
        """
        bool: Indicates if the device supports Sample Clock timing for
            counter output tasks.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetDevCOSampClkSupported
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def co_trig_usage(self):
        """
        List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
            triggers supported by this device for counter output tasks.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevCOTrigUsage
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TriggerUsageTypes, TriggerUsage)
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def compact_daq_slot_num(self):
        """
        int: Indicates the slot number in which this module is located
            in the CompactDAQ chassis.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetDevCompactDAQSlotNum
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def dev_is_simulated(self):
        """
        bool: Indicates if the device is a simulated device.
        """
        val = c_bool32()

        cfunc = lib_importer.windll.DAQmxGetDevIsSimulated
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(c_bool32)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def dev_serial_num(self):
        """
        int: Indicates the serial number of the device. This value is
            zero if the device does not have a serial number.
        """
        val = ctypes.c_uint()

        cfunc = lib_importer.windll.DAQmxGetDevSerialNum
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_uint)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return val.value
项目:nidaqmx-python    作者:ni    | 项目源码 | 文件源码
def di_trig_usage(self):
        """
        List[:class:`nidaqmx.constants.TriggerUsage`]: Indicates the
            triggers supported by this device for digital input tasks.
        """
        val = ctypes.c_int()

        cfunc = lib_importer.windll.DAQmxGetDevDITrigUsage
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str, ctypes.POINTER(ctypes.c_int)]

        error_code = cfunc(
            self._name, ctypes.byref(val))
        check_for_error(error_code)

        return enum_bitfield_to_list(
            val.value, _TriggerUsageTypes, TriggerUsage)