09-06-2013 07:42 PM
Hi,
I was told that I can use the one counter in the NI USB 6501 to measure period. So, I wrote this little VI, modeled after the VI I have that measures encoder period using the counters built into the NI cDAQ 9174 with the NI 9401 digital I/O module. I have my encoder wires GND and 5VDC on terminals 1 and 2, respectively. Also, I have encoder channel A and Channel B wires connected to terminals 9 (P2.7) and 24 (P0.7) respectively. With the MAX, I can count edges with this wiring. The purpose of this VI is to display an average value of 25 period measurements of the encoder. The encoder (120 cpt) is turning at about 2-5 rev/second, so, not that fast, maybe a total of 500 period per second; should be easy for this counter. I'm just spinning it with my finger, so, not that fast.
Please advise how to use the USB 6501. I can't find any wiring instructions, other than the pinout, but, the pinout doesn't tell you which channel is the counter gate on the USB 6501, so, I found a response on MAX at channel 24.
When I run this, the array is correctly initialized to 0.5, but, then I get this error, 200431. I found some things on the forum that suggest I cannot measure period, that I can only count edges. Should I throw this 6501 away?
Thanks,
Dave
09-09-2013
09:38 AM
- last edited on
01-31-2024
02:59 PM
by
migration-bot
Hi dav2010,
So the USB-6501 only has one counter which will tell you how many times the signal transitions high to low. Two counters are needed to actively get the period measurement. One to keep track of the beginning of the period and the second to count within the period. Here is a community example of doing a frequency measurement using a software timed unit such as the USB-6501:
With Freq = 1/Period, you might be able get something close to what you are looking for with the USB-6501.
09-09-2013 03:27 PM
A period measurement does only take just 1 counter on most NI hardware.
The 6501 however only has a counter with limited features (the same counter is used on the 6008/6009). It is only capable of software-timed edge count tasks. The example that Peter T linked you to (I remember writing it several years ago) is probably the best solution if you must use the 6501 (switch the inputs on the division to compute period instead of frequency).
Best Regards,
09-25-2013 09:33 AM
Well, I would rather use something that is easy, but, the issue I have is that I need 5 counters, and the 9174 has only 4 counters built in. If I buy the 9178, it has 8 counters ( I believe) but then, you are spending a lot of money for one extra counter, and I can't really use the other capability of the larger chassis. So, the question really is how best to economically measure 5 periods. Thanks, John.
Dave
09-25-2013
11:22 AM
- last edited on
01-31-2024
03:01 PM
by
migration-bot
The 9178 also only has 4 counters.
Do the 5 period measurements actually have to take place at the same time? Sometimes it might make sense to cycle through the channels to reduce the number of counters used (you wouldn't have to rewire connections or anything as the input terminals are software-defined). Switching from channel to channel in software should take on the order of ms depending on which hardware you end up using.
The 9171+(9401/9402) is a relatively cheap way to add additional counters to a system as the 9171 chassis has 4 counters just like the 9174 and 9178.
Best Regards,