Hi, I am trying to make a simple sqaure wave 40kHz (+1v) with my NI-6215 on AO1. I am able to do this in C#, but when I try the Python nidaqmx I am not able to.
I can write a pulse, but when I add timing, I get no output.
This is what I try:
import nidaqmx
rate = 40000 # Sample rate in Hz
duration = 1000 # Duration in seconds
samples = int(rate * duration)
list = []
for x in range(samples):
list.append(x % 2)
with nidaqmx.Task() as task:
task.ao_channels.add_ao_voltage_chan("Dev1/ao1")
task.timing.cfg_samp_clk_timing(rate)
task.write(list, auto_start=False)
task.start()