Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

divide 20Mhz timebase for counter

Hi everybody,
 
right now I'm trying to do the following: I use the counter to obtain a rotational angle of an incremental sensor. I need to collect the values with a given sample rate, for example 5kHz. I wanted to use the 20Mhz timebase for that and divide it down, however after 4hours of reading in the knowledge base and the forums, I still haven't gained any ground on how to actually do it.
 
Anybody already done that and could give an example?
0 Kudos
Message 1 of 5
(4,351 Views)
Hi,
first of all it would be helpful to know what NI hardware you would like to use the code with.

I found a forum post that discusses a similar issue: http://forums.ni.com/ni/board/message?board.id=40&message.id=1536

Basically you need to create one counter channel (e.g. Counter 0) that creates a pulse train (e.g. at 5kHz) from the timebase. Then you need to feed this counter output into the sample clock source of the buffered counter sample clock VI.

Let me know if you need help with the example code or you would like to know more about the issue.

Best regards,
Peter
--
Peter A.
Field Sales Engineer, NI Germany
0 Kudos
Message 2 of 5
(4,334 Views)
I created a small demo VI from the example VIs. Please make sure the devices are selected correctly in the block diagram.

Best regards,

Peter


Message Edited by PaSB on 06-11-2008 05:50 PM
--
Peter A.
Field Sales Engineer, NI Germany
0 Kudos
Message 3 of 5
(4,329 Views)
Hi PaSB,
 
I use a 6036E for this purpose.
 
Sadly I need the second counter as well, so I can't create a pulse train with it. However after a few more hours of experimenting, I came up with what is shown in the attachment. It runs, however I would like to have it verified. Any thoughts?
0 Kudos
Message 4 of 5
(4,317 Views)
Hi,
I am sorry it took me so long to get back to you. I don't see any error with your vi and it seems to work on your hardware platform. If it works for your application it should be safe to use.
You could try and measure the counter outputs with a scope to confirm a stable output frequency of 5kHz.


Best regards,

Peter
--
Peter A.
Field Sales Engineer, NI Germany
0 Kudos
Message 5 of 5
(4,294 Views)