Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using AI Sample Clock to Trigger Counter Samples

Solved!
Go to solution

My basic question is:  Is the ai\SampleClock signal only active while an analog input task is running?

 

The details are:

I have an X-series PCIe-6321 multifunction DAQ card.  It is controlling a SCXI chassis and has a SCXI-1180 and SCXI-1302 so I can control analog inputs of the chassis as well as access the 4 counter  on the card.  My application requires that I use all 4 counters to measure a frequency input signal and synchronize the samples to the analog input signals.  I have created 5 tasks, 1 for the AI and 1 for each counter.

 

I am using LabVIEW 8.6.1 with the latest NI-DAQ drivers on and 64-bit Vista OS 

 

1. Are there any driver or hardware restrictions that would cause this solution not to work? 

2. Can I use the ai\SampleClock as in input sample clock for each of the frequency tasks?  If I do this will the sampling start be syncronized?  I.e. if I start each of the frequency tasks first, will they wait until the AI task is started before they start sampling?

3. If that doesn't work, do I need to route the sample clock from the AI task to a PFI line (PFI1) and then use that as input to the frequency task sample clock? 

 

I usually do option 3 when synchronizing two cards in  PXI chassis and only use the software task start in stead of of synchronizing on a digital start, since the sample clock will control the samples anyway.  I need to know if the same behaviour works with the scenario above.

 

Thanks,

Bob

Prolucid Technolgies Inc. 

 

 

0 Kudos
Message 1 of 4
(7,489 Views)
Solution
Accepted by topic author bob@prolucid

Hi Bob,

 

I can confirm that the ai/SampleClock will only be active while the AI task is running.  As far as the other questions go:

1.  You'd have to provide more information about what you looking to do exactly, but there is no problem with routing the sample clock of the Analog Input task to be used with the Counters.  I would read through the section of the X Series User Manual that discusses sample-clocked frequency measurements (starting on page 7-16) for some more information about what is actually going on during this configuration to make sure it suits your requirements. 

 

The frequency of the signal to be measured should be at least twice as fast as the sample clock of your AI task.

 

 

2.   You can indeed route the signal to all four tasks at the same time (you can refer to the Device Routes page in MAX to double-check routing restrictions).  The sampling will be synchronized provided the four counters are started before the AI task, but the counters will be armed at different times unless you configure an Arm Start Trigger (see page 7-45 of the X Series User Manual).  I would consider using the ai/StartTrigger if you wish to do this. 

 

The effect of not arming the counters at the same time would be a different number of periods to average on each counter for the very first sample (assuming averaging is enabled).  This might not be a big concern but I just wanted to point it out.

 

 

3.  The routes are available internal to the board so external routing isn't necessary, you can just specify to use the AI Sample clock for the clock of each counter and the routes will be made for you.  If you prefer to export the signal on a PFI line and route it back in on a different PFI line this option is also available to you but shouldn't be necessary.

 

I hope this helps you get started.  I'd make sure to take a look at chapter 7 of the X Series User Manual if you get a chance since it describes how all of the counter configurations work in more detail.  If you have any related questions don't hesitate to post back.

 

 

Best Regards,

John

Message Edited by John P on 12-01-2009 07:52 PM
John Passiak
Message 2 of 4
(7,476 Views)

I actually have a better solution for the Arm start if you wish to use this...

 

I had previously mentioned to use ai/StartTrigger as the Arm Start.  The problem with this is that the default amount of time between the StartTrigger and the first sample clock edge is only a couple timebase ticks.  I would look into the following two options if you want to use an Arm Start Trigger:

1.  Adjust the delay between the start trigger and first sample clock ege.  You can do this with the following DAQmx property node:

Sampl_Delay.PNG

2.  Trigger off of ai/SampleClock instead of ai/StartTrigger.  Your counter acquisition will lag one sample behind your analog task if you go this route.

 

 

Again, don't hesitate to post back if you have any questions.  Thanks!

 

 

-John

John Passiak
Message 3 of 4
(7,463 Views)

Thanks for your response.  I won't be testing this out for a while but with your description I think it should work fine.  I'll let you know if anything else comes up.

 

Bob 

0 Kudos
Message 4 of 4
(7,429 Views)