02-15-2016 08:12 AM
I'm new to labview programming and myrio hardware.
I want to get rpm from encoder. I did it. successful. But I have some other issue. So I need advice on doing it another way.
Method 1 (my current method)
Preset a time duration. Count the number of pulses that occurs in that time duration. Do some simple math. Done! I got the rpm. and it works. (I used a while loop with a wait of 50ms, and manage to read approx 170 pulse within that timing, correctly translating to about 70rpm for my motor)
Method 2 (the method I want to try but failed to do it)
Is there an exisiting vi/function that will directly give me the frequency of the square wave from the encoder coming in from the input pin of myrio? I tried to use tone measurement, but I saw nothing at the "Frequency" output of the "tone measurement" block. Posted code below. Can this actually work? Or should I try some other function?
02-18-2016 11:27 PM
look them
02-20-2016 02:03 AM
Thanks, I was able to get freq.vi to work and I was able to view the simulated square waves' frequency. I will try that again with a physical input.
However I encounter some error when opening the 2nd vi. I do not have the NI-DAQmx Driver? Is it a alternative hardware driver? My hardware is MyRIO. Is it compatible?
02-20-2016 08:16 AM
with myRIO you need to write some FPGA code, perhaps starting from an example, to do the DAQ portion. The nice thing about myRIO is the FPGA, which can sample the digital inputs very very fast, giving you great phase resolution when measuring speed. Here are some links you might review:
This example, is pretty straight forward, just put in the I/O nodes and timing in the example:
http://www.ni.com/example/31206/en/
When you want to advance and make the speed (RPM) measurement a pure digital high speed input, you may consider adding this as a separate look.
http://www.ni.com/white-paper/3230/en/
Hope these examples help you get going.
Preston