07-25-2014 01:37 AM
Hi
I'm trying to calculate the distance. I'm using an NI USB-6008 card. It has only one counter. So I'm going to find the digital out and then create a counter (in program). How do I program using only one counter (of the ni 6008)? I need configuration help too.
Please help.
07-25-2014 02:27 AM - edited 07-25-2014 02:28 AM
Hi kdm,
it's a good idea to discuss hardware related questions with NI sales guys before acquiring some cheap USB boxes! Reading spec sheets might help too.
- Your sensor needs (atleast) 10µs TTL trigger pulses. You will have a hard time to generate them with your USB6008… (Well, you could create 10ms pulses with those software-timed digital outputs.)
- Your sensor outputs its measurement data as time-coded signal. You will have a hard time to measure that time interval accurately with your UBS6008…
What do you want to count with that simple falling edge counter of the USB6008?
07-25-2014 03:03 AM
Hi Gerd,
How to send a 10us pulse on the trigger input?
Is the trigger pin connected to digital input (of usb6008) and echo pin connected to digital output?
07-25-2014 03:10 AM
07-25-2014 03:34 AM
Hi
And why do we need a counter? The PFI 0 pin can be connected to what?
Can echo pin be connected to PFI 0?
07-25-2014 03:53 AM
Hi kdm,
you started the discussion on using counters in your own question! Now you ask "why to use them"?
You can physically connect the ECHO pin with PFI0 input of the USB6008 - but you will not measure any meaningful values…
07-25-2014 04:10 AM
Hi Gerd,
Why wont I get meaningful values?
Can I use the PFI 0 as trigger output (10us) and then design a counter in the program?
07-25-2014 04:15 AM
Hi kdm,
did you read the manual of the USB6008? There's a chapter on usage of PFI0 that answers yopur question…
You can "design a counter" in your programm, but what do you want to count? You need to measure a time between two edges of a digital signal!
An idea: To measure the time of that digital signal you need to use one AI of the USB6008. It allows a sample rate of 10kS/s giving you a timing resolution of 100µs. You will need to analyze the AI signal to find your digital signal's edges…
07-28-2014 01:30 AM
Hi Gerd,
Yes, I read the manual. I've decided to use the PFI0 for the trigger pulse.
For counter design:
I could not understand your idea of using the AI signal to calculate time. Can you please elaborate?
And the minimun pulse width of echo is 150us, so I need to read for every "less than 150us". Am I right?
Or, can I begin a counter for every true (high) of a rising edge and then set a falling edge. When a falling edge, I make counter to stop. The resulting count value is multiplied by the time (read loop time) to get time elapsed.
07-28-2014 01:50 AM
Hi kdm,
again: read the specs of both devices, sensor and USB6008. Compare the specs to understand, what you can achieve with this combination - and what doesn't fit…
- You can read TTL signals with an AI too. The AI has the advantage of hardware-timed operation with a max sample rate of 10kS/s giving you a timing resolution of 100µs. You can detect echo pulses of atleast 100µs length - but only in 100µs steps (aka resolution). Will this fit for your application?
- The PFI0 ONLY acts as falling edge counter. That's it. No time measurement. No starting on rising edge and no stopping on falling edge. Just counting falling edges. Will this fit your application?
AGAIN: Compare the specs of both devices, sensor and USB6008!