07-29-2014 10:21 AM
Hi,
Change the type of the data queue to double, by right clicking on the constant "0" below data and choosing representation --> "dbl", do the same for the period queue as Lynn suggested. Increase the constants 10 to 1000. They should be at least twice as large as the length of your waveform, which I assume are still 10 sample points. Beyond this, you need to debug it a little. While its running, with the block diagram open, you can click on wires which will open a probe window where you can see the data that's currently going through the wire. Probe right before the zero crossing check to make sure your data is getting dequeued correctly and just after the multiplication to make sure the zero crossings are detected. Probe the array coming out the bottom of the get queue status, just below the "t" constant and see if it shows a few buffered period measurements.
Good luck!
07-29-2014 09:28 PM
Thank you guys.. it works now.. nice to have you all
12-07-2019 04:24 PM - edited 12-07-2019 04:25 PM
I am not able to get this to work. My frequency is measured too high. Can someone please help?
12-08-2019 04:07 PM
I forgot to add `dt` one last time to the signal before enqueuing. For a 100 Hz signal (0.01 sec period), this was then saying that every half period was 0.004 sec long, which is why the frequency was 125 Hz (0.5 cycles / 0.004 sec = 125 Hz). Attached is the corrected VI. (See LabVIEW Measured Frequency of Simulated Digital Signal Too High for more).