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

Hi, I'm new to LabVIEW, so I suspect this is propbably quite a simple problem.

 

I'm developing an optical tacometer for a model gas turbine engine. I have a boolean signal in labview which is switching at a frequency between 4 and 26Hz. I need a live readout of the frequency of this signal.

 

Does anyone know how I could do this? Any help would be really appreciated!

 

Many thanks

 

Will

0 Kudos
Message 1 of 27
(4,926 Views)

How are you acquiring the signal from the tach?

Message Edited by deskpilot on 03-10-2010 11:59 AM
0 Kudos
Message 2 of 27
(4,908 Views)

How are you truning on the boolean? What does your code look like so far? How accurate does the frequency need to be?

 

I guess I would make an array of time and boolean state and get a running average for the cange in time vesres the state of the boolean.

Tim
GHSP
0 Kudos
Message 3 of 27
(4,903 Views)

The Boolean signal is coming from the digitial input of an I/O board, which is triggered by a phototransistor. The signal is acquired thorough ActiveX.

 

 

0 Kudos
Message 4 of 27
(4,899 Views)

Because the frequency of the signal is so low, I imagine the update frequency must also need to be quite low. If the system gave an updated frequency reading every 2 seconds, that would be great.

 

The system doesn't have to be that accurate. ±5% would be okay.

 

Thanks for your help.

 

0 Kudos
Message 5 of 27
(4,894 Views)

frequency = event/time

so basicaly what you need is to take differences of time and then invert the value.

i'd try with an event structure.

 

advice: make sure you are always counting the transition from 0 to 1, or from 1 to 0. that is the instant at which the boolean variable goes from false to true or viceversa.  

0 Kudos
Message 6 of 27
(4,877 Views)

Can you suggest any VIs to get me started? I've found a VI which detects the transition of a boolean source from TRUE to FALSE, or visversa. Could this form part of the solution?

 

Thanks for your advise

 

Will 

0 Kudos
Message 7 of 27
(4,871 Views)

Will

 

Can you post the VI you are using to capture the boolean input. May spark some ideas.

 

 

Herrlin

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 8 of 27
(4,863 Views)
Solution
Accepted by topic author Will15648
This vi should work for you
Tim
GHSP
Message 9 of 27
(4,860 Views)
Works perfectly! Thanks very much.
0 Kudos
Message 10 of 27
(4,820 Views)