stream_writers.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:nidaqmx-python 作者: ni 项目源码 文件源码
def write_one_sample_one_line(self, data, timeout=10):
        """
        Writes a single boolean sample to a single digital output
        channel in a task. The channel can contain only one digital
        line.

        Args:
            data (int): Specifies the boolean sample to write to the
                task.
            timeout (Optional[float]): Specifies the amount of time in
                seconds to wait for the method to write all samples.
                NI-DAQmx performs a timeout check only if the method
                must wait before it writes data. This method returns an
                error if the time elapses. The default timeout is 10
                seconds. If you set timeout to
                nidaqmx.constants.WAIT_INFINITELY, the method waits
                indefinitely. If you set timeout to 0, the method tries
                once to write the submitted samples. If the method could
                not write all the submitted samples, it returns an error
                and the number of samples successfully written.
        """
        auto_start = (self._auto_start if self._auto_start is not 
                      AUTO_START_UNSET else True)

        numpy_array = numpy.asarray([data], dtype=numpy.bool)

        return _write_digital_lines(
            self._handle, numpy_array, 1, auto_start, timeout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号