05-07-2010 01:25 AM
Style tips:
For(imstuck) explains it well. LabVIEW works with the same (and sometimes fixed) numeric representations, it is good in automatic conversion, but that leaves the small red triangle on the connection to a function. Divide e.g. assumes a Single or Double and will always generate a conversion dot if fed an integer. Most of the time it doesn't affect the function of the program, but it's good style to minimize it.
Also try to not cross wires more than necessary and try not to wire backwards, both reduce the readability of the code.
You're on the right path, the style tips will help you if others (or you in 2 months) need to look at the code again. 😉
Program feedback:
Your loop has a 250ms wait, yet you check if it's passed 250ms since the first loop to decide if you should stop. This comparison will always be true. If it only runs once, do you need a loop at all? If you want to update twice, e.g. before and after the 250ms you can change it to a 2-run for-loop.
/Y
05-07-2010 06:11 AM
hi,
is your problem solved...? the best way of reading from pulse input and show as a Speed as RPM, then you can measure as frequency. if possible then you can change your read digital input as a Frequency instead of counter then you can display as its....
suppose, your counts gives 60 pulse/ rotation, if you read by frequency then its should be your RPM. if the encoder greater or lesser than 6o counts you can manipulate.
i think it must be a right way......
05-07-2010 11:47 AM
@yamaeda. Thank you for your tips. Regarding the looping, it has to keep counting pulses in intervals of 250ms as long as the test is running. I am monitoring speed constantly. The wait ticks for 250ms and I use stop loop if 250ms reaches to stop counting pulses on the DAQ counter read. Does that make sense?
@balaji... Can DAQ USB 6008 actually read pulses as frequency? I have not done that before.. Would it be the same as counting faling edge pulses?
VeeJay 😉
05-08-2010 12:00 AM
hello Veejay,
please find the attachments of screen shots. USB 6008 has a 5MHz with 1 counter inputs, i think for the Speed measurement is enough for this
05-10-2010 10:15 AM
@ balaji
I know that there is an option for frequency. I was just wondering how it would interpret my input pulses. My encoder has 6 PPR and right now I am counting falling edges and doing a conversion to calculate speed. If I choose frequency, what will be my output?
V
05-11-2010 12:37 PM
Hi Veejay,
The following article will have some good information on how frequency measurements are made. If you're talking about a low frequency measurement, the pulse train is compared to the onboard counter timebase. And the number of timebase ticks between each pulse train tick is counted, which gives us the period and hence the frequency.
http://zone.ni.com/devzone/cda/tut/p/id/7111
I hope this helps!
05-13-2010 08:08 AM
Thanks Tejander! That was helpful. But, I dont think direct frequency measurement is possible on a simple USB 6008. It has no hardware timing.
V