09-26-2007 05:31 PM
09-26-2007 08:20 PM
09-27-2007 12:23 PM
Hi Mitch,
The USB-6009 is a Multiplexed device, what this means in your application is that you will not be able to have simultaneous sampling, The best way to sample each channel close to simultaneous is to put each channel in the same task, This will sample each channel when the each time the task is called. You will not have to wait for the program to complete and destroy the task each time you want to change channels. This can be accomplished by clicking the add channels button in the task configuration window in Measurement and Automation Explorer. Another option is to create the task and add channels in LabVIEW, below is a link to an example program doing just that.
Multiple Input Configurations in a Single Task
http://sine.ni.com/devzone/cda/epd/p/id/4524
Thank you,
JaceD
Applications Engineer
National Instruments
09-27-2007 01:53 PM
09-27-2007 03:35 PM - edited 09-27-2007 03:35 PM
Hi Mitch,
There are two ways in which you can create and use tasks when programming with the NI-DAQmx API. With the first method you can create and save the task within the Measurement and Automation Explorer and then call that saved task from your application. The second method allows you to programmatically create and configure the task on the fly. If you plan on distributing this application to other machines I would recommend the second method because then you will not be depending on the same task configuration to be saved in MAX on the target machine.
The .net help files explain this in great detail these can be found by going to Start>>all programs>>National Instruments>>NI-DAQ>>NI-DAQ .Net Framework help. Once in the help file the picture below should help you navigate.
I also found an example and was able to successfully run it on my machine that performs exactly what you are trying to accomplish. The file path should be as follows
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\AcqMultVoltageSamples_SWTimed\vb
When you run the example when selecting the channels to use, if you insert a colon then the end of your channel list (i.e. Dev1/ai0:7) you will read all 8 channels from 0-7.
Thanks
JaceD
Message Edited by jaced on 09-27-2007 03:36 PM
Message Edited by jaced on 09-27-2007 03:37 PM