I am trying to process an engine clock signal on a 40Mhz LabView FPGA with the part "DC and RMS Measurement".
The only information I need is whether the motor runs or not. If the motor is stopped the signal is constantly 0 or 1.
If it is switched on I get a 5kHz square signal. I already made a circuit but the output signal is either 0 or 20.
I expected a value around 10. I think my mistake is in setting the parameters. But where exactly?
Has anybody an example of how to properly use this library part? The LabView help does not help.
I had a look at your posted picture and I want to mention some initial problems:
First of all you use a digital Input Oputput Port of the FPGA. I don't exactly understand this because the DC/RMS measurement function requires an integer.
Thats why you have used the "Boolean To" Function. Nevertheless the information you get from an digital signal can never be more than 0 and 1 and therefore the values you work with later on can never have more meaningful information.
You need to use an analog signal if you want to use the DC/RMS Function.
Have a look at the following link for more information:
With this example you can see how to measure. When you receive a meaningful value you then can decide whether your motor is running or not.
I probably don't exactly understand your intended application.
But if you really only want to count zeroes or ones please have a look at the attached VI.
Keep in mind that it is required to know the size of the array, because when programming an FPGA you only should use fix array sizes.
So pre-caluclate the number of measured values during the time you want to measure to receive a senseful value for the number of array elements.
Also change the "Input Data" to the channel you are getting from your hardware (I just used it for testing), also remove all indicators, when running the
VI on the FPGA.
Also keep in mind that you don't require the timing function in the Loop. I just used it for testing.
I hope this helps.