01-17-2012 01:12 PM - edited 01-17-2012 01:14 PM
If I read channel assignment from a configuration file (e.g. 9205 AI0:AI1), how can I create DAQ tasks using corresponding physical channels in labview?
Solved! Go to Solution.
01-17-2012 01:29 PM
So far what I come up with is
1. create a string constant array with channel names that corresponds to the all physical channels array one to one.
2. Read from configuration file and find the index in the array.
3. Index the physical channels array to pick out the correspondign channel.
The problem with this is I have to create a task for every single physical channel it picked, because I can't create the physical channels like when you use multiple selections in the Browse dialog box the way you typically do for a Physical Channel constant.
01-17-2012 03:15 PM
You can call DAQmx Create Channel serially for each physical channel connecting your task reference into the 'task in' input so that all will be part of the same task. Hope this is what you are trying to do.
01-17-2012 03:26 PM - edited 01-17-2012 03:26 PM
see attached for a simpler attempt
01-17-2012 03:30 PM - edited 01-17-2012 03:31 PM
Thank you for the code. That solves the problem.
Can I typecast a string to a DAQmx Physical Channel? This will further simplify my program.
rpursley8 wrote:
see attached for a simpler attempt
01-17-2012 03:34 PM - edited 01-17-2012 03:35 PM
You should be able to. The code does it already at the input to the Create Channel vi