Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

defining tasks for multi channel sampling

Hi

 

I'm using the NI 6250 for multi channel sampling.

My requirements are sampling just 2 channel at a time.  Ch 1&2, then, 2&3, 3&4 and 4&1.

 

Due to settling time consideration, I'm interested to define just  2 channels at a time. (rather then all 4 channels.)

 

The Question:  In my software (ANSI C), do I write DAQmxCreateTask for the 4 pairs, keep the 4 handles and use them later on with DAQmxStartTask and DAQmxStopTask?

CreateTask1

CreateTAsk2

CreateTask3

CreateTask4

 

StartTask1

---------

StopTask1

 

StartTask2

--------

StopTask2

 

StartTask3

----

StopTAsk3

 

StartTask4

----

StopTask4

 

ClearTask1

ClearTAsk2

ClearTask3

ClearTask4

 

 or, alternatively:

 

CreatTask1

StartTask1

---------

---------

StopTask1

ClearTask1

 

CreateTask2

StartTask2

-------

StopTask2

ClearTask2

 

etc...

 

Which is the preferred method, when the consideration is the have the most capacity the card can give?

 

Thanks

RK

 

0 Kudos
Message 1 of 6
(5,988 Views)

Hi Rafi2003,

 

I think both would work fine but I'm confused on what your concern is - can you clarify what you mean by "to have the most capacity the card can give"? What do you mean by capacity?

 

There is overhead and latency when creating the task, so are you interested in creating all tasks first and then starting them when you are ready so you don't incur the delay during acquisition?

 

 

--Michelle

National Instruments
0 Kudos
Message 2 of 6
(5,981 Views)

Hi,

 

It's about the capacity during multichannel sampling.

If I define 4 channels, the card will multiplex 4 channels.  If I define 2 channels, it will multiplex 2 channels.

I need to sample "simultaneously" (by multiplexing) only 2 channels at a time.

ch1&2, 2&3, 3&4, 4&1.

 

If I multiplex just 2 channels, I can increase the sampling rate, and this is what I meant by capacity.

 

Thanks

Bye

RK

 

 

0 Kudos
Message 3 of 6
(5,978 Views)

The 6250 has an aggregate sampling rate of 1 MS/s. If you do all 4 channels you get 250 kS/s/ch, and 2 channels at a time you get 500 kS/s/ch. What sampling rate are you looking to sample your channels at?

--Michelle

National Instruments
0 Kudos
Message 4 of 6
(5,956 Views)

Hi,

 

My concern is the settling  time between channels due to voltage differences between the channels..  There is a graph that shows the necessary settling time needed in order to keep a certain level of error.  IN my case, it is 12 us.

(The concept, however, is the same if I had wanted to use  a 500Khz sampling rate..)

 

The bottom line is that I DO want to work with just 2 channels at one time.

 

I'm trying the following solution:

    Create task with channels 1&2 with its own handle

    Create another task for channels 2&3  with another handle and so forh.

 

During the run I select one of the handles and than define the Voltage/Sampling rate etc.. and perform the read.

 

Do you know if this method will do the job?

 

Thanks

RK

0 Kudos
Message 5 of 6
(5,944 Views)

Hi Rafi2003,

I guess I misread your first post. You cannot set up 4 tasks that use the same analog timing engine, if you try this  you should get a resources reserved error.

I see what you are trying to do - but currently your best bet is probably to set up all four channels, acquire, and then post process out what data you need.

Let's compare your two options. With the 12us across the 4 channels, that gets you to 48us for the four channels - so this would be option 1. For option 2, since you cannot create the 4 tasks ahead of time and would need to create them as you go, that gives you 24us for the acquisition in addition to the time it takes for the driver to stop the task and create a new one. This last step is system dependent since it is software timed. So, you can try this out but my guess is that with option 2, it will take just as long if not longer to stop and clear the task before creating and running the next, at least longer than the 24us amount of time you would have to allow this method to be faster than the first.

Does this make sense?

--Michelle

National Instruments
0 Kudos
Message 6 of 6
(5,902 Views)