I try to use Ni-Daq to generate pulse. the example provided by the nidaqmx is like as follows:
import nidaqmx
from nidaqmx.types import CtrTime
with nidaqmx.Task() as task:
task.co_channels.add_co_pulse_chan_time("Dev1/ctr0")
sample = CtrTime(high_time=0.001, low_time=0.002)
print('1 Channel 1 Sample Write: ')
print(task.write(sample))
But after I run this script, it generate some errors as shown below:
raise DaqError(error_buffer.value.decode("utf-8"), error_code) DaqError: The task is not buffered or has no channels. If the task is not buffered, use the scalar version of this function. If the task has no channels, add one to the task. Task Name: _unnamedTask<0>
Status Code: -201395
what cause the problem? how to fix that?
Thank you very much!