LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

divided timebase

Solved!
Go to solution

In simultaneous measurement with AI and AO, I used PXIe-6124 which supports timebase clock of 80MHz.

I was told I can use 80M/n(integer) as a sample rate in PXIe-6124.

In order to get n is integer, I limited my parameters to 2 and 5 common factors. 

 

But, why the actual sample rate is different to the input sample rate, 1.6MHz (n=50).

The actual rates are 1.67E+6 (analog input) and 1.54E+6 (analog output).

 

What's wrong for this problem?

Any other to consider in making the sample rate? 

 

labmaster.

0 Kudos
Message 1 of 11
(4,430 Views)

Hi labmaster,

 

The 80 MHz timebase is actually only used for counter tasks--AI and AO tasks can use the 20 MHz timebase or the 100 kHz timebase.  This information can be found in the 6124 user manual though admittedly it can be difficult to find if you don't know where to look  (see page 4-16).

 

So, while 1.6 MHz would go into 80 MHz evenly, it does not go into 20 MHz. 

20 MHz / 12 = 1.67 MHz

20 MHz / 12.5 = 1.6 MHz

20 MHz / 13 = 1.54 MHz

Given the above information, the sample rates you are receiving should begin to make more sense.  The final piece of information to note is how DAQmx chooses to coerce sample rates by default:

 

  • For AI tasks, the sample rate will always be coerced UP to the next available sample rate.  The assumption is that acquiring a little bit faster would be more desirable than a little bit slower. 
  • For AO tasks, the sample rate will be rounded to the nearest available samlpe rate.  The assumption is that the user would want to generate a signal as close as possible to the desired frequency.


Hopefully this clarifies the behavior you are seeing, if you have any questions about it feel free to post back.  Thanks and have a great day!

 

-John

John Passiak
Message 2 of 11
(4,390 Views)

One more thing to add,

 

If you require the exact 1.6 MHz sample clock, you can use one of the counters on the 6124 to generate the 1.6 MHz signal and use this as your sample clock source.  In this case, you would set the AI and AO sample clock sources to the Counter Internal Output.  For help on setting up the counter task, you can refer to the following example:

 

Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Generating Digital Pulses >> Gen Dig Pulse Train-Continuous.vi

 

You could also provide an external clock source on one of the PFI lines.  I hope this helps!

 

-John

John Passiak
0 Kudos
Message 3 of 11
(4,371 Views)

Thank you John.

 

I have two more question about your reply. 

============

I got to know the sample rate can be applied upto 10MHz in Timing.vi without any other restriction..

Can I put the any number (for example 1.234MHz) to the sample rate? 

It will be very good news.

 

============ 

I have already used a counter channel for a trigger signal(digital mimic of AO for simultaneous measurement) of other external device(function generator).

The start trigger was transfered to AO and Counter from AI. 

DAQmx and generator were linked to 10MHz reference signal of PXI for starting simultaneouly.

 

Unfortunately, therefore, the counter should be activated just after AI and AO.

 

Under this limitation, can I operate one more counter for sample rate of AI and AO?

Or do I have to buy separate counter in different DAQmx card?

 

Thank you again.

 

labmaster.

0 Kudos
Message 4 of 11
(4,356 Views)

Hi labmaster,

 

The max sample rate on the 6124 is 4 MHz per channel (20 MHz/5), setting a rate higher than this would throw an error.

 

You may put a number such as 1.234 MHz as the sample rate, but this would coerce to 1.25 MHhz to fit the limitations of the divide-down clocking (20 MHz / 16).  If you provide an external sample clock, then you can acquire/generate at the rate of the clock (provided it is under 4 MHz).

 

There are two counters on the 6124--you may run these in seperate tasks with their own timing and triggering parameters.  Using the first counter should have no effect on the second in this case, so you shouldn't need to purchase another board with more counters.

 

 

-John

John Passiak
0 Kudos
Message 5 of 11
(4,346 Views)

Hi, John.

 

I asked incorrectly. I understood what you mean. yes, under counter signal as a sample rate.

I will try to route other counter to the sample clock.

 

If I can use an arbitrary rate, I don't have to have a common factor 2 and 5 in sample rate.

However, can you tell me the "practical" resolution(1.234kHz or 1.234567MHz?, 1Hz?) of sample rate in using counter signal?

I would like to make a program to set the sample rate (from 3 variables) with reasonable number.

 

I need your one more support and thank you for your invaluable comments.

 

labmaster.

 

Message Edited by labmaster on 05-30-2009 01:51 AM
0 Kudos
Message 6 of 11
(4,338 Views)

Hi, John.

 

I tried to implement your comment to my code.

Thank you. eventually, I observed the same value in input and output sample clock in AI and AO.

 

0)Besides of resolution, I want to get your more comment.

1)How do I check the real sample rate of counter(Ctr2)?

2) AI, AO, and two counters(Ctr1:sample clock, Ctr2: trigger signal of AWG) in DAQmx and AWG (other device).

I intend to set all channel above should run simultaneously.

 

-AI, AO, Ctr2 shared the common sample rate from Ctr1 counter. 

-AI, AO, Ctr2, and AWG shared the reference signal of 10MHz of PXI backbone.

 

Do I have to run "start task.vi" of Ctr1 and "Fgen start.vi" after running AI, AO, and Ctr2?

 

From your comment, I got to know more basic concepts about DAQmx. 

In my beginning, I wonder the purpose of sample clock source terminal.

I am very happy to use this in my project. 

 

Thank you again.

 

labmaster.

 

0 Kudos
Message 7 of 11
(4,319 Views)
Solution
Accepted by labmaster

Hi labmaster,

 

It sounds like you're on the right track--to address your questions:

0)  The counter tasks can use the 80 MHz timebase (20 MHz and 100 kHz are also available).  So, the available frequencies you can generate using the counter is 80MHz/N, where N is an integer (between 4 and 2^32).  You are still limited to the divide down method, but you would be working with a higher timebase so you could achieve frequencies that you couldn't otherwise (such as 1.6 MHz).
1)  You can check the actual sample rate of the counter using the following property node:
CO_Freq.PNG
2)  You may run the AI, AO, and two counters simultaneously in seperate tasks -- I would start AI, AO, and Ctr2 before Ctr1 so that all the tasks will start simultaneously.  If you started Ctr1 first, then the clock would be running so the tasks would start at different times (based on the software) unless you were using a trigger to start them.

I'm glad to hear that this has been helpful for you--I hope all is well and the best of luck to you with your application!

 

 

-John

John Passiak
0 Kudos
Message 8 of 11
(4,276 Views)

Thank you so much, John.

How can I choose the basetime of counter?

I got to know "timing.vi (implicit)" has no any input of internal clock source.

Do I have to use timing property node?

 

 

labmaster.

0 Kudos
Message 9 of 11
(4,254 Views)

Hi labmaster,

 

The timing.vi function is used to configure the sample clock--this is actually different from the counter timebase.  Rather than use a DAQmx Timing Property Node, you should use a DAQmx Channel Property Node to configure the counter's timebase.  (Counter Output >> General Properties >> Counter Timebase).  The timebase should default to the fastest possible value depending on the characteristics of the pulse that you want to generate.

 

The reason that Implicit timing is used for many counter tasks, is that the "sample clock" is defined by the timebase source.  In our case, we can think of each pulse as a "sample", so the rate of samples is determiend by other parameters in the task (we do not use a sample clock to start the pulse, but rather the counter generates the pulse based off of a sample clock).  The Implicit timing function is necessary to differentiate between continuous and finite pulse generations.

 

-John

John Passiak
0 Kudos
Message 10 of 11
(4,223 Views)