I was wondering which one of these options for using DAQmx is the best practice? Would it be a chained DAQmx create channels or would you have it split up? Do either of these have a pro or con?
Solved! Go to Solution.
The "Separate" option will allow you to have independent timing options (like sample rate), but the acquisition will not be synchronized.
The "Stack" option is giving you synchronized data, but the timing options have to be the same for both AI inputs. Also, you have to keep in mind that you are getting data from both channels in one array (that can be advantageous/disadvantageous, depends on the usage).
If you need different sample rates and also synchronized data, this will require more complex configuration, but this is already covered in the NI tutorials.
Hope this helps,
Guess what? It depends.
The stack approach is probably necessary if you're using the same device for both AI channels of interest. But then you'll also need to have a common sample rate for them. Sampling and data from the channels will be sync'ed naturally.
The separate approach allows you to use different sample rates (assuming you have 2 devices to use) and lets you to manage your 2 tasks in separate code modules, which is sometimes desirable. Sampling and data from the channels won't be sync'ed unless you take some extra measures.