LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with my code of analog signal counter

I designed a circuit to count the pulses of the simulated square wave signal generated. I used the select tool to make the outputs of the signal as 0 or 1. Until then my code worked correctly but when I added a while loop to design my counter, the select tool is not generating the output and also the graph is also not getting generated. I don't understand why it is happening like this. Please tell me where I did the mistake. My aim is to design a counter which counts the high pulses of the input without using daqmx. 

I am attaching the two files with counter and without counter where the latter code is working fine. Please tell me why my code with counter is not working. 

Download All
0 Kudos
Message 1 of 4
(1,802 Views)

Why do you have a loop inside of your loop?  Move the shift register to the main loop and remove the inner loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,790 Views)

thank you sir, it worked and now the counter is working but it is working when the frequency is at 10.1Hz but when I am making the frequency at 50Hz then the simulaton signal is not working at all. Please tell me why it is not working when I am increasing the frequency.

0 Kudos
Message 3 of 4
(1,729 Views)

Hi Dinesh,

 


@Dinesh247 wrote:

Please tell me why it is not working when I am increasing the frequency.


Because you are using ExpressVIs and their bad companion "DDT wire"…

And because you don't pay attention to the coercion dot in your VI!

 

Replace the ExpressVIs by "simple" functions from signal processing palette. Then learn how to handle their "basic" datatypes, like DBL arrays. And learn how to compare DBL values to implement your "counter"!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(1,717 Views)