LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi tasks for multi chan input for PCI-6251

Hi, 

 

I am trying to develop an application for completing multiple acquisitions with a PCI-6251 card and a BNC-2090A.

 

I need to run 2 tasks in DAQmx to accomplish 2 acquisitions at once.

 

The tasks I need to complete are:

 

1) Two input impulse voltage input to Chan1 and chan2;

2) A software trigger for Chan1 only;

 

I can use example Acq&Graph Voltage-Int Clk-Analog Start w Hyst.vi from shipping example to work for only one chan.

 

I try to use two DAQmx tasks for two chan; there is always an error, say “the resource is reserved”. There is only one chan work.

 

I see most PCi card has many input chan. There should be an easy way to make multi-chan input work.

Please can supply an example for “two input chan” example.

 

detech

0 Kudos
Message 1 of 7
(2,828 Views)

Hello,

 

First of all you must realize that you cannot have multiple Analog input tasks running at the same time because there is only one timing engine on our cards.  However you can have a task with multiple channels in it.  This can be seen in  the attacfhed screenshot.  keep in mind however that because there is only one timing engine, and therefore you can only have one analog input task running at one time, you can only have one sample rate per task, and only one trigger per task.  That is to say that you cannot have different triggers, or different sampling rates for different channels within one task. 

 

I hope this helps, 

Charley Dahan

Global Account Manager
0 Kudos
Message 2 of 7
(2,812 Views)

Thanks. I did made it work per your vi. However, I really need a pretrigger sample per channel, which dispears when i switch to start analoge edge from reference analoge edge.

Is any similar function we can add to it?

Thanks

Liming

0 Kudos
Message 3 of 7
(2,803 Views)

No this is not possible with an analogue start trigger.  The reason for this is with a reference trigger, you being acquiring when you start the task.  Data is stored in the buffer and when the reference trigger fires the pretrigger samples are already in the buffer. and therefore returned with whatever post trigger samples you specify.  On the other hand a start analog trigger does not begin acquiring data until after the trigger fires therefore there is NO samples in the buffer (Pre-trigger samples) before the trigger fires to designate as 'pre-trigger' samples.

 

I hope this clarifies things.  If you need to have pre-trigger samples, a reference trigger is the only way to go. 

 

 

Charley Dahan

Global Account Manager
0 Kudos
Message 4 of 7
(2,792 Views)

Thanks. The reference trigger can not make two chans work toigether. I am right? Or how ?

Thanks aagain

liming

0 Kudos
Message 5 of 7
(2,790 Views)

Correct the reference trigger will not synch two tasks together.  However in your case because you are simply using one task with multiple channel inputs when you start your task both channles begin acquiring together according to the same sample clock.  (there is some delay between the to channel reads because of the multiplexer on the card - they are not sampling simultaneously).  Then configure a reference trigger to get the pre-samples that you require. The reference trigger is for the task at hand and not per channel bases.  it is impossible to specify different triggers for different channels within one task. 

 

Please note if you are using solely a reference trigger the Acquisition will start when you start the task and will return data when the reference trigger fires.  It will return data for all channels within that task. 

 

I hope this clarifies things let us know if there is anything else!

Charley Dahan

Global Account Manager
0 Kudos
Message 6 of 7
(2,766 Views)

Hi detech,

 

Also note that on M Series, if you are using an analog reference trigger and the trigger source is a channel from the task, you can only have one channel in the task. (If DAQmx allowed this, then the analog trigger circuitry would trigger when the analog multiplexer switched to a new channel.) You can work around this by using APFI0 or APFI1 as your trigger source and wiring the signal to the corresponding analog PFI terminal.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 7 of 7
(2,758 Views)