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: 

Count Squares with 500Hz

Hi!
 
I've generated with the ExpressVI "Simulate Signal" a Square with the maximum frequency of 500Hz (it varies). Now I want to count the falling flanks.
I tried this with the "Trigger Counter.vi"-Example which I slightly changed for my purposes. (see attached file) But it seems as if the Counter is not fast enough for my Signal (- it counts too slow).
 
Does anybody have an idea how I can solve the problem and count the correct value of squares?
 
Shorty to my system: I tried it with a 2GHz Sempron with LabView8 
                                      and with a 1,3GHz Centrino with LabView7.1
 
Thank you in advance
  Hendrik

0 Kudos
Message 1 of 8
(2,954 Views)

Puplicate Dost, see here:

http://forums.ni.com/ni/board/message?board.id=40&message.id=3422

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 8
(2,944 Views)
I know! I already asked the Admin to delete the post in the HardwareBoard.
I accidently posted it there first because it maches to the topic "Counter/Timer". But I'm looking for a software solution. So I posted it again in this board!
 
Sorry for unintentional spamming... 😞
 
I hope nevertheless that anybody has a solution for me...
0 Kudos
Message 3 of 8
(2,938 Views)
Hendrick
 
No problem, welcome to the forums happy smiley.
It's common to flag duplicate posts to prevent duplicate efforts at solving a problem. Thanks for asking the Admins to delete one.
I am sure some will be able to assit.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 8
(2,935 Views)

If you have a simulated square wave waveform, you can count falling edges by simple emulating what a counter does, essentially for each poind threshold it.  If it is above some threshold it is a high value, and if it is below th it is low, use a shift register to compare sequential hi/low booleans.  Check for a high to low transition (if n-1 is high and n is low there is a falling edge) use another shift reg to count these events.  Do this for every point in the waveform.  If you have simulated a noisy signal, you can get more advanced usint techniques such as a schmitt trigger (hysterisis).

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 5 of 8
(2,925 Views)
Thank you very much Paul, your solution is working fine and it is so easy that I'm a little bit ashamed that I posted that question!
0 Kudos
Message 6 of 8
(2,906 Views)
No problem, the answer always seems much easier once you have seen it.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 7 of 8
(2,898 Views)

Do you have the trigger counter.vi? I don't have it in my examples.

0 Kudos
Message 8 of 8
(2,517 Views)