Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I take 4 frequency readings with a USB-6251?

Can I take frequency readings on 4 different digital input channels of my USB-6251?  I am using 1 of my counter channels for a Pulse-Width output.  Can anyone show me some example code for this or explain how to attempt this?

Jeremy Backer
CLAD
0 Kudos
Message 1 of 2
(3,740 Views)

Hi JMBacker,

 

You can make a frequency measurement from you digital lines, but you would have to do it in software. To actually take a frequency measurement in hardware you would have to use a counter input.

 

In order to do this with your digital inputs you will have to know your sampling rate, and do some manipulation to the array of values that you get when reading the values from the port. You would only be concerned with the 4 lines of the port you configure. Once you store that data in the array you would have to check for the number of samples between two transitions from 0 to 1, then multiply that by (1/sampling frequency) and take the inverse of that value. This will give you the frequency value of one period of your input signal. You would have to do this process with each of the 4 desired input lines in one port. 

 

Attatched is an example program that takes that measurement and computes the frequency in software. This is in LabVIEW version 8.2.1, but can be used in any version at or newer than that version.

 

Chris N White

High Speed Products Group
0 Kudos
Message 2 of 2
(3,723 Views)