DaleFlow
2008-06-19 23:10:16 UTC
Hi
USB 6008. Python
Can anyone tell me how I can read three channels simultaneously?
I tried "Dev/ai0:2" but this did not work. Using just Dev1/ai0 gives the correct result but I need this for 3 channels (simultaneuosly)
Thanks
# now, on with the program CHK(nidaq.DAQmxCreateTask("",ctypes.byref(taskHandle))) CHK(nidaq.DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","", DAQmx_Val_Diff, #DAQmx_Val_Diff, #DAQmx_Val_RSE, #DAQmx_Val_Cfg_Default, float64(-10.0),float64(10.0), DAQmx_Val_Volts,None)) CHK(nidaq.DAQmxCfgSampClkTiming(taskHandle,"",float64(10000.0), DAQmx_Val_Rising,DAQmx_Val_FiniteSamps, uInt64(max_num_samples))); CHK(nidaq.DAQmxStartTask(taskHandle)) read = int32() CHK(nidaq.DAQmxReadAnalogF64(taskHandle,max_num_samples,float64(1.0), DAQmx_Val_GroupByChannel,data.ctypes.data, max_num_samples,ctypes.byref(read),None))
USB 6008. Python
Can anyone tell me how I can read three channels simultaneously?
I tried "Dev/ai0:2" but this did not work. Using just Dev1/ai0 gives the correct result but I need this for 3 channels (simultaneuosly)
Thanks
# now, on with the program CHK(nidaq.DAQmxCreateTask("",ctypes.byref(taskHandle))) CHK(nidaq.DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","", DAQmx_Val_Diff, #DAQmx_Val_Diff, #DAQmx_Val_RSE, #DAQmx_Val_Cfg_Default, float64(-10.0),float64(10.0), DAQmx_Val_Volts,None)) CHK(nidaq.DAQmxCfgSampClkTiming(taskHandle,"",float64(10000.0), DAQmx_Val_Rising,DAQmx_Val_FiniteSamps, uInt64(max_num_samples))); CHK(nidaq.DAQmxStartTask(taskHandle)) read = int32() CHK(nidaq.DAQmxReadAnalogF64(taskHandle,max_num_samples,float64(1.0), DAQmx_Val_GroupByChannel,data.ctypes.data, max_num_samples,ctypes.byref(read),None))