01-07-2021 10:13 PM
Hello,
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?
Thank you!
Solved! Go to Solution.
01-08-2021 04:03 AM - edited 01-08-2021 04:06 AM
Hi kepham,
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.
Timing and Synchronization Features of NI-DAQmx
Signal-based Synchronization of Analog Input C Series Modules with NI-DAQmx in LabVIEW
Hope this helps,
01-08-2021 04:13 AM
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.
-Kevin P