LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean signal counter

Solved!
Go to solution
Highlighted

Hi

 

I found similar program about that i want but I failed to insert it into my VI, than...... I need a counter that indicate me how many times the boolean Led switch-on .

 

My VI is attached

 

Thanks all

0 Kudos
Message 1 of 12
(3,199 Views)
Highlighted
comming soon
"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 12
(3,190 Views)
Highlighted

I modified your code by:

 

  1. Added a shift register to maintain the current Count of "Siganl"=True
  2. Added a boolean case structure to increment the value in the shift register only when "Siganl"=True
  3. Added a numeric indicator to display the updated shift registers value.
  4. Cosmetic changes to improve apperances - I assume you stripped outsome additional functions however you may want to review the style guide here
"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 12
(3,183 Views)
Highlighted

Jeff, your code is not correct, because it generates multiple counts for each square wave. I think the OP only wants to count low-high transitions.

 

You need two feedback nodes (or shift regsiters), one for the boolean state and one for the counter.

 

Here's a quick modification, there are many ways to do all that.

 

Message Edited by altenbach on 01-23-2010 11:59 AM

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
Message 4 of 12
(3,164 Views)
Highlighted

Your right!

 

I was counting iterations where Siganl was true.

 

 

 

I mis-interperated the post If the OP only wants to count transitions

"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 12
(3,154 Views)
Highlighted
Solution
Accepted by Teo_CF
implies.png

Jeff Bohrer wrote:

Your right!

 

I was counting iterations where Siganl was true.

 

 

 

I mis-interperated the post If the OP only wants to count transitions


this works pretty well (reverse the inputs to Implies and init the sr T to count negative transitions)

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 12
(3,148 Views)
Highlighted
psstimplies2.pngsame thing but fewer clicks Smiley Wink
"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 12
(3,147 Views)
Highlighted
implies3.pngHmmmm Snippet cut off the invertSmiley Mad
"Should be" isn't "Is" -Jay
Message 8 of 12
(3,139 Views)
Highlighted

I used the compound node instead of implies because I also needed to invert the output in this specific implementation. 🙂

 

(Of course if you use a case structure, you have a choice of what you do in the false or true case) 😉


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 9 of 12
(3,136 Views)
Highlighted

Thank you very much for helping me guys!!

 

See you next times!!

0 Kudos
Message 10 of 12
(3,099 Views)