LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different measurement times with daqmx

Hi Alvin,

 

I just realized my last post wasn't entirely clear.  I'll try to get it a little better this time.

 

What you're trying to do is possible within certain limitations of the DAQ hardware.

 

There are a few case scenarios I'd like to point out:

Case 1: If you are using an internal clock, and running a continuous acquisition DAQmx Task (as Roman said)

 

You can change the rate at which this Task runs, but not at run-time.  This is a limitation of how the driver communicates across the PCI bus to the DAQ card.  Once the driver has set up a task on the DAQ card, it cannot change that task unless the task is momentarily stopped, reprogrammed, and restarted.  Depending on how fast or how deterministic you need your sampling to be, this may or may not be acceptable.  If you can wait a few milliseconds for the code to stop, reprogram, and restart the DAQ device, then this shouldn't be a problem.

 

Case 2: If you are using an internal clock, and running any sort of acquisition with multiple channels.

 

The restriction here is that specify different sampling rates for different channels if they are in the same Task.  You have one DAQmx Timing VI per task, and that is how you specify the sampling rate.  If you want different rates on different channels, then you must use a different task for rate that you want.  

 

For instance, you could have ai channels 0, 1, and 2 in one task running at one rate, and ai channel 4 in another task running at another rate, but you will not be able to change the sampling rates on either task while the task is running.

 

Case 3: You want to use an external sampling clock on a PFI line as your clock source.

 

In this case, you can specify the source of your DAQmx Timing VI to be an external PFI line.  If you do this, you can provide whatever varying clock source you would like, and it will trigger the start of an acquisition each time a clock pulse is received.  At this point, it's up to you to use whatever external circuitry or control is needed to make sure the clock source is valid (that is, it isn't jittery).  Finally, keep in mind this still has a restriction--you can only specify one clock source per task, so if you specify multiple channels in one task, they will be using that same clock source.

 

I hope this helps.  Feel free to post back if you have any questions about this.

National Instruments
0 Kudos
Message 11 of 15
(728 Views)

Hello,

 

I understand that I only have one timing VI per task. However, can I run two different timing VI's at the same time? It seems my ENET 9205 cannot run multiple tasks at the same time. Is there some other model that can?

 

Thanks again!

 

Alvin

0 Kudos
Message 12 of 15
(724 Views)

Hi Alvin,

 

I apologize, I gave a poor example for setting up multiple ai tasks.  While you can set up different AI tasks, you can't specify two tasks of the same type on the same DAQ device.  Since there is only one timing engine per DAQ device, and all the ADCs are tied to that timing engine, you would not be able to specify separate clocks in two separate AI Tasks.  Even if you route in another timing source, you would be replacing your timebase with that external source, so you couldn't use it AND the internal timing base of the DAQ card.

 

If you are limited to one 9205 device--let me step back and ask: how fast do you need these two tasks to go?  You mentioned you can't be sure, but you must have some rough idea.  The reason I ask is because you could always oversample the data and then do some post processing to remove extra samples or to average the extra samples away.

 

As far as devices that would allow you to set up different AI tasks on different cards, you could put two or more of your 9205s in a cDAQ chassis.  This would allow you to build and run a LabVIEW program with multiple tasks.

 

Hope this helps--sorry for the confusion,

-Andrew

National Instruments
0 Kudos
Message 13 of 15
(707 Views)

I was thinking about buying an other ENET 9205, but then I would probably have an excessive amount of channels. Is there no single device that has multiple internal clocks that can be used at the same time? Technically stopping the vi for a few seconds wouldnt make much of a difference, so I'm not really worried about changing the sampling rate that much for a task that much. But it would just be nice to have multiple sets of channels I can run at different rates at the same time without having to do post-processing with each experiment. I understand that there are ways around the differing sampling rates, so I guess I'm just looking at different product options at this point.

 

Thanks again!

 

Alvin

0 Kudos
Message 14 of 15
(693 Views)

Alvin,

 

The limitation isn't so much about the sample clocks available in this case, the limitation is with the analog input tasks being able to route the sample clocks available.  Since most devices have multiplexed channels (that is, they share the same ADC over multiple channels) you cannot change the timing source to that ADC mid-way through conversions.  It gets into more complexity when you consider there is a sample clock and a convert clock which run to each ADC, and these clocks need to have a very precise relationship in order to make a conversion accurate.

 

Furthermore, you can find in the X Series Manual on page 4-41 (Fig. 4-25) that, even when there are multiple ADCs for the input to a device, they are hard-wired to the same "Analog Input Timing Signals".

 

So the short answer for you is: no, I don't believe there is any single device with which you can run two separate AI tasks.  The options for doing this on a single device are as I said before (post-processing the data).  If you are looking for more options at this point, I would suggest investing in cDAQ chassis so you can run multiple ADCs with different timings.

 

Hope this helps,

Andrew

National Instruments
0 Kudos
Message 15 of 15
(674 Views)