07-16-2014 02:15 PM - edited 07-16-2014 02:28 PM
Basically what I am trying to do is programmatically create "n" number of "Daqmx create channel" controllers based on user inputs. Currently I had to create manually three channels and wire them to the sample clock for data acquisition. My idea is to ask the user for how many channels does he want, say n and the VI should programmatically create n number of sequential channels and wire them automatically to the sample clock for DAQ.
07-16-2014 02:32 PM
Hi,
the easiest way would be to do that in a For Loop.
Could you explain what is the overall functionality you want to achieve? I have a feeling there is a much simpler way to do it than dynamically creating channels.
07-16-2014 02:34 PM
Are all of these channels on the same device?
You really should be setting up 1 task that handles N channels. Just use a FOR loop with Create DAQmx Channel.vi in it. Use a shift register to hold the task reference so that each channel is added to the task. I would recommend using Create DAQmx Task.vi and wire its task reference to initialize the shift register. Then you only need to set the clock for a single task.
07-16-2014 02:41 PM
What I am trying to do is create n number of DAQmx create channel Vis based on the user input which have unique channels assigned to each of the Vi but are on the same task. So if a user says he needs 3 channels. I want to create only 3 "DAQmx create channel" VIS linked tro the same task.
07-16-2014 02:47 PM - edited 07-16-2014 02:48 PM
Here's how I typically do it. You could change it some to autogenerate what channels to use. I normally read task information from a configuration file and I therefore have an array of channels to add to the task.
07-16-2014 02:47 PM
07-16-2014 02:48 PM
No they are not on the same device. What I am trying to create is extract channels from different devices. So the inputs may contain analogs, digtals, signals etc. I want to create n number of DAQmx Create channels- (same tasks for the same device). So every channel has its own data stored and plotted on the same waveform graph.
07-16-2014 02:55 PM
Thanks for the Vi. I will try it out and let you know How did it go.
07-16-2014 03:03 PM
07-16-2014 03:06 PM
Yes, you are right. I am sorry, I meant, I am trying to use different tasks for different devices.