11-23-2022 02:59 AM
Hi there,
The device is NI-DAQ 6343(BNC).
My work needs to switch the output voltage quickly.
But now it switches slowly (about 8ms).
Can I adjust the speed of the analog output switch ?
My code is as follows:
task = nidaqmx.Task()
task.ao_channels.add_ao_voltage_chan('Dev1/ao0')
task.ao_channels.add_ao_voltage_chan('Dev1/ao1')
while(1):
for i in range(y_points):
for j in range(x_points):
y_v = XXXX
x_v = XXXX
task.write([x_v,y_v], auto_start=True)
11-26-2022 08:59 PM
You're using software timed-IO which means the speed at which the input/output changes depends on how fast the software tells it to.
This method is good for slow operations and it is not deterministic in other words, if you try to achieve an update rate of 1ms, it will not be precisely 1ms and for an unknown reason, your OS decides to allocate its processing power elsewhere (like windows update or antivirus scan), your 1ms update rate might fall short by a large factor.
You can achieve faster rates by using hardware timed-IO, here, you supply the DAQmx driver with an array of values that the hardware will update at a fixed rate called sampling rate ensured within the DAQ hardware and not impacted by your OS.
11-30-2022 08:24 AM
Ths for your reply. That helps me a lot.