From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you count the frequency of a boolean signal?

Solved!
Go to solution
Here is a simple example of waht I did. If you change the loop time the cal freq vi does not care.
Tim
GHSP
Download All
0 Kudos
Message 21 of 27
(1,153 Views)

aeastet wrote:
Here is a simple example of waht I did. If you change the loop time the cal freq vi does not care.

 

Im not following you becasue if you change the loop time the freq changes.
Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 22 of 27
(1,151 Views)


Will15648
wrote:



.... I need a live readout of the frequency of this signal.




 

Herrlin wrote:



I still would like to see how Will is getting his data from
the digitial IO.  In my mind for this code to kinda work the data would
have to be streaming real time.


 

Based on the first request on this tread it got the impression that it was a live measurement.

 

Tim
GHSP
0 Kudos
Message 23 of 27
(1,150 Views)
But we are not going off of the loop frequency we are going off of the boolean change. The chage is just hard coded to show the example of what I am talking about.
Tim
GHSP
0 Kudos
Message 24 of 27
(1,149 Views)

All I’m saying is without knowing the device sampling rate you can’t accurately figure out the frequency.  I feel that it is poor practice to use system time to determine sampling rate.  As far as the LIVE frequency goes that’s the frequency out that is live not the input.

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 25 of 27
(1,144 Views)
That is why I asked earlier how accurate the measurement needed to be.
Tim
GHSP
0 Kudos
Message 26 of 27
(1,142 Views)

After reading the initial post, here is a test bed example:

 

 

The top While Loop represents the randomly generated boolean signal at a frequency between 4 and 26 Hz.  The signal uses a Notifier which triggers the bottom While Loop.  The delta time is calculated on the difference in milliseconds.  That is why the delta time is divided by 1000 to convert to seconds.  Unless I am mistaken, frequency is f=1/T, where T is the period (or delta t in this case), not delta-t/60.  
The flashing LED's represent 1)  The random ON or OFF state of the binary signal (that was not specified, so I invented  for this example) and 2) an boolean that alternated between 0 & 1 at the rate of the varying frequency (for visula illustration).
 Sorry about my original post and hopefully, this example will help somewhat.  And yes, it's been one of those days..  😉
Message Edited by Ray.R on 03-11-2010 04:53 PM
Message 27 of 27
(1,124 Views)