Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing channels used by a task

I'm using NI-DAQ 8.? and LabVIEW 8.5 along with a USB-6259 module.  I have to simultaneously charge 32 capacitors using one digital output line. Then I have to individually discharge them, using discrete digital output lines, across individual SCRs while sampling the discharge curve at full speed with the each of 32 analog inputs.  I also need to repeat this as fast as possible.
 
I have a solution for the charge and discharge pulses that works fine.  I also have a task that samples a single channel, but am having trouble changing the channel without recreating the task.
 
Is there an easy way of just changing the channel of the task that does not have a major speed cost?
 
Is there a downside to creating 32 individual tasks?
 
Any help would be appreciated.
 
JJJ
0 Kudos
Message 1 of 6
(2,888 Views)
If you want to have a single channel in a task, you have to clear it and for a new channel, start a new task. There is no way around this with a DAQ card with muxed inputs and there is considerable overhead in starting and stopping a task. You can create a single task with all 32 channels. You have a max sample rate 1MS/s so each channel would be sampled at 1M/32. If that sample rate is okay, then it would be faster to have a single task that you do not start and stop.
0 Kudos
Message 2 of 6
(2,881 Views)

I have to sample my inputs at 1us and can't afford any more delays, so I guess I will have to create 32 separate tasks.

Is there a downside to this method?

JJJ



Message Edited by John J on 07-27-2008 12:55 PM
0 Kudos
Message 3 of 6
(2,864 Views)
As I said, you will have to run each task sequentially. Start a task, acquire the data, stop it. Repeat for the next channel, etc.
0 Kudos
Message 4 of 6
(2,861 Views)
I have to do this sequentially, so that is fine.  I just needed to know the rules of the game.  Even though I'm pretty good with getting the most out of documentation, it's not always obvious how the available resources can best be utilized in a given situation.
 
I was just trying to save the overhead of clearing and recreating the task for each input, since I feel the need for speed.
 
As I understand it, I should be able to do the following.
 
 
Create tasks 0 -31, which are identical analog input tasks, one for each analog channel
 
Start task 0
Wait for task 0 done
Stop task 0
 
...
 
Start task 1
Wait for task 1 done
Stop task 1
 
...
Start task 31
Wait for task 31 done
Stop task 31
 
...
 
Clear tasks 0-31
 
 
Thanks for your help.
 
JJJ


Message Edited by John J on 07-27-2008 05:52 PM
0 Kudos
Message 5 of 6
(2,857 Views)
No, you cannot create the 32 tasks at the beginning. You cannot have more than one task at a time. The functions you use are DAQmx Create Channel, DAQmx Read, DAQmx Clear and then repeat for the next channel. This will be the most time consuming way possible to read 32 channels.
0 Kudos
Message 6 of 6
(2,848 Views)