11-16-2017 09:14 AM
Hi there,
I need to have a VI that can receive a squarewave input up to around 500 Hz, (I actually expect to be around 400 Hz max) but I don't yet know what the duty cycle will be. The high time of the wave could be as short as 10 us or so, because I am actually getting the squarewave from a shaft rotating upwards of 20,000 rpm, and I don't know how big the contact on the shaft is yet. I have a very simple program that can display the frequency that my NI USB 6343 is reading on an analog input, but when I test my VI it seems like below around 400 us high time I no longer display the correct frequency. There must be a way to either modify my VI or use another implementation entirely using Counters?
My simple VI is attached
thanks!!
11-17-2017 09:49 AM
Hi L2chill,
I looked at your code and my hunch is the express VI (Tone Measurements Express VI) inside the while loop. Can you benchmark the time the express VI takes? There is an example of how to do this here.
You could also do this manually with a couple Tick Count (ms) VIs and a flat sequence structure with 3 frames. I attached the modified VI. You could extend this to the whole while loop to see how long the entire loop takes! Let me know if that identifies the problem with the Express VI.
Thanks!