Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple analog inputs by multiple digital triggers

I an trying to read in multiple analog inputs (ai0:2) triggered by a digital trigger PFI0.  Then, some time later, ~30 ms, I would like to read in ai3:5 triggered by PFI1, and so on.  I have a task created for each input block of 3 analog inputs. I am using a sequence to ensure that I am not trying to read two tasks simultaneously.  My error is that the reseource is reserved.

 

Through my research, I believe I need to set a sample clock at a certain rate.  Do my tasks need to be "HW timed" or "on demand?"  Also, do I need to share one sample clock or set up one for each analog input task?

 

I find examples of reading analog inputs with one trigger signal, but not multiple trigger signals.

 

Do I need to create a pulse train instead like this Knowledge Base recommends?

http://digital.ni.com/public.nsf/allkb/82DAECADE90CC56F8625659200675B2A

 

Is this VI retriggerable with different digital triggers?

https://decibel.ni.com/content/docs/DOC-12181

 

I am using a PXIe-8101 RT controller with two X-series PXIe-6363 DAQ cards.  LabView version 9.0.1.

 

Thanks for any help.

0 Kudos
Message 1 of 3
(2,400 Views)

Hi lcarlson,

 

You can't have two analog input tasks running at the same time.  If my understanding is correct then you should be able to make this work if you know the order that the triggers are going to occur.

 

It's not straightforward, but here is the general idea:

 

1a.  Configure DI task with Change Detection Timing (used as a dummy to be able to configure change detection).  The lines in this task should be any lines on port 0 that you wish to connect your external triggers to. 

 

1b.  The DI task with change detection timing could be replaced with an external OR gate.

 

2.  Configure a retriggerable finite counter output.  The trigger source should either be the Change Detection Event (if using 1a) or the appropriate PFI line that is connected to your external OR gate (if using 1b).  It should generate 3 pulses @ 1 MHz (or lower frequency if you need additional settling time between AI channels--1 MHz only gives 1 us between channels).

 

3.  Configure the AI task with all of your required channels.  The convert clock source should be set to the internal output of the counter (from step 2).

 

 

So, when you get a pulse on any of the desired lines, the counter would generate 3 pulses and you would sample the next 3 of your analog input channels.  Note however that the triggers have to come in a certain pre-determined order, as the actual line that the trigger occurs does not affect which AI channels are sampled.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 3
(2,395 Views)

Hello John P,

 

Thanks for your suggestion.  I am trying to break up the analog inputs by putting them in a sequence so that they don't run at the same time.  At first I had them in a layered sequence, but now I've converted them into a long flat sequence and it seems to work better.  If I allow a wait time of ~1ms after the task, then I think it frees up to ADC for the next analog input task.  This seems to be working for me now for the time being.  I will keep your suggestion in mind if it doesn't work.

 

Thanks,

lcarlson

0 Kudos
Message 3 of 3
(2,347 Views)